Skip to content

Commit

Permalink
Add feature to hide card page when no cards are available
Browse files Browse the repository at this point in the history
  • Loading branch information
289Adam289 committed Aug 5, 2024
1 parent f26e0d9 commit 1f000e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const ROUTES = {
SEARCH_ADVANCED_FILTERS_REPORT_ID: 'search/filters/reportID',

SEARCH_ADVANCED_FILTERS_CATEGORY: 'search/filters/category',

SEARCH_ADVANCED_FILTERS_CARD: 'search/filters/card',

SEARCH_REPORT: {
Expand Down
5 changes: 4 additions & 1 deletion src/pages/Search/AdvancedSearchFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function AdvancedSearchFilters() {
title: getFilterCardDisplayTitle(searchAdvancedFilters, cardList),
description: 'common.card' as const,
route: ROUTES.SEARCH_ADVANCED_FILTERS_CARD,
shouldHide: Object.keys(cardList).length === 0,
},
],
[searchAdvancedFilters, translate, cardList],
Expand All @@ -134,7 +135,9 @@ function AdvancedSearchFilters() {
<View>
{advancedFilters.map((item) => {
const onPress = singleExecution(waitForNavigate(() => Navigation.navigate(item.route)));

if (item.shouldHide) {
return undefined;
}
return (
<MenuItemWithTopDescription
key={item.description}
Expand Down

0 comments on commit 1f000e4

Please sign in to comment.