@@ -12,8 +12,8 @@ import Button from '@components/Button';
1212import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator' ;
1313import HeaderGap from '@components/HeaderGap' ;
1414import HeaderWithBackButton from '@components/HeaderWithBackButton' ;
15- import * as Illustrations from '@components/Icon/Illustrations' ;
1615import SafeAreaConsumer from '@components/SafeAreaConsumer' ;
16+ import { useMemoizedLazyIllustrations } from '@hooks/useLazyAsset' ;
1717import useLocalize from '@hooks/useLocalize' ;
1818import useNetwork from '@hooks/useNetwork' ;
1919import useOnyx from '@hooks/useOnyx' ;
@@ -60,11 +60,13 @@ function AttachmentModalBaseContent({
6060 AttachmentContent,
6161 onCarouselAttachmentChange = ( ) => { } ,
6262 transaction : transactionProp ,
63+ shouldCloseOnSwipeDown = false ,
6364} : AttachmentModalBaseContentProps ) {
6465 const styles = useThemeStyles ( ) ;
6566 const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
6667 const { translate} = useLocalize ( ) ;
6768 const { isOffline} = useNetwork ( ) ;
69+ const illustrations = useMemoizedLazyIllustrations ( [ 'ToddBehindCloud' ] ) ;
6870
6971 // This logic is used to ensure that the source is updated when the source changes and
7072 // that the initially provided source is always used as a fallback.
@@ -204,8 +206,9 @@ function AttachmentModalBaseContent({
204206 onTap : ( ) => { } ,
205207 onScaleChanged : ( ) => { } ,
206208 onAttachmentError : setAttachmentError ,
209+ ...( shouldCloseOnSwipeDown ? { onSwipeDown : onClose } : { } ) ,
207210 } ) ,
208- [ falseSV , sourceForAttachmentView , setAttachmentError ] ,
211+ [ falseSV , sourceForAttachmentView , setAttachmentError , shouldCloseOnSwipeDown , onClose ] ,
209212 ) ;
210213
211214 const shouldDisplayContent = ! shouldShowNotFoundPage && ! isLoading ;
@@ -305,7 +308,7 @@ function AttachmentModalBaseContent({
305308 { isLoading && < FullScreenLoadingIndicator testID = "attachment-loading-spinner" /> }
306309 { shouldShowNotFoundPage && ! isLoading && (
307310 < BlockingView
308- icon = { Illustrations . ToddBehindCloud }
311+ icon = { illustrations . ToddBehindCloud }
309312 iconWidth = { variables . modalTopIconWidth }
310313 iconHeight = { variables . modalTopIconHeight }
311314 title = { translate ( 'notFound.notHere' ) }
0 commit comments