diff --git a/src/libs/UserUtils.ts b/src/libs/UserUtils.ts index f5973e854fd4..a8c918bc5def 100644 --- a/src/libs/UserUtils.ts +++ b/src/libs/UserUtils.ts @@ -176,7 +176,7 @@ function getAvatar(avatarSource?: AvatarSource, accountID?: number): AvatarSourc * @param avatarURL - the avatar source from user's personalDetails * @param accountID - the accountID of the user */ -function getAvatarUrl(avatarSource: AvatarSource, accountID: number): AvatarSource { +function getAvatarUrl(avatarSource: AvatarSource | undefined, accountID: number): AvatarSource { return isDefaultAvatar(avatarSource) ? getDefaultAvatarURL(accountID) : avatarSource; } diff --git a/src/pages/ShareCodePage.tsx b/src/pages/ShareCodePage.tsx index 62368b2520e6..831f0eb8f1d8 100644 --- a/src/pages/ShareCodePage.tsx +++ b/src/pages/ShareCodePage.tsx @@ -15,6 +15,7 @@ import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentU import useEnvironment from '@hooks/useEnvironment'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import useWindowDimensions from '@hooks/useWindowDimensions'; import Clipboard from '@libs/Clipboard'; import getPlatform from '@libs/getPlatform'; import Navigation from '@libs/Navigation/Navigation'; @@ -40,6 +41,7 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP const {translate} = useLocalize(); const {environmentURL} = useEnvironment(); const qrCodeRef = useRef(null); + const {isSmallScreenWidth} = useWindowDimensions(); const isReport = !!report?.reportID; @@ -69,14 +71,17 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID; return ( - + Navigation.goBack(isReport ? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID) : ROUTES.SETTINGS)} + shouldShowBackButton={isReport || isSmallScreenWidth} /> - - + Clipboard.setString(url)} + shouldLimitWidth={false} /> {isNative && ( @@ -103,7 +109,7 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP isAnonymousAction title={translate('common.download')} icon={Expensicons.Download} - onPress={() => qrCodeRef.current?.download()} + onPress={qrCodeRef.current?.download} /> )}