@@ -15,6 +15,7 @@ import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentU
15
15
import useEnvironment from '@hooks/useEnvironment' ;
16
16
import useLocalize from '@hooks/useLocalize' ;
17
17
import useThemeStyles from '@hooks/useThemeStyles' ;
18
+ import useWindowDimensions from '@hooks/useWindowDimensions' ;
18
19
import Clipboard from '@libs/Clipboard' ;
19
20
import getPlatform from '@libs/getPlatform' ;
20
21
import Navigation from '@libs/Navigation/Navigation' ;
@@ -40,6 +41,7 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP
40
41
const { translate} = useLocalize ( ) ;
41
42
const { environmentURL} = useEnvironment ( ) ;
42
43
const qrCodeRef = useRef < QRShareWithDownloadHandle > ( null ) ;
44
+ const { isSmallScreenWidth} = useWindowDimensions ( ) ;
43
45
44
46
const isReport = ! ! report ?. reportID ;
45
47
@@ -69,14 +71,17 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP
69
71
const isNative = platform === CONST . PLATFORM . IOS || platform === CONST . PLATFORM . ANDROID ;
70
72
71
73
return (
72
- < ScreenWrapper testID = { ShareCodePage . displayName } >
74
+ < ScreenWrapper
75
+ testID = { ShareCodePage . displayName }
76
+ shouldShowOfflineIndicatorInWideScreen = { ! isReport }
77
+ >
73
78
< HeaderWithBackButton
74
79
title = { translate ( 'common.shareCode' ) }
75
80
onBackButtonPress = { ( ) => Navigation . goBack ( isReport ? ROUTES . REPORT_WITH_ID_DETAILS . getRoute ( report . reportID ) : ROUTES . SETTINGS ) }
81
+ shouldShowBackButton = { isReport || isSmallScreenWidth }
76
82
/>
77
-
78
83
< ScrollView style = { [ themeStyles . flex1 , themeStyles . mt3 ] } >
79
- < View style = { themeStyles . shareCodePage } >
84
+ < View style = { [ isSmallScreenWidth ? themeStyles . workspaceSectionMobile : themeStyles . workspaceSection , themeStyles . ph4 ] } >
80
85
< QRShareWithDownload
81
86
ref = { qrCodeRef }
82
87
url = { url }
@@ -96,14 +101,15 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP
96
101
successIcon = { Expensicons . Checkmark }
97
102
successText = { translate ( 'qrCodes.copied' ) }
98
103
onPress = { ( ) => Clipboard . setString ( url ) }
104
+ shouldLimitWidth = { false }
99
105
/>
100
106
101
107
{ isNative && (
102
108
< MenuItem
103
109
isAnonymousAction
104
110
title = { translate ( 'common.download' ) }
105
111
icon = { Expensicons . Download }
106
- onPress = { ( ) => qrCodeRef . current ?. download ( ) }
112
+ onPress = { qrCodeRef . current ?. download }
107
113
/>
108
114
) }
109
115
0 commit comments