diff --git a/src/account-settings/AccountSettingsPage.jsx b/src/account-settings/AccountSettingsPage.jsx index 966ff97..398beb4 100644 --- a/src/account-settings/AccountSettingsPage.jsx +++ b/src/account-settings/AccountSettingsPage.jsx @@ -209,19 +209,15 @@ class AccountSettingsPage extends React.Component { } renderVerifiedNameSuccessMessage() { - if (this.props.formValues.verified_name_enabled && this.props.formValues.is_verified) { - return ( - - ); - } - - return null; + return ( + + ); } renderEmptyStaticFieldMessage() { @@ -279,7 +275,9 @@ class AccountSettingsPage extends React.Component { // Show State field only if the country is US (could include Canada later) const showState = this.props.formValues.country === COUNTRY_WITH_STATES; - const showVerifiedName = this.props.formValues.verified_name_enabled && this.props.formValues.verified_name; + const showVerifiedName = this.props.formValues.verifiedName + && this.props.formValues.verifiedName.verified_name_enabled; + const showVerifiedApproved = showVerifiedName && this.props.formValues.verifiedName.status === 'approved'; const timeZoneOptions = this.getLocalizedTimeZoneOptions( this.props.timeZoneOptions, @@ -292,7 +290,7 @@ class AccountSettingsPage extends React.Component { return ( <>
- {this.renderVerifiedNameSuccessMessage()} + {showVerifiedApproved && this.renderVerifiedNameSuccessMessage()}

{this.props.intl.formatMessage(messages['account.settings.section.account.information'])} @@ -331,17 +329,17 @@ class AccountSettingsPage extends React.Component { {this.props.intl.formatMessage(messages['account.settings.field.name.verified'])} - {this.props.formValues.is_verified && } + {showVerifiedApproved && }

) } helpText={ - this.props.formValues.is_verified + showVerifiedApproved ? this.props.intl.formatMessage(messages['account.settings.field.name.verified.help.text.verified']) : this.props.intl.formatMessage(messages['account.settings.field.name.verified.help.text.pending']) } @@ -624,9 +622,11 @@ AccountSettingsPage.propTypes = { }), state: PropTypes.string, shouldDisplayDemographicsSection: PropTypes.bool, - verified_name: PropTypes.string, - is_verified: PropTypes.bool, - verified_name_enabled: PropTypes.bool, + verifiedName: PropTypes.shape({ + verified_name: PropTypes.string, + status: PropTypes.string, + verified_name_enabled: PropTypes.bool, + }), }).isRequired, siteLanguage: PropTypes.shape({ previousValue: PropTypes.string, diff --git a/src/account-settings/data/service.js b/src/account-settings/data/service.js index 1313611..21370b9 100644 --- a/src/account-settings/data/service.js +++ b/src/account-settings/data/service.js @@ -228,7 +228,7 @@ export async function getSettings(username, userRoles, userId) { shouldDisplayDemographicsSection: shouldDisplayDemographicsQuestionsResponse, ...demographics, demographicsOptions, - ...verifiedName, + verifiedName, }; }