Skip to content

Commit 88686d4

Browse files
committed
Adjustments after merge
1 parent 8ac53d3 commit 88686d4

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/libs/UserUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function getAvatar(avatarSource?: AvatarSource, accountID?: number): AvatarSourc
176176
* @param avatarURL - the avatar source from user's personalDetails
177177
* @param accountID - the accountID of the user
178178
*/
179-
function getAvatarUrl(avatarSource: AvatarSource, accountID: number): AvatarSource {
179+
function getAvatarUrl(avatarSource: AvatarSource | undefined, accountID: number): AvatarSource {
180180
return isDefaultAvatar(avatarSource) ? getDefaultAvatarURL(accountID) : avatarSource;
181181
}
182182

src/pages/ShareCodePage.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentU
1515
import useEnvironment from '@hooks/useEnvironment';
1616
import useLocalize from '@hooks/useLocalize';
1717
import useThemeStyles from '@hooks/useThemeStyles';
18+
import useWindowDimensions from '@hooks/useWindowDimensions';
1819
import Clipboard from '@libs/Clipboard';
1920
import getPlatform from '@libs/getPlatform';
2021
import Navigation from '@libs/Navigation/Navigation';
@@ -40,6 +41,7 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP
4041
const {translate} = useLocalize();
4142
const {environmentURL} = useEnvironment();
4243
const qrCodeRef = useRef<QRShareWithDownloadHandle>(null);
44+
const {isSmallScreenWidth} = useWindowDimensions();
4345

4446
const isReport = !!report?.reportID;
4547

@@ -69,14 +71,17 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP
6971
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID;
7072

7173
return (
72-
<ScreenWrapper testID={ShareCodePage.displayName}>
74+
<ScreenWrapper
75+
testID={ShareCodePage.displayName}
76+
shouldShowOfflineIndicatorInWideScreen={!isReport}
77+
>
7378
<HeaderWithBackButton
7479
title={translate('common.shareCode')}
7580
onBackButtonPress={() => Navigation.goBack(isReport ? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID) : ROUTES.SETTINGS)}
81+
shouldShowBackButton={isReport || isSmallScreenWidth}
7682
/>
77-
7883
<ScrollView style={[themeStyles.flex1, themeStyles.mt3]}>
79-
<View style={themeStyles.shareCodePage}>
84+
<View style={[isSmallScreenWidth ? themeStyles.workspaceSectionMobile : themeStyles.workspaceSection, themeStyles.ph4]}>
8085
<QRShareWithDownload
8186
ref={qrCodeRef}
8287
url={url}
@@ -96,14 +101,15 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP
96101
successIcon={Expensicons.Checkmark}
97102
successText={translate('qrCodes.copied')}
98103
onPress={() => Clipboard.setString(url)}
104+
shouldLimitWidth={false}
99105
/>
100106

101107
{isNative && (
102108
<MenuItem
103109
isAnonymousAction
104110
title={translate('common.download')}
105111
icon={Expensicons.Download}
106-
onPress={() => qrCodeRef.current?.download()}
112+
onPress={qrCodeRef.current?.download}
107113
/>
108114
)}
109115

0 commit comments

Comments
 (0)