Skip to content

Commit a3a5b4d

Browse files
committed
resolve comments
1 parent 50f7e09 commit a3a5b4d

2 files changed

Lines changed: 8 additions & 19 deletions

File tree

src/components/Search/index.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,27 +1546,15 @@ function Search({
15461546
!isAnyVisibleActionLoading
15471547
) {
15481548
cancelNavigationSpans();
1549-
if (isInLandscapeMode) {
1550-
return (
1551-
<View style={[styles.flex1]}>
1552-
<EmptySearchView
1553-
similarSearchHash={similarSearchHash}
1554-
type={type}
1555-
hasResults={searchResults?.search?.hasResults}
1556-
queryJSON={queryJSON}
1557-
onScroll={onSearchListScroll}
1558-
contentContainerStyle={shouldUseNarrowLayout ? styles.searchListContentContainerStyles : styles.mt3}
1559-
/>
1560-
</View>
1561-
);
1562-
}
15631549
return (
1564-
<View style={[shouldUseNarrowLayout ? styles.searchListContentContainerStyles : styles.mt3, styles.flex1]}>
1550+
<View style={[styles.flex1, isInLandscapeMode ? undefined : [shouldUseNarrowLayout ? styles.searchListContentContainerStyles : styles.mt3]]}>
15651551
<EmptySearchView
15661552
similarSearchHash={similarSearchHash}
15671553
type={type}
15681554
hasResults={searchResults?.search?.hasResults}
15691555
queryJSON={queryJSON}
1556+
onScroll={isInLandscapeMode ? onSearchListScroll : undefined}
1557+
contentContainerStyle={isInLandscapeMode ? styles.searchListContentContainerStyles : undefined}
15701558
/>
15711559
</View>
15721560
);

src/pages/Search/EmptySearchView.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import useConfirmModal from '@hooks/useConfirmModal';
1919
import useCreateEmptyReportConfirmation from '@hooks/useCreateEmptyReportConfirmation';
2020
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
2121
import useHasEmptyReportsForPolicy from '@hooks/useHasEmptyReportsForPolicy';
22+
import useIsInLandscapeMode from '@hooks/useIsInLandscapeMode';
2223
import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset';
2324
import useLocalize from '@hooks/useLocalize';
2425
import useOnyx from '@hooks/useOnyx';
2526
import usePermissions from '@hooks/usePermissions';
2627
import useSearchTypeMenuSections from '@hooks/useSearchTypeMenuSections';
2728
import useThemeStyles from '@hooks/useThemeStyles';
28-
import useWindowDimensions from '@hooks/useWindowDimensions';
2929
import {startMoneyRequest} from '@libs/actions/IOU';
3030
import {openOldDotLink} from '@libs/actions/Link';
3131
import {createNewReport} from '@libs/actions/Report';
@@ -130,7 +130,7 @@ function EmptySearchViewContent({
130130
}: EmptySearchViewContentProps) {
131131
const {translate} = useLocalize();
132132
const styles = useThemeStyles();
133-
const {windowHeight} = useWindowDimensions();
133+
const isInLandscapeMode = useIsInLandscapeMode();
134134

135135
const illustrations = useMemoizedLazyIllustrations(['EmptyStateTravel']);
136136
const {showConfirmModal} = useConfirmModal();
@@ -443,13 +443,14 @@ function EmptySearchViewContent({
443443
return (
444444
<Animated.ScrollView
445445
showsVerticalScrollIndicator={false}
446-
contentContainerStyle={[styles.flexGrow1, styles.flexShrink0, contentContainerStyle, {minHeight: windowHeight}]}
447-
scrollEventThrottle={CONST.MIN_SMOOTH_SCROLL_EVENT_THROTTLE}
446+
contentContainerStyle={[styles.flexGrow1, styles.flexShrink0, contentContainerStyle]}
447+
scrollEventThrottle={CONST.TIMING.MIN_SMOOTH_SCROLL_EVENT_THROTTLE}
448448
onScroll={onScroll}
449449
>
450450
<GenericEmptyStateComponent
451451
headerMedia={content.headerMedia}
452452
headerStyles={styles.emptyStateCardIllustrationContainer}
453+
minModalHeight={isInLandscapeMode ? 0 : undefined}
453454
title={content.title}
454455
titleStyles={content.titleStyles}
455456
subtitle={content.subtitle}

0 commit comments

Comments
 (0)