Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP Staging] fix blank area and status bar #57113

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function SearchPageHeader({queryJSON, searchName, searchRouterListVisible, hideS
}, [allCards, currencyList, hideProductTrainingTooltip, personalDetails, policyCategories, policyTagsLists, queryJSON, reports, taxRates]);

const InputRightComponent = useMemo(() => {
return headerButtonsOptions.length > 0 ? (
return headerButtonsOptions.length > 0 && (!shouldUseNarrowLayout || selectionMode?.isEnabled) ? (
<ButtonWithDropdownMenu
onPress={() => null}
shouldAlwaysShowDropdownMenu
Expand Down Expand Up @@ -363,6 +363,8 @@ function SearchPageHeader({queryJSON, searchName, searchRouterListVisible, hideS
styles.productTrainingTooltipWrapper,
styles.searchAutocompleteInputResults,
translate,
selectionMode,
shouldUseNarrowLayout,
]);

if (shouldUseNarrowLayout && selectionMode?.isEnabled) {
Expand Down
40 changes: 23 additions & 17 deletions src/pages/Search/SearchPageNarrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,26 +137,32 @@ function SearchPageNarrow({queryJSON, policyID, searchName}: SearchPageBottomTab
/>
</View>
<View style={[styles.flex1]}>
<Animated.View style={[topBarAnimatedStyle, !searchRouterListVisible && styles.narrowSearchRouterInactiveStyle, styles.narrowSearchHeaderStyle]}>
<SearchPageHeader
queryJSON={queryJSON}
searchRouterListVisible={searchRouterListVisible}
hideSearchRouterList={() => {
setSearchRouterListVisible(false);
}}
onSearchRouterFocus={() => {
topBarOffset.set(StyleUtils.searchHeaderDefaultOffset);
setSearchRouterListVisible(true);
}}
/>
{!searchRouterListVisible && (
<SearchStatusBar
<Animated.View
style={[topBarAnimatedStyle, !searchRouterListVisible && styles.narrowSearchRouterInactiveStyle, styles.narrowSearchHeaderStyle, styles.bgTransparent]}
>
<View style={[{paddingTop: 1}, styles.appBG]}>
<SearchPageHeader
queryJSON={queryJSON}
onStatusChange={() => {
topBarOffset.set(withTiming(StyleUtils.searchHeaderDefaultOffset, {duration: ANIMATION_DURATION_IN_MS}));
searchRouterListVisible={searchRouterListVisible}
hideSearchRouterList={() => {
setSearchRouterListVisible(false);
}}
onSearchRouterFocus={() => {
topBarOffset.set(StyleUtils.searchHeaderDefaultOffset);
setSearchRouterListVisible(true);
}}
/>
)}
</View>
<View style={[styles.appBG]}>
{!searchRouterListVisible && (
<SearchStatusBar
queryJSON={queryJSON}
onStatusChange={() => {
topBarOffset.set(withTiming(StyleUtils.searchHeaderDefaultOffset, {duration: ANIMATION_DURATION_IN_MS}));
}}
/>
)}
</View>
</Animated.View>
</View>
</View>
Expand Down
1 change: 0 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3767,7 +3767,6 @@ const styles = (theme: ThemeColors) =>
},

narrowSearchHeaderStyle: {
paddingTop: 1,
flex: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've missed this, but we still need the 'flex: 1' style. Otherwise the Autocomplete list is not visible.
Nobody reported this bug, but I will add this to follow-up PR here #57191

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SzymczakJ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm that the removal of flex: 1 led to the following issue:

which was fixed by adding back the style.

},

Expand Down
Loading