Skip to content

Commit

Permalink
fix: changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Dec 4, 2024
1 parent e775a32 commit be17e04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ type PopoverMenuProps = Partial<PopoverModalProps> & {

/** 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<ViewStyle>, children: ReactNode): React.JSX.Element => {
Expand Down Expand Up @@ -166,6 +169,7 @@ function PopoverMenu({
scrollContainerStyle,
shouldUseScrollView = false,
shouldUpdateFocusedIndex = true,
shouldUseModalPaddingStyle,
}: PopoverMenuProps) {
const styles = useThemeStyles();
const theme = useTheme();
Expand Down Expand Up @@ -338,6 +342,7 @@ function PopoverMenu({
useNativeDriver
restoreFocusType={restoreFocusType}
innerContainerStyle={innerContainerStyle}
shouldUseModalPaddingStyle={shouldUseModalPaddingStyle}
>
<FocusTrapForModal active={isVisible}>
<View style={[isSmallScreenWidth ? {maxHeight: windowHeight - 250} : styles.createMenuContainer, containerStyles]}>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/Search/SearchTypeMenuNarrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<HTMLDivElement>(null);
Expand Down Expand Up @@ -210,6 +212,8 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title,
onItemSelected={closeMenu}
anchorRef={buttonRef}
shouldUseScrollView
shouldUseModalPaddingStyle={false}
innerContainerStyle={{paddingBottom: unmodifiedPaddings.bottom}}
/>
<DeleteConfirmModal />
</View>
Expand Down

0 comments on commit be17e04

Please sign in to comment.