@@ -18,12 +18,10 @@ import DragAndDropConsumer from '@components/DragAndDrop/Consumer';
1818import { DragAndDropContext } from '@components/DragAndDrop/Provider' ;
1919import DropZoneUI from '@components/DropZone/DropZoneUI' ;
2020import FeatureTrainingModal from '@components/FeatureTrainingModal' ;
21- import FixedFooter from '@components/FixedFooter' ;
2221import Icon from '@components/Icon' ;
2322import * as Expensicons from '@components/Icon/Expensicons' ;
2423import LocationPermissionModal from '@components/LocationPermissionModal' ;
2524import PressableWithFeedback from '@components/Pressable/PressableWithFeedback' ;
26- import ScrollView from '@components/ScrollView' ;
2725import Text from '@components/Text' ;
2826import TextLink from '@components/TextLink' ;
2927import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails' ;
@@ -973,13 +971,23 @@ function IOURequestStepScan({
973971 </ >
974972 ) ;
975973
974+ const [ containerHeight , setContainerHeight ] = useState ( 0 ) ;
975+ const [ desktopUploadViewHeight , setDesktopUploadViewHeight ] = useState ( 0 ) ;
976+ const [ bannerHeight , setBannerHeight ] = useState ( 0 ) ;
977+ const shouldHideBanner = bannerHeight + desktopUploadViewHeight + styles . uploadFileView ( isSmallScreenWidth ) . paddingVertical * 2 > containerHeight ;
978+
976979 const desktopUploadView = ( ) => (
977- < ScrollView contentContainerStyle = { [ styles . flexGrow1 , styles . alignItemsCenter , styles . justifyContentCenter , styles . pt10 ] } >
980+ < View
981+ style = { [ ! isMobile ( ) && styles . alignItemsCenter , styles . justifyContentCenter ] }
982+ onLayout = { ( e ) => {
983+ if ( isMobile ( ) ) {
984+ return ;
985+ }
986+ setDesktopUploadViewHeight ( e . nativeEvent . layout . height ) ;
987+ } }
988+ >
978989 { PDFValidationComponent }
979- < View
980- onLayout = { ( { nativeEvent} ) => setReceiptImageTopPosition ( PixelRatio . roundToNearestPixel ( ( nativeEvent . layout as DOMRect ) . top ) ) }
981- // style={styles.mtAuto}
982- >
990+ < View onLayout = { ( { nativeEvent} ) => setReceiptImageTopPosition ( PixelRatio . roundToNearestPixel ( ( nativeEvent . layout as DOMRect ) . top ) ) } >
983991 < ReceiptUpload
984992 width = { CONST . RECEIPT . ICON_SIZE }
985993 height = { CONST . RECEIPT . ICON_SIZE }
@@ -1019,7 +1027,7 @@ function IOURequestStepScan({
10191027 />
10201028 ) }
10211029 </ AttachmentPicker >
1022- </ ScrollView >
1030+ </ View >
10231031 ) ;
10241032
10251033 return (
@@ -1031,21 +1039,19 @@ function IOURequestStepScan({
10311039 >
10321040 { ( isDraggingOverWrapper ) => (
10331041 < View
1034- onLayout = { ( ) => {
1042+ onLayout = { ( event ) => {
1043+ if ( ! isMobile ( ) ) {
1044+ setContainerHeight ( event . nativeEvent . layout . height ) ;
1045+ }
10351046 if ( ! onLayout ) {
10361047 return ;
10371048 }
10381049 onLayout ( setTestReceiptAndNavigate ) ;
10391050 } }
1040- style = { [ styles . flex1 , ! isMobile ( ) && styles . uploadFileView ( isSmallScreenWidth ) , ! isMobile ( ) && styles . p0 ] }
1051+ style = { [ styles . flex1 , ! isMobile ( ) && styles . uploadFileView ( isSmallScreenWidth ) ] }
10411052 >
10421053 < View style = { [ styles . flex1 , ! isMobile ( ) && styles . alignItemsCenter , styles . justifyContentCenter ] } >
10431054 { ! ( isDraggingOver ?? isDraggingOverWrapper ) && ( isMobile ( ) ? mobileCameraView ( ) : desktopUploadView ( ) ) }
1044- { ! isMobile ( ) && (
1045- < FixedFooter style = { styles . p0 } >
1046- < DownloadAppBanner />
1047- </ FixedFooter >
1048- ) }
10491055 </ View >
10501056 { /* TODO: remove beta check after the feature is enabled */ }
10511057 { canUseMultiDragAndDrop ? (
@@ -1072,6 +1078,8 @@ function IOURequestStepScan({
10721078 receiptImageTopPosition = { receiptImageTopPosition }
10731079 />
10741080 ) }
1081+ { /* We use isMobile() here to explicitly hide DownloadAppBanner component on both mobile web and native apps */ }
1082+ { ! isMobile ( ) && ! shouldHideBanner && < DownloadAppBanner onLayout = { ( e ) => setBannerHeight ( e . nativeEvent . layout . height ) } /> }
10751083 { ErrorModal }
10761084 { startLocationPermissionFlow && ! ! receiptFiles . length && (
10771085 < LocationPermissionModal
0 commit comments