Skip to content

Commit

Permalink
fix(ui): fix bottom modal on rotation (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
emacoricciati authored and FabrizioCostaMedich committed Jan 22, 2025
1 parent cdf23b8 commit 49a5dea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/components/BottomModal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { PropsWithChildren } from 'react';
import { View } from 'react-native';
import { View, useWindowDimensions } from 'react-native';
import Modal from 'react-native-modal';

import { SCREEN_HEIGHT, SCREEN_WIDTH } from '@gorhom/bottom-sheet';

export type BottomModalProps = PropsWithChildren<{
visible: boolean;
onClose?: () => void;
Expand All @@ -20,6 +18,8 @@ export const BottomModal = ({
dismissable && onClose?.();
};

const { width, height } = useWindowDimensions();

return (
<Modal
{...Modal.defaultProps}
Expand All @@ -33,8 +33,8 @@ export const BottomModal = ({
animationIn="slideInUp"
animationOut="slideOutUp"
backdropColor="black"
deviceHeight={SCREEN_HEIGHT}
deviceWidth={SCREEN_WIDTH}
deviceHeight={height}
deviceWidth={width}
swipeDirection="down"
backdropTransitionInTiming={400}
backdropTransitionOutTiming={400}
Expand Down

0 comments on commit 49a5dea

Please sign in to comment.