@@ -15,6 +15,7 @@ import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeed
1515import ScreenWrapper from '@components/ScreenWrapper' ;
1616import Text from '@components/Text' ;
1717import Tooltip from '@components/Tooltip' ;
18+ import useIsInLandscapeMode from '@hooks/useIsInLandscapeMode' ;
1819import { useMemoizedLazyExpensifyIcons } from '@hooks/useLazyAsset' ;
1920import useLocalize from '@hooks/useLocalize' ;
2021import useStyleUtils from '@hooks/useStyleUtils' ;
@@ -54,12 +55,15 @@ type AvatarCropModalProps = {
5455 buttonLabel ?: string ;
5556} ;
5657
58+ const LANDSCAPE_MODE_SLIDER_CONTAINER_MIN_WIDTH = 300 ;
59+
5760// This component can't be written using class since reanimated API uses hooks.
5861function AvatarCropModal ( { imageUri = '' , imageName = '' , imageType = '' , onClose, onSave, isVisible, maskImage, buttonLabel} : AvatarCropModalProps ) {
5962 const theme = useTheme ( ) ;
6063 const styles = useThemeStyles ( ) ;
6164 const StyleUtils = useStyleUtils ( ) ;
6265 const expensifyIcons = useMemoizedLazyExpensifyIcons ( [ 'Rotate' , 'Zoom' ] ) ;
66+ const isInLandscapeMode = useIsInLandscapeMode ( ) ;
6367
6468 const originalImageWidth = useSharedValue < number > ( CONST . AVATAR_CROP_MODAL . INITIAL_SIZE ) ;
6569 const originalImageHeight = useSharedValue < number > ( CONST . AVATAR_CROP_MODAL . INITIAL_SIZE ) ;
@@ -407,7 +411,15 @@ function AvatarCropModal({imageUri = '', imageName = '', imageType = '', onClose
407411 rotation = { rotation }
408412 maskImage = { maskImage }
409413 />
410- < View style = { [ styles . mt5 , styles . justifyContentBetween , styles . alignItemsCenter , styles . flexRow , StyleUtils . getWidthStyle ( imageContainerSize ) ] } >
414+ < View
415+ style = { [
416+ styles . mt5 ,
417+ styles . justifyContentBetween ,
418+ styles . alignItemsCenter ,
419+ styles . flexRow ,
420+ StyleUtils . getWidthStyle ( isInLandscapeMode ? Math . max ( imageContainerSize , LANDSCAPE_MODE_SLIDER_CONTAINER_MIN_WIDTH ) : imageContainerSize ) ,
421+ ] }
422+ >
411423 < Icon
412424 src = { expensifyIcons . Zoom }
413425 fill = { theme . icon }
0 commit comments