From c749b6355f405bc43a2dae2159795c4f422b3c38 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 28 Aug 2019 10:34:50 -0400 Subject: [PATCH] Update email help text Fixes https://github.com/vector-im/riot-web/issues/10674 --- src/components/views/auth/RegistrationForm.js | 36 ++++++++++++++----- src/i18n/strings/en_EN.json | 5 ++- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index cf1b074fe1..d3f275ffc3 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -444,6 +444,15 @@ module.exports = React.createClass({ return true; }, + _showPhoneNumber() { + const threePidLogin = !SdkConfig.get().disable_3pid_login; + const haveIs = Boolean(this.props.serverConfig.isUrl); + if (!threePidLogin || !haveIs || !this._authStepIsUsed('m.login.msisdn')) { + return false; + } + return true; + }, + renderEmail() { if (!this._showEmail()) { return null; @@ -490,9 +499,7 @@ module.exports = React.createClass({ }, renderPhoneNumber() { - const threePidLogin = !SdkConfig.get().disable_3pid_login; - const haveIs = Boolean(this.props.serverConfig.isUrl); - if (!threePidLogin || !haveIs || !this._authStepIsUsed('m.login.msisdn')) { + if (!this._showPhoneNumber()) { return null; } const CountryDropdown = sdk.getComponent('views.auth.CountryDropdown'); @@ -564,11 +571,24 @@ module.exports = React.createClass({ ); - const emailHelperText = this._showEmail() ?
- {_t("Use an email address to recover your account.") + " "} - {_t("Other users can invite you to rooms using your contact details.")} -
: null; - + let emailHelperText = null; + if (this._showEmail()) { + if (this._showPhoneNumber()) { + emailHelperText =
+ {_t( + "Set an email for account recovery. " + + "Use email or phone to optionally be discoverable by existing contacts.", + )} +
; + } else { + emailHelperText =
+ {_t( + "Set an email for account recovery. " + + "Use email to optionally be discoverable by existing contacts.", + )} +
; + } + } const haveIs = Boolean(this.props.serverConfig.isUrl); const noIsText = haveIs ? null :
{_t( diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 62b6467b94..f1d494bd9b 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1461,9 +1461,8 @@ "Phone (optional)": "Phone (optional)", "Create your Matrix account on %(serverName)s": "Create your Matrix account on %(serverName)s", "Create your Matrix account on ": "Create your Matrix account on ", - "Use an email address to recover your account.": "Use an email address to recover your account.", - "Other users can invite you to rooms using your contact details.": "Other users can invite you to rooms using your contact details.", - "No Identity Server is configured: no email addreses can be added. You will be unable to reset your password.": "No Identity Server is configured: no email addreses can be added. You will be unable to reset your password.", + "Set an email for account recovery. Use email or phone to optionally be discoverable by existing contacts.": "Set an email for account recovery. Use email or phone to optionally be discoverable by existing contacts.", + "Set an email for account recovery. Use email to optionally be discoverable by existing contacts.": "Set an email for account recovery. Use email to optionally be discoverable by existing contacts.", "Other servers": "Other servers", "Enter custom server URLs What does this mean?": "Enter custom server URLs What does this mean?", "Homeserver URL": "Homeserver URL",