@@ -965,8 +965,19 @@ function IOURequestStepScan({
965965 </ >
966966 ) ;
967967
968+ const [ containerHeight , setContainerHeight ] = useState ( 0 ) ;
969+ const [ desktopUploadViewHeight , setDesktopUploadViewHeight ] = useState ( 0 ) ;
970+ const [ downloadAppBannerHeight , setDownloadAppBannerHeight ] = useState ( 0 ) ;
971+ /* We use isMobile() here to explicitly hide DownloadAppBanner component on both mobile web and native apps */
972+ const shouldHideDownloadAppBanner = isMobile ( ) || downloadAppBannerHeight + desktopUploadViewHeight + styles . uploadFileView ( isSmallScreenWidth ) . paddingVertical * 2 > containerHeight ;
973+
968974 const desktopUploadView = ( ) => (
969- < >
975+ < View
976+ style = { [ styles . alignItemsCenter , styles . justifyContentCenter ] }
977+ onLayout = { ( e ) => {
978+ setDesktopUploadViewHeight ( e . nativeEvent . layout . height ) ;
979+ } }
980+ >
970981 { PDFValidationComponent }
971982 < ReceiptUpload
972983 width = { CONST . RECEIPT . ICON_SIZE }
@@ -1005,7 +1016,7 @@ function IOURequestStepScan({
10051016 />
10061017 ) }
10071018 </ AttachmentPicker >
1008- </ >
1019+ </ View >
10091020 ) ;
10101021
10111022 return (
@@ -1017,7 +1028,8 @@ function IOURequestStepScan({
10171028 >
10181029 { ( isDraggingOverWrapper ) => (
10191030 < View
1020- onLayout = { ( ) => {
1031+ onLayout = { ( event ) => {
1032+ setContainerHeight ( event . nativeEvent . layout . height ) ;
10211033 if ( ! onLayout ) {
10221034 return ;
10231035 }
@@ -1037,8 +1049,7 @@ function IOURequestStepScan({
10371049 dropInnerWrapperStyles = { styles . receiptDropInnerWrapper ( true ) }
10381050 />
10391051 </ DragAndDropConsumer >
1040- { /* We use isMobile() here to explicitly hide DownloadAppBanner component on both mobile web and native apps */ }
1041- { ! isMobile ( ) && < DownloadAppBanner /> }
1052+ { ! shouldHideDownloadAppBanner && < DownloadAppBanner onLayout = { ( e ) => setDownloadAppBannerHeight ( e . nativeEvent . layout . height ) } /> }
10421053 { ErrorModal }
10431054 { startLocationPermissionFlow && ! ! receiptFiles . length && (
10441055 < LocationPermissionModal
0 commit comments