Skip to content

Commit

Permalink
Remove recent reports section in From/To filters and fix header
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicu committed Aug 13, 2024
1 parent e0d407d commit 68969fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
20 changes: 5 additions & 15 deletions src/components/Search/SearchFiltersParticipantsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -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);

Expand All @@ -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,
Expand Down Expand Up @@ -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 = (
<Button
success
Expand All @@ -200,6 +189,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}:
sections={sections}
ListItem={InviteMemberListItem}
textInputLabel={translate('selectionList.nameEmailOrPhoneNumber')}
headerMessage={headerMessage}
textInputValue={searchTerm}
footerContent={footerContent}
showScrollIndicator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import useThemeStyles from '@hooks/useThemeStyles';
import * as SearchActions from '@userActions/Search';
import ONYXKEYS from '@src/ONYXKEYS';

function SearchFiltersStatusPage() {
function SearchFiltersFromPage() {
const styles = useThemeStyles();
const {translate} = useLocalize();

const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM);

return (
<ScreenWrapper
testID={SearchFiltersStatusPage.displayName}
testID={SearchFiltersFromPage.displayName}
includeSafeAreaPaddingBottom={false}
shouldShowOfflineIndicatorInWideScreen
offlineIndicatorStyle={styles.mtAuto}
Expand All @@ -37,6 +37,6 @@ function SearchFiltersStatusPage() {
);
}

SearchFiltersStatusPage.displayName = 'SearchFiltersStatusPage';
SearchFiltersFromPage.displayName = 'SearchFiltersFromPage';

export default SearchFiltersStatusPage;
export default SearchFiltersFromPage;

0 comments on commit 68969fe

Please sign in to comment.