@@ -6,6 +6,7 @@ import {LayoutAnimationConfig} from 'react-native-reanimated';
66import FocusTrapForModal from '@components/FocusTrap/FocusTrapForModal' ;
77import KeyboardAvoidingView from '@components/KeyboardAvoidingView' ;
88import useThemeStyles from '@hooks/useThemeStyles' ;
9+ import useWindowDimensions from '@hooks/useWindowDimensions' ;
910import getPlatform from '@libs/getPlatform' ;
1011import variables from '@styles/variables' ;
1112import CONST from '@src/CONST' ;
@@ -49,6 +50,8 @@ function ReanimatedModal({
4950 const [ isVisibleState , setIsVisibleState ] = useState ( isVisible ) ;
5051 const [ isContainerOpen , setIsContainerOpen ] = useState ( false ) ;
5152 const [ isTransitioning , setIsTransitioning ] = useState ( false ) ;
53+ const { windowWidth, windowHeight} = useWindowDimensions ( ) ;
54+
5255 const backHandlerListener = useRef < NativeEventSubscription | null > ( null ) ;
5356 const handleRef = useRef < number | undefined > ( undefined ) ;
5457
@@ -119,9 +122,8 @@ function ReanimatedModal({
119122 } , [ isVisible , isContainerOpen , isTransitioning ] ) ;
120123
121124 const backdropStyle : ViewStyle = useMemo ( ( ) => {
122- const { width, height} = Dimensions . get ( 'screen' ) ;
123- return { width, height, backgroundColor : backdropColor } ;
124- } , [ backdropColor ] ) ;
125+ return { width : windowWidth , height : windowHeight , backgroundColor : backdropColor } ;
126+ } , [ windowWidth , windowHeight , backdropColor ] ) ;
125127
126128 const onOpenCallBack = useCallback ( ( ) => {
127129 setIsTransitioning ( false ) ;
0 commit comments