Skip to content
6 changes: 6 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const CLOUDFRONT_DOMAIN = 'cloudfront.net';
const CLOUDFRONT_URL = `https://d2k5nsl2zxldvw.${CLOUDFRONT_DOMAIN}`;
const ACTIVE_EXPENSIFY_URL = addTrailingForwardSlash(Config?.NEW_EXPENSIFY_URL ?? 'https://new.expensify.com');
const USE_EXPENSIFY_URL = 'https://use.expensify.com';
const EXPENSIFY_MOBILE_URL = 'https://expensify.com/mobile';
const EXPENSIFY_URL = 'https://www.expensify.com';
const PLATFORM_OS_MACOS = 'Mac OS';
const PLATFORM_IOS = 'iOS';
Expand Down Expand Up @@ -1059,6 +1060,7 @@ const CONST = {
DEFAULT_NUMBER_ID,
USE_EXPENSIFY_URL,
EXPENSIFY_URL,
EXPENSIFY_MOBILE_URL,
GOOGLE_MEET_URL_ANDROID: 'https://meet.google.com',
GOOGLE_DOC_IMAGE_LINK_MATCH: 'googleusercontent.com',
IMAGE_BASE64_MATCH: 'base64',
Expand Down Expand Up @@ -3209,6 +3211,10 @@ const CONST = {
LARGE: 'large',
},

QR_CODE_SIZE: {
APP_DOWNLOAD_LINKS: 172,
},

AVATAR_SIZE: {
X_LARGE: 'xlarge',
LARGE: 'large',
Expand Down
4 changes: 2 additions & 2 deletions src/components/QRCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ function QRCode({
logo={logo}
logoSVG={svgLogo}
logoColor={svgLogoFillColor}
logoBackgroundColor={logoBackgroundColor ?? theme.highlightBG}
logoBackgroundColor={logoBackgroundColor ?? theme.appBG}
logoSize={size * logoRatio}
logoMargin={size * logoMarginRatio}
logoBorderRadius={size}
backgroundColor={backgroundColor ?? theme.highlightBG}
backgroundColor={backgroundColor ?? theme.appBG}
Comment on lines +83 to +87

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing the default colors? This will affect all existing QRCodes. Let's pass the desired color only for where the change is needed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we actually want to change this globally. Right @Expensify/design?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're cool making this change global and updating it everywhere. I think that's what @Expensify/design agreed to at least?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jinx!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!!! Okay then, let's change it globally!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is how the QRShare look before and after. Let us know if something is wrong. Otherwise we are good to proceed

Before After
Screenshot 2025-05-30 at 12 34 52 AM Screenshot 2025-05-30 at 12 34 54 AM

color={color ?? theme.text}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function QRShareWithDownload(props: QRShareProps, ref: ForwardedRef<QRShareWithD
useImperativeHandle(
ref,
() => ({
download: () => qrCodeScreenshotRef.current?.capture?.().then((uri) => fileDownload(uri, getQrCodeFileName(props.title), translate('fileDownload.success.qrMessage'))),
download: () =>
qrCodeScreenshotRef.current?.capture?.().then((uri) => fileDownload(uri, getQrCodeFileName(props.title ?? 'QRCode'), translate('fileDownload.success.qrMessage'))),
}),
[props.title, translate],
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/QRShare/QRShareWithDownload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function QRShareWithDownload(props: QRShareProps, ref: ForwardedRef<QRShareWithD
return;
}

svg.toDataURL((dataURL) => resolve(fileDownload(dataURL, getQrCodeFileName(props.title))));
svg.toDataURL((dataURL) => resolve(fileDownload(dataURL, getQrCodeFileName(props.title ?? 'QRCode'))));
}),
}),
[props.title],
Expand Down
43 changes: 25 additions & 18 deletions src/components/QRShare/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import useWindowDimensions from '@hooks/useWindowDimensions';
import variables from '@styles/variables';
import type {QRShareHandle, QRShareProps} from './types';

function QRShare({url, title, subtitle, logo, svgLogo, svgLogoFillColor, logoBackgroundColor, logoRatio, logoMarginRatio}: QRShareProps, ref: ForwardedRef<QRShareHandle>) {
function QRShare(
{url, title, subtitle, logo, svgLogo, svgLogoFillColor, logoBackgroundColor, logoRatio, logoMarginRatio, shouldShowExpensifyLogo = true, additionalStyles, size}: QRShareProps,
ref: ForwardedRef<QRShareHandle>,
) {
const styles = useThemeStyles();
const theme = useTheme();
const {shouldUseNarrowLayout} = useResponsiveLayout();
Expand All @@ -39,16 +42,18 @@ function QRShare({url, title, subtitle, logo, svgLogo, svgLogoFillColor, logoBac

return (
<View
style={styles.shareCodeContainer}
style={[styles.shareCodeContainer, additionalStyles]}
onLayout={onLayout}
>
<View style={styles.expensifyQrLogo}>
<ImageSVG
contentFit="contain"
src={ExpensifyWordmark}
fill={theme.QRLogo}
/>
</View>
{shouldShowExpensifyLogo && (
<View style={styles.expensifyQrLogo}>
<ImageSVG
contentFit="contain"
src={ExpensifyWordmark}
fill={theme.QRLogo}
/>
</View>
)}

<QRCode
getRef={(svg) => (svgRef.current = svg)}
Expand All @@ -57,19 +62,21 @@ function QRShare({url, title, subtitle, logo, svgLogo, svgLogoFillColor, logoBac
svgLogoFillColor={svgLogoFillColor}
logoBackgroundColor={logoBackgroundColor}
logo={logo}
size={qrCodeSize}
size={size ?? qrCodeSize}
logoRatio={logoRatio}
logoMarginRatio={logoMarginRatio}
/>

<Text
family="EXP_NEW_KANSAS_MEDIUM"
fontSize={variables.fontSizeXLarge}
numberOfLines={2}
style={styles.qrShareTitle}
>
{title}
</Text>
{!!title && (
<Text
family="EXP_NEW_KANSAS_MEDIUM"
fontSize={variables.fontSizeXLarge}
numberOfLines={2}
style={styles.qrShareTitle}
>
{title}
</Text>
)}

{!!subtitle && (
<Text
Expand Down
21 changes: 19 additions & 2 deletions src/components/QRShare/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type React from 'react';
import type {ImageSourcePropType} from 'react-native';
import type {ImageSourcePropType, StyleProp, ViewStyle} from 'react-native';
import type {Svg, SvgProps} from 'react-native-svg';
import type {ValueOf} from 'type-fest';
import type {QRCodeLogoMarginRatio, QRCodeLogoRatio} from '@components/QRCode';
import type CONST from '@src/CONST';

type QRShareProps = {
/**
Expand All @@ -12,7 +14,7 @@ type QRShareProps = {
/**
* The title that is displayed below the QR Code (usually the user or report name)
*/
title: string;
title?: string;

/**
* The subtitle which will be shown below the title (usually user email or workspace name)
Expand Down Expand Up @@ -49,6 +51,21 @@ type QRShareProps = {
* The size ratio of margin around logo to QR code
*/
logoMarginRatio?: QRCodeLogoMarginRatio;

/**
* If true, the Expensify logo will be displayed
*/
shouldShowExpensifyLogo?: boolean;

/**
* Additional styles to be applied to the QR code
*/
additionalStyles?: StyleProp<ViewStyle>;

/**
* The size of the QR code
*/
size?: ValueOf<typeof CONST.QR_CODE_SIZE>;
};

type QRShareHandle = {
Expand Down
13 changes: 13 additions & 0 deletions src/pages/settings/AppDownloadLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, {useRef} from 'react';
import type {View} from 'react-native';
import expensifyLogo from '@assets/images/expensify-logo-round-transparent.png';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import * as Expensicons from '@components/Icon/Expensicons';
import MenuItem from '@components/MenuItem';
import type {MenuItemProps} from '@components/MenuItem';
import QRShare from '@components/QRShare';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import useLocalize from '@hooks/useLocalize';
Expand Down Expand Up @@ -61,6 +63,17 @@ function AppDownloadLinksPage() {
title={translate('initialSettingsPage.aboutPage.appDownloadLinks')}
onBackButtonPress={() => Navigation.goBack()}
/>

<QRShare
url={CONST.EXPENSIFY_MOBILE_URL}
logo={expensifyLogo}
logoRatio={CONST.QR.EXPENSIFY_LOGO_SIZE_RATIO}
logoMarginRatio={CONST.QR.EXPENSIFY_LOGO_MARGIN_RATIO}
shouldShowExpensifyLogo={false}
additionalStyles={[styles.qrCodeAppDownloadLinksStyles, styles.shareCodeContainerDownloadPadding]}
size={CONST.QR_CODE_SIZE.APP_DOWNLOAD_LINKS}
/>

<ScrollView style={[styles.mt3]}>
{menuItems.map((item: DownloadMenuItem) => (
<MenuItem
Expand Down
12 changes: 11 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4495,7 +4495,17 @@ const styles = (theme: ThemeColors) =>
overflow: 'hidden',
borderColor: theme.borderFocus,
borderWidth: 2,
backgroundColor: theme.highlightBG,
},

shareCodeContainerDownloadPadding: {
paddingHorizontal: 12,
paddingVertical: 12,
},

qrCodeAppDownloadLinksStyles: {
width: 200,
height: 200,
margin: 'auto',
},

splashScreenHider: {
Expand Down
Loading