Skip to content

Commit b32c7f5

Browse files
committed
feat: Add caution message to magic code input on login
1 parent d2c0d7a commit b32c7f5

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/languages/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,6 +2926,7 @@ const translations = {
29262926
incorrectMagicCode: 'Incorrect or invalid magic code. Please try again or request a new code.',
29272927
pleaseFillTwoFactorAuth: 'Please enter your two-factor authentication code',
29282928
},
2929+
avoidScamsMessage: '<strong>Avoid scams. Do not share your code with anyone.</strong> Our team will never call, text, or email you for this code.',
29292930
},
29302931
passwordForm: {
29312932
pleaseFillOutAllFields: 'Please fill out all fields',

src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@ import {View} from 'react-native';
44
import Button from '@components/Button';
55
import SafariFormWrapper from '@components/Form/SafariFormWrapper';
66
import FormHelpMessage from '@components/FormHelpMessage';
7+
import Icon from '@components/Icon';
78
import type {MagicCodeInputHandle} from '@components/MagicCodeInput';
89
import MagicCodeInput from '@components/MagicCodeInput';
910
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
11+
import RenderHTML from '@components/RenderHTML';
1012
import Text from '@components/Text';
1113
import TextInput from '@components/TextInput';
1214
import ValidateCodeCountdown from '@components/ValidateCodeCountdown';
1315
import type {ValidateCodeCountdownHandle} from '@components/ValidateCodeCountdown/types';
1416
import type {WithToggleVisibilityViewProps} from '@components/withToggleVisibilityView';
1517
import withToggleVisibilityView from '@components/withToggleVisibilityView';
18+
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
1619
import useLocalize from '@hooks/useLocalize';
1720
import useNetwork from '@hooks/useNetwork';
1821
import useOnyx from '@hooks/useOnyx';
1922
import usePrevious from '@hooks/usePrevious';
2023
import useStyleUtils from '@hooks/useStyleUtils';
24+
import useTheme from '@hooks/useTheme';
2125
import useThemeStyles from '@hooks/useThemeStyles';
2226
import AccountUtils from '@libs/AccountUtils';
2327
import canFocusInputOnScreenFocus from '@libs/canFocusInputOnScreenFocus';
@@ -63,6 +67,8 @@ function BaseValidateCodeForm({autoComplete, isUsingRecoveryCode, setIsUsingReco
6367
const [needToClearError, setNeedToClearError] = useState<boolean>(!!account?.errors);
6468
const [isCountdownRunning, setIsCountdownRunning] = useState(true);
6569
const StyleUtils = useStyleUtils();
70+
const theme = useTheme();
71+
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Exclamation']);
6672

6773
const prevRequiresTwoFactorAuth = usePrevious(account?.requiresTwoFactorAuth);
6874
const prevValidateCode = usePrevious(credentials?.validateCode);
@@ -403,6 +409,18 @@ function BaseValidateCodeForm({autoComplete, isUsingRecoveryCode, setIsUsingReco
403409
</PressableWithFeedback>
404410
)}
405411
</View>
412+
<View style={[styles.mt5, styles.flexRow, styles.alignItemsCenter]}>
413+
<View style={[styles.mr3]}>
414+
<Icon
415+
src={expensifyIcons.Exclamation}
416+
fill={theme.icon}
417+
medium
418+
/>
419+
</View>
420+
<View style={styles.flex1}>
421+
<RenderHTML html={translate('validateCodeForm.avoidScamsMessage')} />
422+
</View>
423+
</View>
406424
</View>
407425
)}
408426
<View>

0 commit comments

Comments
 (0)