From cb0999de2670046bda9c04959ae7ec16b8bc24d8 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 8 Aug 2024 23:01:08 +0300 Subject: [PATCH 01/15] add trip type --- src/CONST.ts | 8 ++++++++ src/components/SelectionList/SearchTableHeader.tsx | 1 + src/libs/SearchUtils.ts | 3 +++ 3 files changed, 12 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index 0db8aa68bd22..434e92b4bd1e 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -5242,6 +5242,7 @@ const CONST = { REPORT: 'report', EXPENSE: 'expense', INVOICE: 'invoice', + TRIP: 'trip', }, ACTION_TYPES: { VIEW: 'view', @@ -5276,6 +5277,13 @@ const CONST = { OUTSTANDING: 'outstanding', PAID: 'paid', }, + TRIP: { + ALL: 'all', + DRAFTS: 'drafts', + OUTSTANDING: 'outstanding', + APPROVED: 'approved', + PAID: 'paid', + }, }, TAB: { EXPENSE: { diff --git a/src/components/SelectionList/SearchTableHeader.tsx b/src/components/SelectionList/SearchTableHeader.tsx index 3f8abb4e1faf..f68b3c6d17ff 100644 --- a/src/components/SelectionList/SearchTableHeader.tsx +++ b/src/components/SelectionList/SearchTableHeader.tsx @@ -92,6 +92,7 @@ function getSearchColumns(type: SearchDataTypes): SearchColumnConfig[] { case CONST.SEARCH.DATA_TYPES.REPORT: case CONST.SEARCH.DATA_TYPES.EXPENSE: case CONST.SEARCH.DATA_TYPES.INVOICE: + case CONST.SEARCH.DATA_TYPES.TRIP: return expenseHeaders; default: return expenseHeaders; diff --git a/src/libs/SearchUtils.ts b/src/libs/SearchUtils.ts index 43b1fa6632f3..8e5c39dd33b3 100644 --- a/src/libs/SearchUtils.ts +++ b/src/libs/SearchUtils.ts @@ -239,6 +239,7 @@ function getListItem(type: SearchDataTypes, status: SearchStatus): ListItemType< case CONST.SEARCH.DATA_TYPES.EXPENSE: case CONST.SEARCH.DATA_TYPES.REPORT: case CONST.SEARCH.DATA_TYPES.INVOICE: + case CONST.SEARCH.DATA_TYPES.TRIP: return status === CONST.SEARCH.STATUS.EXPENSE.ALL ? TransactionListItem : ReportListItem; default: return TransactionListItem; @@ -251,6 +252,7 @@ function getSections(type: SearchDataTypes, status: SearchStatus, data: OnyxType case CONST.SEARCH.DATA_TYPES.EXPENSE: case CONST.SEARCH.DATA_TYPES.REPORT: case CONST.SEARCH.DATA_TYPES.INVOICE: + case CONST.SEARCH.DATA_TYPES.TRIP: return status === CONST.SEARCH.STATUS.EXPENSE.ALL ? getTransactionsSections(data, metadata) : getReportSections(data, metadata); default: return getTransactionsSections(data, metadata); @@ -263,6 +265,7 @@ function getSortedSections(type: SearchDataTypes, status: SearchStatus, data: Li case CONST.SEARCH.DATA_TYPES.EXPENSE: case CONST.SEARCH.DATA_TYPES.REPORT: case CONST.SEARCH.DATA_TYPES.INVOICE: + case CONST.SEARCH.DATA_TYPES.TRIP: return status === CONST.SEARCH.STATUS.EXPENSE.ALL ? getSortedTransactionData(data as TransactionListItemType[], sortBy, sortOrder) : getSortedReportData(data as ReportListItemType[]); From 702c55083d4ef40e1e1da0267c897391ccf3bc1a Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 8 Aug 2024 23:21:51 +0300 Subject: [PATCH 02/15] create content --- src/components/Search/index.tsx | 2 +- src/languages/en.ts | 5 ++++ src/languages/es.ts | 5 ++++ src/pages/Search/EmptySearchView.tsx | 42 ++++++++++++++++++++++++---- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 873c051aaa95..e99e9130c48c 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -223,7 +223,7 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { queryJSON={queryJSON} hash={hash} /> - + ); } diff --git a/src/languages/en.ts b/src/languages/en.ts index a139a5ca4d72..fc1fdb68117c 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3646,6 +3646,11 @@ export default { title: 'Nothing to show', subtitle: 'Try creating something using the green + button.', }, + emptyTripResults: { + title: 'Nothing to show', + subtitle: 'Try creating something using the green + button.', + buttonText: 'Book trip', + }, }, groupedExpenses: 'grouped expenses', bulkActions: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 30086da1fa89..dd770ad9d3b2 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3700,6 +3700,11 @@ export default { title: 'No hay nada que ver aquí', subtitle: 'Por favor intenta crear algo usando el botón verde.', }, + emptyTripResults: { + title: 'Nothing to show', + subtitle: 'Try creating something using the green + button.', + buttonText: 'Book trip', + }, }, groupedExpenses: 'gastos agrupados', bulkActions: { diff --git a/src/pages/Search/EmptySearchView.tsx b/src/pages/Search/EmptySearchView.tsx index 474cbfc0aff8..1588b16cfb4a 100644 --- a/src/pages/Search/EmptySearchView.tsx +++ b/src/pages/Search/EmptySearchView.tsx @@ -2,23 +2,53 @@ import React from 'react'; import EmptyStateComponent from '@components/EmptyStateComponent'; import * as Illustrations from '@components/Icon/Illustrations'; import SearchRowSkeleton from '@components/Skeletons/SearchRowSkeleton'; -import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import * as Localize from '@libs/Localize'; +import Navigation from '@libs/Navigation/Navigation'; import CONST from '@src/CONST'; +import ROUTES from '@src/ROUTES'; +import type {SearchDataTypes} from '@src/types/onyx/SearchResults'; -function EmptySearchView() { - const {translate} = useLocalize(); +function getContent(type: SearchDataTypes) { + switch (type) { + case CONST.SEARCH.DATA_TYPES.TRIP: + return { + headerMedia: Illustrations.EmptyStateTravel, + title: Localize.translateLocal('search.searchResults.emptyTripResults.title'), + subtitle: Localize.translateLocal('search.searchResults.emptyTripResults.subtitle'), + buttonText: Localize.translateLocal('search.searchResults.emptyTripResults.buttonText'), + buttonAction: () => Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS), + }; + case CONST.SEARCH.DATA_TYPES.TRANSACTION: + case CONST.SEARCH.DATA_TYPES.REPORT: + case CONST.SEARCH.DATA_TYPES.EXPENSE: + case CONST.SEARCH.DATA_TYPES.INVOICE: + default: + return { + headerMedia: Illustrations.EmptyState, + title: Localize.translateLocal('search.searchResults.emptyResults.title'), + subtitle: Localize.translateLocal('search.searchResults.emptyResults.subtitle'), + buttonText: undefined, + buttonAction: undefined, + }; + } +} + +function EmptySearchView({type}) { const styles = useThemeStyles(); + const content = getContent(type); return ( ); } From 94368f8b9d4e74f6a7f0a4cc25b9ff744ea0981e Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 8 Aug 2024 23:52:52 +0300 Subject: [PATCH 03/15] update empty state --- src/components/EmptyStateComponent/index.tsx | 6 +++--- src/languages/en.ts | 6 +++--- src/pages/Search/EmptySearchView.tsx | 13 ++++++++++--- src/styles/index.ts | 4 ++++ 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/components/EmptyStateComponent/index.tsx b/src/components/EmptyStateComponent/index.tsx index 1efa526355f1..a2c93e6d7614 100644 --- a/src/components/EmptyStateComponent/index.tsx +++ b/src/components/EmptyStateComponent/index.tsx @@ -96,9 +96,9 @@ function EmptyStateComponent({ + text={buttonText} + style={[styles.mt5]} + /> )} diff --git a/src/languages/en.ts b/src/languages/en.ts index fc1fdb68117c..22b6cf5a820d 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3647,9 +3647,9 @@ export default { subtitle: 'Try creating something using the green + button.', }, emptyTripResults: { - title: 'Nothing to show', - subtitle: 'Try creating something using the green + button.', - buttonText: 'Book trip', + title: 'No trips to display', + subtitle: 'Get started by booking your first trip below.', + buttonText: 'Book a trip', }, }, groupedExpenses: 'grouped expenses', diff --git a/src/pages/Search/EmptySearchView.tsx b/src/pages/Search/EmptySearchView.tsx index 1588b16cfb4a..524ef8a471b7 100644 --- a/src/pages/Search/EmptySearchView.tsx +++ b/src/pages/Search/EmptySearchView.tsx @@ -8,12 +8,14 @@ import Navigation from '@libs/Navigation/Navigation'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; import type {SearchDataTypes} from '@src/types/onyx/SearchResults'; +import colors from '@styles/theme/colors'; function getContent(type: SearchDataTypes) { switch (type) { case CONST.SEARCH.DATA_TYPES.TRIP: return { headerMedia: Illustrations.EmptyStateTravel, + headerStyles: {backgroundColor: colors.blue600}, title: Localize.translateLocal('search.searchResults.emptyTripResults.title'), subtitle: Localize.translateLocal('search.searchResults.emptyTripResults.subtitle'), buttonText: Localize.translateLocal('search.searchResults.emptyTripResults.buttonText'), @@ -26,6 +28,7 @@ function getContent(type: SearchDataTypes) { default: return { headerMedia: Illustrations.EmptyState, + headerStyles: {backgroundColor: colors.yellow600}, title: Localize.translateLocal('search.searchResults.emptyResults.title'), subtitle: Localize.translateLocal('search.searchResults.emptyResults.subtitle'), buttonText: undefined, @@ -34,16 +37,20 @@ function getContent(type: SearchDataTypes) { } } -function EmptySearchView({type}) { +type EmptySearchViewProps = { + type: SearchDataTypes; +}; + +function EmptySearchView({type}: EmptySearchViewProps) { const styles = useThemeStyles(); - const content = getContent(type); + const content = getContent(type, styles); return ( backgroundColor: theme.emptyFolderBG, }, + emptyTripBG: { + backgroundColor: theme.mentionBG, + }, + emptyStateVideo: { borderTopLeftRadius: variables.componentBorderRadiusLarge, borderTopRightRadius: variables.componentBorderRadiusLarge, From 4d85ff75ccac4c4b50ddc31128a0d351389eb9f4 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 9 Aug 2024 00:09:13 +0300 Subject: [PATCH 04/15] refactor empty view --- src/pages/Search/EmptySearchView.tsx | 65 +++++++++++++++------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/src/pages/Search/EmptySearchView.tsx b/src/pages/Search/EmptySearchView.tsx index 524ef8a471b7..2d34ec858ed9 100644 --- a/src/pages/Search/EmptySearchView.tsx +++ b/src/pages/Search/EmptySearchView.tsx @@ -1,41 +1,15 @@ -import React from 'react'; +import React, {useMemo} from 'react'; import EmptyStateComponent from '@components/EmptyStateComponent'; import * as Illustrations from '@components/Icon/Illustrations'; import SearchRowSkeleton from '@components/Skeletons/SearchRowSkeleton'; +import useLocalize from '@hooks/useLocalize'; +import useStyleUtils from '@hooks/useStyleUtils'; +import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as Localize from '@libs/Localize'; import Navigation from '@libs/Navigation/Navigation'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; import type {SearchDataTypes} from '@src/types/onyx/SearchResults'; -import colors from '@styles/theme/colors'; - -function getContent(type: SearchDataTypes) { - switch (type) { - case CONST.SEARCH.DATA_TYPES.TRIP: - return { - headerMedia: Illustrations.EmptyStateTravel, - headerStyles: {backgroundColor: colors.blue600}, - title: Localize.translateLocal('search.searchResults.emptyTripResults.title'), - subtitle: Localize.translateLocal('search.searchResults.emptyTripResults.subtitle'), - buttonText: Localize.translateLocal('search.searchResults.emptyTripResults.buttonText'), - buttonAction: () => Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS), - }; - case CONST.SEARCH.DATA_TYPES.TRANSACTION: - case CONST.SEARCH.DATA_TYPES.REPORT: - case CONST.SEARCH.DATA_TYPES.EXPENSE: - case CONST.SEARCH.DATA_TYPES.INVOICE: - default: - return { - headerMedia: Illustrations.EmptyState, - headerStyles: {backgroundColor: colors.yellow600}, - title: Localize.translateLocal('search.searchResults.emptyResults.title'), - subtitle: Localize.translateLocal('search.searchResults.emptyResults.subtitle'), - buttonText: undefined, - buttonAction: undefined, - }; - } -} type EmptySearchViewProps = { type: SearchDataTypes; @@ -43,7 +17,36 @@ type EmptySearchViewProps = { function EmptySearchView({type}: EmptySearchViewProps) { const styles = useThemeStyles(); - const content = getContent(type, styles); + const theme = useTheme(); + const StyleUtils = useStyleUtils(); + const {translate} = useLocalize(); + + const content = useMemo(() => { + switch (type) { + case CONST.SEARCH.DATA_TYPES.TRIP: + return { + headerMedia: Illustrations.EmptyStateTravel, + headerStyles: StyleUtils.getBackgroundColorStyle(theme.mentionBG), + title: translate('search.searchResults.emptyTripResults.title'), + subtitle: translate('search.searchResults.emptyTripResults.subtitle'), + buttonText: translate('search.searchResults.emptyTripResults.buttonText'), + buttonAction: () => Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS), + }; + case CONST.SEARCH.DATA_TYPES.TRANSACTION: + case CONST.SEARCH.DATA_TYPES.REPORT: + case CONST.SEARCH.DATA_TYPES.EXPENSE: + case CONST.SEARCH.DATA_TYPES.INVOICE: + default: + return { + headerMedia: Illustrations.EmptyState, + headerStyles: StyleUtils.getBackgroundColorStyle(theme.emptyFolderBG), + title: translate('search.searchResults.emptyResults.title'), + subtitle: translate('search.searchResults.emptyResults.subtitle'), + buttonText: undefined, + buttonAction: undefined, + }; + } + }, [type, StyleUtils, translate, theme]); return ( Date: Fri, 9 Aug 2024 17:37:18 +0300 Subject: [PATCH 05/15] translate spanish --- src/languages/es.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index dd770ad9d3b2..7adc2a688019 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3701,9 +3701,9 @@ export default { subtitle: 'Por favor intenta crear algo usando el botón verde.', }, emptyTripResults: { - title: 'Nothing to show', - subtitle: 'Try creating something using the green + button.', - buttonText: 'Book trip', + title: 'Sin viajes para visualizar', + subtitle: 'Empiece reservando su primer viaje a continuación.', + buttonText: 'Reserve un viaje', }, }, groupedExpenses: 'gastos agrupados', From 073844c4b715bb952521cd801b58f5857051826f Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 9 Aug 2024 17:41:41 +0300 Subject: [PATCH 06/15] add all statuses to type --- src/components/Search/types.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts index 54b26ea6bac4..66284664f1e6 100644 --- a/src/components/Search/types.ts +++ b/src/components/Search/types.ts @@ -25,7 +25,9 @@ type SelectedTransactions = Record; type SortOrder = ValueOf; type SearchColumnType = ValueOf; type ExpenseSearchStatus = ValueOf; -type SearchStatus = ExpenseSearchStatus; +type InvoiceSearchStatus = ValueOf; +type TripSearchStatus = ValueOf; +type SearchStatus = ExpenseSearchStatus | InvoiceSearchStatus | TripSearchStatus; type SearchContext = { currentSearchHash: number; From 664873f7e9c09464a4a216b904a347f8c247309d Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 9 Aug 2024 17:43:42 +0300 Subject: [PATCH 07/15] rm unused style --- src/styles/index.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/styles/index.ts b/src/styles/index.ts index 736d6b8a9879..59803541bfef 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -5143,10 +5143,6 @@ const styles = (theme: ThemeColors) => backgroundColor: theme.emptyFolderBG, }, - emptyTripBG: { - backgroundColor: theme.mentionBG, - }, - emptyStateVideo: { borderTopLeftRadius: variables.componentBorderRadiusLarge, borderTopRightRadius: variables.componentBorderRadiusLarge, From 0966247e9ce4b3a0b23c67af84505981f0f302df Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 9 Aug 2024 18:00:14 +0300 Subject: [PATCH 08/15] rename obj keys --- src/components/Search/SearchPageHeader.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Search/SearchPageHeader.tsx b/src/components/Search/SearchPageHeader.tsx index 039526923b3a..7e4b69c39596 100644 --- a/src/components/Search/SearchPageHeader.tsx +++ b/src/components/Search/SearchPageHeader.tsx @@ -100,11 +100,11 @@ type SearchPageHeaderProps = { type SearchHeaderOptionValue = DeepValueOf | undefined; -const headerContent: {[key in SearchStatus]: {icon: IconAsset; titleTx: TranslationPaths}} = { - all: {icon: Illustrations.MoneyReceipts, titleTx: 'common.expenses'}, - shared: {icon: Illustrations.SendMoney, titleTx: 'common.shared'}, - drafts: {icon: Illustrations.Pencil, titleTx: 'common.drafts'}, - finished: {icon: Illustrations.CheckmarkCircle, titleTx: 'common.finished'}, +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 SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModalOpen, setDownloadErrorModalOpen, isCustomQuery, data}: SearchPageHeaderProps) { @@ -132,7 +132,7 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa [data, selectedTransactions], ); const {status} = queryJSON; - const headerSubtitle = isCustomQuery ? SearchUtils.getSearchHeaderTitle(queryJSON) : translate(headerContent[status]?.titleTx); + const headerSubtitle = isCustomQuery ? SearchUtils.getSearchHeaderTitle(queryJSON) : translate(headerContent[status]?.titleText); const headerTitle = isCustomQuery ? translate('search.filtersHeader') : ''; const headerIcon = isCustomQuery ? Illustrations.Filters : headerContent[status]?.icon; From 75c4b84d6b15bb8e3986153c60c687e7a237d09e Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 9 Aug 2024 18:24:20 +0300 Subject: [PATCH 09/15] update colors --- src/components/Search/types.ts | 4 +--- src/pages/Search/EmptySearchView.tsx | 2 +- src/styles/theme/themes/dark.ts | 1 + src/styles/theme/themes/light.ts | 1 + src/styles/theme/types.ts | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts index 66284664f1e6..54b26ea6bac4 100644 --- a/src/components/Search/types.ts +++ b/src/components/Search/types.ts @@ -25,9 +25,7 @@ type SelectedTransactions = Record; type SortOrder = ValueOf; type SearchColumnType = ValueOf; type ExpenseSearchStatus = ValueOf; -type InvoiceSearchStatus = ValueOf; -type TripSearchStatus = ValueOf; -type SearchStatus = ExpenseSearchStatus | InvoiceSearchStatus | TripSearchStatus; +type SearchStatus = ExpenseSearchStatus; type SearchContext = { currentSearchHash: number; diff --git a/src/pages/Search/EmptySearchView.tsx b/src/pages/Search/EmptySearchView.tsx index 2d34ec858ed9..99b17e633243 100644 --- a/src/pages/Search/EmptySearchView.tsx +++ b/src/pages/Search/EmptySearchView.tsx @@ -26,7 +26,7 @@ function EmptySearchView({type}: EmptySearchViewProps) { case CONST.SEARCH.DATA_TYPES.TRIP: return { headerMedia: Illustrations.EmptyStateTravel, - headerStyles: StyleUtils.getBackgroundColorStyle(theme.mentionBG), + headerStyles: StyleUtils.getBackgroundColorStyle(theme.travelBG), title: translate('search.searchResults.emptyTripResults.title'), subtitle: translate('search.searchResults.emptyTripResults.subtitle'), buttonText: translate('search.searchResults.emptyTripResults.buttonText'), diff --git a/src/styles/theme/themes/dark.ts b/src/styles/theme/themes/dark.ts index 7ed23c7c0991..eedcca6199e4 100644 --- a/src/styles/theme/themes/dark.ts +++ b/src/styles/theme/themes/dark.ts @@ -94,6 +94,7 @@ const darkTheme = { videoPlayerBG: `${colors.productDark100}cc`, transparentWhite: `${colors.white}51`, emptyFolderBG: colors.yellow600, + travelBG: colors.blue600, // Adding a color here will animate the status bar to the right color when the screen is opened. // Note that it needs to be a screen name, not a route url. diff --git a/src/styles/theme/themes/light.ts b/src/styles/theme/themes/light.ts index 2ebb558ee20b..f578e6f48641 100644 --- a/src/styles/theme/themes/light.ts +++ b/src/styles/theme/themes/light.ts @@ -94,6 +94,7 @@ const lightTheme = { videoPlayerBG: `${colors.productDark100}cc`, transparentWhite: `${colors.white}51`, emptyFolderBG: colors.yellow600, + travelBG: colors.blue600, // Adding a color here will animate the status bar to the right color when the screen is opened. // Note that it needs to be a screen name, not a route url. diff --git a/src/styles/theme/types.ts b/src/styles/theme/types.ts index ffa42e99777d..bafeae6a3fee 100644 --- a/src/styles/theme/types.ts +++ b/src/styles/theme/types.ts @@ -98,6 +98,7 @@ type ThemeColors = { videoPlayerBG: Color; transparentWhite: Color; emptyFolderBG: Color; + travelBG: Color; PAGE_THEMES: Record; From 98d621d9b2100896e8cba3fb65fe1b4d156b4f33 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 9 Aug 2024 20:52:25 +0300 Subject: [PATCH 10/15] update es translation --- src/languages/es.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index 7adc2a688019..2aba159f0195 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3701,9 +3701,9 @@ export default { subtitle: 'Por favor intenta crear algo usando el botón verde.', }, emptyTripResults: { - title: 'Sin viajes para visualizar', - subtitle: 'Empiece reservando su primer viaje a continuación.', - buttonText: 'Reserve un viaje', + title: 'No tienes viajes', + subtitle: 'Reserva tu primer viaje a continuación.', + buttonText: 'Reserva un viaje', }, }, groupedExpenses: 'gastos agrupados', From 52225a0f508fa3ab128b52b49b7157b76402d744 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 12 Aug 2024 11:30:15 +0000 Subject: [PATCH 11/15] update styles --- src/pages/Search/EmptySearchView.tsx | 3 +++ src/styles/variables.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/pages/Search/EmptySearchView.tsx b/src/pages/Search/EmptySearchView.tsx index 99b17e633243..21180d77f9f1 100644 --- a/src/pages/Search/EmptySearchView.tsx +++ b/src/pages/Search/EmptySearchView.tsx @@ -7,6 +7,7 @@ import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; +import variables from '@styles/variables'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; import type {SearchDataTypes} from '@src/types/onyx/SearchResults'; @@ -27,6 +28,7 @@ function EmptySearchView({type}: EmptySearchViewProps) { return { headerMedia: Illustrations.EmptyStateTravel, headerStyles: StyleUtils.getBackgroundColorStyle(theme.travelBG), + headerContentStyles: StyleUtils.getWidthAndHeightStyle(variables.w191, variables.h170), title: translate('search.searchResults.emptyTripResults.title'), subtitle: translate('search.searchResults.emptyTripResults.subtitle'), buttonText: translate('search.searchResults.emptyTripResults.buttonText'), @@ -40,6 +42,7 @@ function EmptySearchView({type}: EmptySearchViewProps) { return { headerMedia: Illustrations.EmptyState, headerStyles: StyleUtils.getBackgroundColorStyle(theme.emptyFolderBG), + headerContentStyles: StyleUtils.getWidthAndHeightStyle(variables.w184, variables.h112), title: translate('search.searchResults.emptyResults.title'), subtitle: translate('search.searchResults.emptyResults.subtitle'), buttonText: undefined, diff --git a/src/styles/variables.ts b/src/styles/variables.ts index ea838feee1a0..5139bf2b393f 100644 --- a/src/styles/variables.ts +++ b/src/styles/variables.ts @@ -252,6 +252,8 @@ export default { h20: 20, h28: 28, h36: 36, + h112: 112, + h170: 170, w20: 20, w28: 28, w36: 36, @@ -261,4 +263,6 @@ export default { w80: 80, w92: 92, w96: 96, + w184: 184, + w191: 191, } as const; From 04ed756146a777e8d1bd877483d9305a3fea923b Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 12 Aug 2024 11:55:43 +0000 Subject: [PATCH 12/15] apply changes --- src/pages/Search/EmptySearchView.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/Search/EmptySearchView.tsx b/src/pages/Search/EmptySearchView.tsx index 21180d77f9f1..51db0e127779 100644 --- a/src/pages/Search/EmptySearchView.tsx +++ b/src/pages/Search/EmptySearchView.tsx @@ -5,7 +5,6 @@ import SearchRowSkeleton from '@components/Skeletons/SearchRowSkeleton'; import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; -import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import variables from '@styles/variables'; import CONST from '@src/CONST'; @@ -17,7 +16,6 @@ type EmptySearchViewProps = { }; function EmptySearchView({type}: EmptySearchViewProps) { - const styles = useThemeStyles(); const theme = useTheme(); const StyleUtils = useStyleUtils(); const {translate} = useLocalize(); @@ -57,7 +55,7 @@ function EmptySearchView({type}: EmptySearchViewProps) { headerMediaType={CONST.EMPTY_STATE_MEDIA.ILLUSTRATION} headerMedia={content.headerMedia} headerStyles={content.headerStyles} - headerContentStyles={styles.emptyStateFolderIconSize} + headerContentStyles={content.headerContentStyles} title={content.title} subtitle={content.subtitle} buttonText={content.buttonText} From 9a62ec0d537cea76415169e6259eb37188fb75a7 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 12 Aug 2024 12:04:16 -0600 Subject: [PATCH 13/15] fix image clip --- ios/Podfile.lock | 12 ++++++------ src/components/Search/index.tsx | 4 ++-- src/pages/Search/EmptySearchView.tsx | 2 +- src/styles/variables.ts | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index f5c825e63868..d8661fe2a58c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1871,7 +1871,7 @@ PODS: - RNGoogleSignin (10.0.1): - GoogleSignIn (~> 7.0) - React-Core - - RNLiveMarkdown (0.1.111): + - RNLiveMarkdown (0.1.107): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -1889,9 +1889,9 @@ PODS: - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNLiveMarkdown/common (= 0.1.111) + - RNLiveMarkdown/common (= 0.1.107) - Yoga - - RNLiveMarkdown/common (0.1.111): + - RNLiveMarkdown/common (0.1.107): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -2614,7 +2614,7 @@ SPEC CHECKSUMS: RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 74b7b3d06d667ba0bbf41da7718f2607ae0dfe8f RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 - RNLiveMarkdown: cf2707e6050a3548bde4f66bd752d721f91e8ab6 + RNLiveMarkdown: f0c641a0bcf5fdea3ec1bb52a64b30ff88d25c1f RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 rnmapbox-maps: df8fe93dbd251f25022f4023d31bc04160d4d65c RNPermissions: d2392b754e67bc14491f5b12588bef2864e783f3 @@ -2623,7 +2623,7 @@ SPEC CHECKSUMS: RNScreens: abd354e98519ed267600b7ee64fdcb8e060b1218 RNShare: 2a4cdfc0626ad56b0ef583d424f2038f772afe58 RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852 - RNSVG: 8c067e7203053d4c82f456cbeab1fe509ac797dd + RNSVG: 0364037e4bd5a2235ac8ecd76bcad0d198698095 SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9 SDWebImageAVIFCoder: 8348fef6d0ec69e129c66c9fe4d74fbfbf366112 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c @@ -2635,4 +2635,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 12949aadf6042925ca96a70eb9d0c591688d973c -COCOAPODS: 1.15.2 +COCOAPODS: 1.12.1 diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index e9b434ffa686..8a9847778c91 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -203,7 +203,7 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { ); } - const type = SearchUtils.getSearchType(searchResults?.search); + const type = "trip"; if (searchResults === undefined || type === undefined) { Log.alert('[Search] Undefined search type'); @@ -217,7 +217,7 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { const shouldShowEmptyState = !isDataLoaded || data.length === 0; - if (shouldShowEmptyState) { + if (true) { return ( <> Date: Mon, 12 Aug 2024 12:06:42 -0600 Subject: [PATCH 14/15] restore podfile.lock --- ios/Podfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d8661fe2a58c..f5c825e63868 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1871,7 +1871,7 @@ PODS: - RNGoogleSignin (10.0.1): - GoogleSignIn (~> 7.0) - React-Core - - RNLiveMarkdown (0.1.107): + - RNLiveMarkdown (0.1.111): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -1889,9 +1889,9 @@ PODS: - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNLiveMarkdown/common (= 0.1.107) + - RNLiveMarkdown/common (= 0.1.111) - Yoga - - RNLiveMarkdown/common (0.1.107): + - RNLiveMarkdown/common (0.1.111): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -2614,7 +2614,7 @@ SPEC CHECKSUMS: RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 74b7b3d06d667ba0bbf41da7718f2607ae0dfe8f RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 - RNLiveMarkdown: f0c641a0bcf5fdea3ec1bb52a64b30ff88d25c1f + RNLiveMarkdown: cf2707e6050a3548bde4f66bd752d721f91e8ab6 RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 rnmapbox-maps: df8fe93dbd251f25022f4023d31bc04160d4d65c RNPermissions: d2392b754e67bc14491f5b12588bef2864e783f3 @@ -2623,7 +2623,7 @@ SPEC CHECKSUMS: RNScreens: abd354e98519ed267600b7ee64fdcb8e060b1218 RNShare: 2a4cdfc0626ad56b0ef583d424f2038f772afe58 RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852 - RNSVG: 0364037e4bd5a2235ac8ecd76bcad0d198698095 + RNSVG: 8c067e7203053d4c82f456cbeab1fe509ac797dd SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9 SDWebImageAVIFCoder: 8348fef6d0ec69e129c66c9fe4d74fbfbf366112 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c @@ -2635,4 +2635,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 12949aadf6042925ca96a70eb9d0c591688d973c -COCOAPODS: 1.12.1 +COCOAPODS: 1.15.2 From 8d15aa1fda8a25e91d91e2d789fb2f4bf89bd5a8 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 12 Aug 2024 12:07:28 -0600 Subject: [PATCH 15/15] revert hardcoded values --- src/components/Search/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 8a9847778c91..e9b434ffa686 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -203,7 +203,7 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { ); } - const type = "trip"; + const type = SearchUtils.getSearchType(searchResults?.search); if (searchResults === undefined || type === undefined) { Log.alert('[Search] Undefined search type'); @@ -217,7 +217,7 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { const shouldShowEmptyState = !isDataLoaded || data.length === 0; - if (true) { + if (shouldShowEmptyState) { return ( <>