Skip to content

Commit 247c2ce

Browse files
authored
Merge pull request Expensify#70109 from Expensify/jsenyitko-fix-narrow-search-totals
Fix total bar showing up on small screens when expenses are selected
2 parents 9c2929e + f0cf24b commit 247c2ce

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/pages/Search/SearchPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ function SearchPage({route}: SearchPageProps) {
687687
{PDFValidationComponent}
688688
<SearchPageNarrow
689689
queryJSON={queryJSON}
690+
metadata={metadata}
690691
headerButtonsOptions={headerButtonsOptions}
691692
searchResults={searchResults}
692693
isMobileSelectionModeEnabled={isMobileSelectionModeEnabled}

src/pages/Search/SearchPageNarrow.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ import CONST from '@src/CONST';
3737
import ONYXKEYS from '@src/ONYXKEYS';
3838
import ROUTES from '@src/ROUTES';
3939
import type {SearchResults} from '@src/types/onyx';
40+
import type {SearchResultsInfo} from '@src/types/onyx/SearchResults';
4041

4142
const TOO_CLOSE_TO_TOP_DISTANCE = 10;
4243
const TOO_CLOSE_TO_BOTTOM_DISTANCE = 10;
4344
const ANIMATION_DURATION_IN_MS = 300;
4445

4546
type SearchPageNarrowProps = {
4647
queryJSON?: SearchQueryJSON;
48+
metadata?: SearchResultsInfo;
4749
headerButtonsOptions: Array<DropdownOption<SearchHeaderOptionValue>>;
4850
searchResults?: SearchResults;
4951
isMobileSelectionModeEnabled: boolean;
@@ -54,7 +56,7 @@ type SearchPageNarrowProps = {
5456
};
5557
};
5658

57-
function SearchPageNarrow({queryJSON, headerButtonsOptions, searchResults, isMobileSelectionModeEnabled, footerData}: SearchPageNarrowProps) {
59+
function SearchPageNarrow({queryJSON, headerButtonsOptions, searchResults, isMobileSelectionModeEnabled, metadata, footerData}: SearchPageNarrowProps) {
5860
const {translate} = useLocalize();
5961
const {shouldUseNarrowLayout} = useResponsiveLayout();
6062
const {windowHeight} = useWindowDimensions();
@@ -147,7 +149,7 @@ function SearchPageNarrow({queryJSON, headerButtonsOptions, searchResults, isMob
147149
);
148150
}
149151

150-
const shouldShowFooter = !!footerData?.count;
152+
const shouldShowFooter = !!metadata?.count;
151153
const isDataLoaded = isSearchDataLoaded(searchResults, queryJSON);
152154
const shouldShowLoadingState = !isOffline && (!isDataLoaded || !!currentSearchResults?.search?.isLoading);
153155

0 commit comments

Comments
 (0)