diff --git a/src/languages/en.ts b/src/languages/en.ts index 506ecd43cc1c..6328ea0612f3 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1824,6 +1824,9 @@ const translations = { onceTheAbove: 'Once the above steps are completed, please reach out to ', toUnblock: ' to unblock your login.', }, + smsDeliveryFailurePage: { + smsDeliveryFailureMessage: ({login}: OurEmailProviderParams) => `We've been unable to deliver SMS messages to ${login}, so we've suspended it for 24 hours.`, + }, welcomeSignUpForm: { join: 'Join', }, diff --git a/src/languages/es.ts b/src/languages/es.ts index 740dac086587..b80100e590e1 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1829,6 +1829,9 @@ const translations = { onceTheAbove: 'Una vez completados los pasos anteriores, ponte en contacto con ', toUnblock: ' para desbloquear el inicio de sesiĆ³n.', }, + smsDeliveryFailurePage: { + smsDeliveryFailureMessage: ({login}: OurEmailProviderParams) => `No hemos podido entregar mensajes SMS a ${login}, por lo que lo hemos suspendido durante 24 horas.`, + }, welcomeSignUpForm: { join: 'Unirse', }, diff --git a/src/pages/signin/SMSDeliveryFailurePage.tsx b/src/pages/signin/SMSDeliveryFailurePage.tsx new file mode 100644 index 000000000000..86f4f9959d8b --- /dev/null +++ b/src/pages/signin/SMSDeliveryFailurePage.tsx @@ -0,0 +1,68 @@ +import {Str} from 'expensify-common'; +import React, {useEffect, useMemo} from 'react'; +import {Keyboard, View} from 'react-native'; +import {useOnyx} from 'react-native-onyx'; +import Button from '@components/Button'; +import Text from '@components/Text'; +import useKeyboardState from '@hooks/useKeyboardState'; +import useLocalize from '@hooks/useLocalize'; +import useThemeStyles from '@hooks/useThemeStyles'; +import * as Session from '@userActions/Session'; +import ONYXKEYS from '@src/ONYXKEYS'; +import ChangeExpensifyLoginLink from './ChangeExpensifyLoginLink'; +import Terms from './Terms'; + +function SMSDeliveryFailurePage() { + const styles = useThemeStyles(); + const {isKeyboardShown} = useKeyboardState(); + const {translate} = useLocalize(); + const [credentials] = useOnyx(ONYXKEYS.CREDENTIALS); + const [account] = useOnyx(ONYXKEYS.ACCOUNT); + + const login = useMemo(() => { + if (!credentials?.login) { + return ''; + } + return Str.isSMSLogin(credentials.login) ? Str.removeSMSDomain(credentials.login) : credentials.login; + }, [credentials?.login]); + + const SMSDeliveryFailureMessage = account?.SMSDeliveryFailureStatus?.message; + + useEffect(() => { + if (!isKeyboardShown) { + return; + } + Keyboard.dismiss(); + }, [isKeyboardShown]); + + return ( + <> + + + + {translate('smsDeliveryFailurePage.smsDeliveryFailureMessage', {login})} {SMSDeliveryFailureMessage} + + + + +