From be17e04444c41a091e6197b4eab91c1dc13f70a5 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Wed, 4 Dec 2024 14:42:50 +0100 Subject: [PATCH] fix: changes after review --- src/components/PopoverMenu.tsx | 5 +++++ src/pages/Search/SearchTypeMenuNarrow.tsx | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 9b5c0b1b6f56..b38d4280248b 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -127,6 +127,9 @@ type PopoverMenuProps = Partial & { /** Whether to update the focused index on a row select */ shouldUpdateFocusedIndex?: boolean; + + /** Should we apply padding style in modal itself. If this value is false, we will handle it in ScreenWrapper */ + shouldUseModalPaddingStyle?: boolean; }; const renderWithConditionalWrapper = (shouldUseScrollView: boolean, contentContainerStyle: StyleProp, children: ReactNode): React.JSX.Element => { @@ -166,6 +169,7 @@ function PopoverMenu({ scrollContainerStyle, shouldUseScrollView = false, shouldUpdateFocusedIndex = true, + shouldUseModalPaddingStyle, }: PopoverMenuProps) { const styles = useThemeStyles(); const theme = useTheme(); @@ -338,6 +342,7 @@ function PopoverMenu({ useNativeDriver restoreFocusType={restoreFocusType} innerContainerStyle={innerContainerStyle} + shouldUseModalPaddingStyle={shouldUseModalPaddingStyle} > diff --git a/src/pages/Search/SearchTypeMenuNarrow.tsx b/src/pages/Search/SearchTypeMenuNarrow.tsx index 084d0e781519..cd82e2279cff 100644 --- a/src/pages/Search/SearchTypeMenuNarrow.tsx +++ b/src/pages/Search/SearchTypeMenuNarrow.tsx @@ -15,6 +15,7 @@ import ThreeDotsMenu from '@components/ThreeDotsMenu'; import useDeleteSavedSearch from '@hooks/useDeleteSavedSearch'; import useLocalize from '@hooks/useLocalize'; import useSingleExecution from '@hooks/useSingleExecution'; +import useStyledSafeAreaInsets from '@hooks/useStyledSafeAreaInsets'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -62,6 +63,7 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title, const [reports = {}] = useOnyx(ONYXKEYS.COLLECTION.REPORT); const taxRates = getAllTaxRates(); const [cardList = {}] = useOnyx(ONYXKEYS.CARD_LIST); + const {unmodifiedPaddings} = useStyledSafeAreaInsets(); const [isPopoverVisible, setIsPopoverVisible] = useState(false); const buttonRef = useRef(null); @@ -210,6 +212,8 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title, onItemSelected={closeMenu} anchorRef={buttonRef} shouldUseScrollView + shouldUseModalPaddingStyle={false} + innerContainerStyle={{paddingBottom: unmodifiedPaddings.bottom}} />