From 68969fe276e5799f37cd7ae5a9af8269253203f6 Mon Sep 17 00:00:00 2001 From: Mateusz Titz Date: Tue, 13 Aug 2024 16:25:24 +0200 Subject: [PATCH] Remove recent reports section in From/To filters and fix header --- .../SearchFiltersParticipantsSelector.tsx | 20 +++++-------------- .../SearchFiltersFromPage.tsx | 8 ++++---- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/components/Search/SearchFiltersParticipantsSelector.tsx b/src/components/Search/SearchFiltersParticipantsSelector.tsx index b457d013ee5f..7874ed24d3f8 100644 --- a/src/components/Search/SearchFiltersParticipantsSelector.tsx +++ b/src/components/Search/SearchFiltersParticipantsSelector.tsx @@ -82,7 +82,6 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: betas, selectedOptions, excludeLogins: CONST.EXPENSIFY_EMAILS, - maxRecentReportsToShow: CONST.IOU.MAX_RECENT_REPORTS_TO_SHOW, }); }, [defaultOptions, cleanSearchTerm, betas, selectedOptions]); @@ -92,14 +91,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: return newSections; } - const formattedResults = OptionsListUtils.formatSectionsFromSearchTerm( - cleanSearchTerm, - selectedOptions, - chatOptions.recentReports, - chatOptions.personalDetails, - personalDetails, - true, - ); + const formattedResults = OptionsListUtils.formatSectionsFromSearchTerm(cleanSearchTerm, selectedOptions, [], chatOptions.personalDetails, personalDetails, true); const isCurrentUserSelected = selectedOptions.find((option) => option.accountID === chatOptions.currentUserOption?.accountID); @@ -113,12 +105,6 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: }); } - newSections.push({ - title: '', - data: chatOptions.recentReports, - shouldShow: chatOptions.recentReports.length > 0, - }); - newSections.push({ title: '', data: chatOptions.personalDetails, @@ -179,6 +165,9 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: [selectedOptions], ); + const noResultsFound = chatOptions.personalDetails.length === 0 && !chatOptions.currentUserOption; + const headerMessage = noResultsFound ? translate('common.noResultsFound') : undefined; + const footerContent = (