From cf356a59e0c25f03ded0da50b74bacd7890d9eb9 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Wed, 22 Feb 2023 14:30:21 +0000 Subject: [PATCH 1/2] fix sms email suffix on sign in page --- src/pages/signin/SignInPage.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/signin/SignInPage.js b/src/pages/signin/SignInPage.js index 851bdd2372d5..dd522794fe3b 100644 --- a/src/pages/signin/SignInPage.js +++ b/src/pages/signin/SignInPage.js @@ -15,6 +15,7 @@ import ResendValidationForm from './ResendValidationForm'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import Performance from '../../libs/Performance'; import Permissions from '../../libs/Permissions'; +import Str from 'expensify-common/lib/str'; const propTypes = { /* Onyx Props */ @@ -91,9 +92,10 @@ class SignInPage extends Component { // We will only know this after a user signs in successfully, without their 2FA code welcomeText = this.props.translate('validateCodeForm.enterAuthenticatorCode'); } else { + let userLogin = Str.removeSMSDomain(this.props.credentials.login); welcomeText = this.props.account.validated - ? this.props.translate('welcomeText.welcomeBackEnterMagicCode', {login: this.props.credentials.login}) - : this.props.translate('welcomeText.welcomeEnterMagicCode', {login: this.props.credentials.login}); + ? this.props.translate('welcomeText.welcomeBackEnterMagicCode', {login: userLogin}) + : this.props.translate('welcomeText.welcomeEnterMagicCode', {login: userLogin}); } } else if (showPasswordForm) { welcomeText = this.props.translate('welcomeText.welcomeBack'); From 9806a011d27c27c3096e8faf3e4ba70d0be555e5 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Wed, 22 Feb 2023 16:25:35 +0000 Subject: [PATCH 2/2] simplify login format solution and align with the go back message --- src/pages/signin/ChangeExpensifyLoginLink.js | 4 +--- src/pages/signin/SignInPage.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pages/signin/ChangeExpensifyLoginLink.js b/src/pages/signin/ChangeExpensifyLoginLink.js index fdc721317c9b..a0913859f80d 100755 --- a/src/pages/signin/ChangeExpensifyLoginLink.js +++ b/src/pages/signin/ChangeExpensifyLoginLink.js @@ -35,9 +35,7 @@ const ChangeExpensifyLoginLink = props => ( {props.translate('common.not')}   - {Str.isSMSLogin(props.credentials.login || '') - ? props.toLocalPhone(Str.removeSMSDomain(props.credentials.login || '')) - : Str.removeSMSDomain(props.credentials.login || '')} + {Str.removeSMSDomain(props.credentials.login)} {'? '} )} diff --git a/src/pages/signin/SignInPage.js b/src/pages/signin/SignInPage.js index dd522794fe3b..d74119c2907e 100644 --- a/src/pages/signin/SignInPage.js +++ b/src/pages/signin/SignInPage.js @@ -4,6 +4,7 @@ import { } from 'react-native'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; +import Str from 'expensify-common/lib/str'; import ONYXKEYS from '../../ONYXKEYS'; import styles from '../../styles/styles'; import compose from '../../libs/compose'; @@ -15,7 +16,6 @@ import ResendValidationForm from './ResendValidationForm'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import Performance from '../../libs/Performance'; import Permissions from '../../libs/Permissions'; -import Str from 'expensify-common/lib/str'; const propTypes = { /* Onyx Props */ @@ -92,7 +92,7 @@ class SignInPage extends Component { // We will only know this after a user signs in successfully, without their 2FA code welcomeText = this.props.translate('validateCodeForm.enterAuthenticatorCode'); } else { - let userLogin = Str.removeSMSDomain(this.props.credentials.login); + const userLogin = Str.removeSMSDomain(this.props.credentials.login); welcomeText = this.props.account.validated ? this.props.translate('welcomeText.welcomeBackEnterMagicCode', {login: userLogin}) : this.props.translate('welcomeText.welcomeEnterMagicCode', {login: userLogin});