Skip to content

Commit

Permalink
Merge pull request #55366 from daledah/fix/55365
Browse files Browse the repository at this point in the history
[CP Staging] Update messaging on Here's your magic code page

(cherry picked from commit 615eeaa)

(CP triggered by AndrewGable)
  • Loading branch information
mountiny authored and OSBotify committed Jan 16, 2025
1 parent f6b8f4d commit f9bd0fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/components/ValidateCode/ValidateCodeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import React, {useCallback} from 'react';
import {View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import ExpensifyWordmark from '@components/ExpensifyWordmark';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
import {MagicCode} from '@components/Icon/Illustrations';
import Text from '@components/Text';
import TextLink from '@components/TextLink';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import {signInWithValidateCode} from '@libs/actions/Session';
import Navigation from '@libs/Navigation/Navigation';
import * as ValidationUtils from '@libs/ValidationUtils';
import {isValidValidateCode} from '@libs/ValidationUtils';
import variables from '@styles/variables';
import * as Session from '@userActions/Session';
import ONYXKEYS from '@src/ONYXKEYS';

type ValidateCodeModalProps = {
Expand All @@ -28,14 +28,14 @@ function ValidateCodeModal({code, accountID}: ValidateCodeModalProps) {
const theme = useTheme();
const styles = useThemeStyles();
const [session] = useOnyx(ONYXKEYS.SESSION);
const signInHere = useCallback(() => Session.signInWithValidateCode(accountID, code), [accountID, code]);
const signInHere = useCallback(() => signInWithValidateCode(accountID, code), [accountID, code]);
const {translate} = useLocalize();
const {shouldUseNarrowLayout} = useResponsiveLayout();

return (
<FullPageNotFoundView
testID="validate-code-not-found"
shouldShow={!ValidationUtils.isValidValidateCode(code)}
shouldShow={!isValidValidateCode(code)}
shouldShowBackButton={shouldUseNarrowLayout}
onLinkPress={() => {
Navigation.goBack();
Expand All @@ -50,7 +50,7 @@ function ValidateCodeModal({code, accountID}: ValidateCodeModalProps) {
<Icon
width={variables.modalTopIconWidth}
height={variables.modalTopIconHeight}
src={Illustrations.MagicCode}
src={MagicCode}
/>
</View>
<Text style={[styles.textHeadline, styles.textXXLarge, styles.textAlignCenter]}>{translate('validateCodeModal.title')}</Text>
Expand All @@ -68,13 +68,16 @@ function ValidateCodeModal({code, accountID}: ValidateCodeModalProps) {
<View style={styles.mt6}>
<Text style={styles.validateCodeDigits}>{code}</Text>
</View>
<View style={[styles.mt6]}>
<Text style={styles.textAlignCenter}>{translate('validateCodeModal.doNotShare')}</Text>
</View>
</View>
<View style={styles.deeplinkWrapperFooter}>
<Icon
width={variables.modalWordmarkWidth}
height={variables.modalWordmarkHeight}
fill={theme.success}
src={Expensicons.ExpensifyWordmark}
src={ExpensifyWordmark}
/>
</View>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ const translations = {
successfulSignInDescription: 'Head back to your original tab to continue.',
title: "Here's your magic code",
description: 'Please enter the code from the device\nwhere it was originally requested',
doNotShare: 'Do not share your code with anyone.\nExpensify will never ask you for it!',
or: ', or',
signInHere: 'just sign in here',
expiredCodeTitle: 'Magic code expired',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ const translations = {
successfulSignInDescription: 'Vuelve a la pestaña original para continuar.',
title: 'Aquí está tu código mágico',
or: ', ¡o',
doNotShare: '¡No compartas tu código con nadie.\nExpensify nunca te lo pedirá.',
description: 'Por favor, introduce el código utilizando el dispositivo\nen el que se solicitó originalmente',
signInHere: 'simplemente inicia sesión aquí',
expiredCodeTitle: 'Código mágico caducado',
Expand Down

0 comments on commit f9bd0fb

Please sign in to comment.