Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Create status bar" #47748

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

15 changes: 12 additions & 3 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5251,6 +5251,8 @@ const CONST = {
SEARCH: {
RESULTS_PAGE_SIZE: 50,
DATA_TYPES: {
TRANSACTION: 'transaction',
REPORT: 'report',
EXPENSE: 'expense',
INVOICE: 'invoice',
TRIP: 'trip',
Expand Down Expand Up @@ -5279,10 +5281,9 @@ const CONST = {
STATUS: {
EXPENSE: {
ALL: 'all',
SHARED: 'shared',
DRAFTS: 'drafts',
OUTSTANDING: 'outstanding',
APPROVED: 'approved',
PAID: 'paid',
FINISHED: 'finished',
},
INVOICE: {
ALL: 'all',
Expand All @@ -5297,6 +5298,14 @@ const CONST = {
PAID: 'paid',
},
},
TAB: {
EXPENSE: {
ALL: 'type:expense status:all',
SHARED: 'type:expense status:shared',
DRAFTS: 'type:expense status:drafts',
FINISHED: 'type:expense status:finished',
},
},
TABLE_COLUMNS: {
RECEIPT: 'receipt',
DATE: 'date',
Expand Down
20 changes: 3 additions & 17 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ type ButtonProps = Partial<ChildrenProps> & {
/** The fill color to pass into the icon. */
iconFill?: string;

/** The fill color to pass into the icon when the button is hovered. */
iconHoverFill?: string;

/** Any additional styles to pass to the left icon container. */
iconStyles?: StyleProp<ViewStyle>;

Expand Down Expand Up @@ -83,15 +80,9 @@ type ButtonProps = Partial<ChildrenProps> & {
/** Additional text styles */
textStyles?: StyleProp<TextStyle>;

/** Additional text styles when the button is hovered */
textHoverStyles?: StyleProp<TextStyle>;

/** Whether we should use the default hover style */
shouldUseDefaultHover?: boolean;

/** Additional hover styles */
hoverStyles?: StyleProp<ViewStyle>;

/** Whether we should use the success theme color */
success?: boolean;

Expand Down Expand Up @@ -179,7 +170,6 @@ function Button(

iconRight = Expensicons.ArrowRight,
iconFill,
iconHoverFill,
icon = null,
iconStyles = [],
iconRightStyles = [],
Expand All @@ -204,10 +194,8 @@ function Button(
style = [],
innerStyles = [],
textStyles = [],
textHoverStyles = [],

shouldUseDefaultHover = true,
hoverStyles = undefined,
success = false,
danger = false,

Expand Down Expand Up @@ -250,7 +238,6 @@ function Button(
danger && styles.buttonDangerText,
!!icon && styles.textAlignLeft,
textStyles,
isHovered && textHoverStyles,
link && styles.link,
link && isHovered && StyleUtils.getColorStyle(theme.linkHover),
link && styles.fontWeightNormal,
Expand All @@ -272,7 +259,7 @@ function Button(
<Icon
src={icon}
hasText={!!text}
fill={isHovered ? iconHoverFill : iconFill ?? (success || danger ? theme.textLight : theme.icon)}
fill={iconFill ?? (success || danger ? theme.textLight : theme.icon)}
small={small}
medium={medium}
large={large}
Expand All @@ -286,14 +273,14 @@ function Button(
{!isSplitButton ? (
<Icon
src={iconRight}
fill={isHovered ? iconHoverFill : iconFill ?? (success || danger ? theme.textLight : theme.icon)}
fill={iconFill ?? (success || danger ? theme.textLight : theme.icon)}
small={medium}
medium={large}
/>
) : (
<Icon
src={iconRight}
fill={isHovered ? iconHoverFill : iconFill ?? (success || danger ? theme.textLight : theme.icon)}
fill={iconFill ?? (success || danger ? theme.textLight : theme.icon)}
small={small}
medium={medium}
large={large}
Expand Down Expand Up @@ -371,7 +358,6 @@ function Button(
shouldUseDefaultHover && !isDisabled ? styles.buttonDefaultHovered : undefined,
success && !isDisabled ? styles.buttonSuccessHovered : undefined,
danger && !isDisabled ? styles.buttonDangerHovered : undefined,
hoverStyles,
]}
id={id}
accessibilityLabel={accessibilityLabel}
Expand Down
2 changes: 0 additions & 2 deletions src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import CreditCardsNew from '@assets/images/simple-illustrations/simple-illustrat
import CreditCardEyes from '@assets/images/simple-illustrations/simple-illustration__creditcardeyes.svg';
import EmailAddress from '@assets/images/simple-illustrations/simple-illustration__email-address.svg';
import EmptyState from '@assets/images/simple-illustrations/simple-illustration__empty-state.svg';
import EnvelopeReceipt from '@assets/images/simple-illustrations/simple-illustration__envelopereceipt.svg';
import Filters from '@assets/images/simple-illustrations/simple-illustration__filters.svg';
import FolderOpen from '@assets/images/simple-illustrations/simple-illustration__folder-open.svg';
import Gears from '@assets/images/simple-illustrations/simple-illustration__gears.svg';
Expand Down Expand Up @@ -122,7 +121,6 @@ export {
EmailAddress,
EmptyCardState,
EmptyStateExpenses,
EnvelopeReceipt,
FolderOpen,
HandCard,
HotDogStand,
Expand Down
30 changes: 10 additions & 20 deletions src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {SearchDataTypes, SearchReport} from '@src/types/onyx/SearchResults';
import type {SearchReport} from '@src/types/onyx/SearchResults';
import type DeepValueOf from '@src/types/utils/DeepValueOf';
import type IconAsset from '@src/types/utils/IconAsset';
import {useSearchContext} from './SearchContext';
import type {SearchQueryJSON} from './types';
import type {SearchQueryJSON, SearchStatus} from './types';

type HeaderWrapperProps = Pick<HeaderWithBackButtonProps, 'title' | 'subtitle' | 'icon' | 'children'> & {
subtitleStyles?: StyleProp<TextStyle>;
Expand Down Expand Up @@ -100,23 +100,13 @@ type SearchPageHeaderProps = {

type SearchHeaderOptionValue = DeepValueOf<typeof CONST.SEARCH.BULK_ACTION_TYPES> | undefined;

type HeaderContent = {
icon: IconAsset;
titleText: TranslationPaths;
const headerContent: {[key in SearchStatus]: {icon: IconAsset; titleText: TranslationPaths}} = {
all: {icon: Illustrations.MoneyReceipts, titleText: 'common.expenses'},
shared: {icon: Illustrations.SendMoney, titleText: 'common.shared'},
drafts: {icon: Illustrations.Pencil, titleText: 'common.drafts'},
finished: {icon: Illustrations.CheckmarkCircle, titleText: 'common.finished'},
};

function getHeaderContent(type: SearchDataTypes): HeaderContent {
switch (type) {
case CONST.SEARCH.DATA_TYPES.INVOICE:
return {icon: Illustrations.EnvelopeReceipt, titleText: 'workspace.common.invoices'};
case CONST.SEARCH.DATA_TYPES.TRIP:
return {icon: Illustrations.Luggage, titleText: 'travel.trips'};
case CONST.SEARCH.DATA_TYPES.EXPENSE:
default:
return {icon: Illustrations.MoneyReceipts, titleText: 'common.expenses'};
}
}

function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModalOpen, setDownloadErrorModalOpen, isCustomQuery, data}: SearchPageHeaderProps) {
const {translate} = useLocalize();
const theme = useTheme();
Expand All @@ -141,10 +131,10 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa
.map((item) => item.reportID),
[data, selectedTransactions],
);
const {status, type} = queryJSON;
const headerSubtitle = isCustomQuery ? SearchUtils.getSearchHeaderTitle(queryJSON) : translate(getHeaderContent(type).titleText);
const {status} = queryJSON;
const headerSubtitle = isCustomQuery ? SearchUtils.getSearchHeaderTitle(queryJSON) : translate(headerContent[status]?.titleText);
const headerTitle = isCustomQuery ? translate('search.filtersHeader') : '';
const headerIcon = isCustomQuery ? Illustrations.Filters : getHeaderContent(type).icon;
const headerIcon = isCustomQuery ? Illustrations.Filters : headerContent[status]?.icon;

const subtitleStyles = isCustomQuery ? {} : styles.textHeadlineH2;

Expand Down
Loading
Loading