Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix message for email verification double click #1485

Merged
merged 2 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ way to update this template, but currently, we follow a pattern:

## Upcoming version 2021-XX-XX

- [fix] Double click issue. Show dedicated message, when current user doesn't have a pending email
address, but there's a verification error.
[#1485](https://github.com/sharetribe/ftw-daily/pull/1485)
- [change] Update comment about how scrollIntoView works with links using hash.
[#1484](https://github.com/sharetribe/ftw-daily/pull/1484)
- [fix] Account pages: mobile tab navigation should only scroll horizontally
Expand Down
32 changes: 31 additions & 1 deletion src/forms/EmailVerificationForm/EmailVerificationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,37 @@ const EmailVerificationFormComponent = props => (
</div>
);

return emailVerified && !pendingEmail && !verificationError ? alreadyVerified : verifyEmail;
const currentEmail = <strong>{email}</strong>;
const alreadyVerifiedButErrorReturned = (
<div className={css.root}>
<div>
<IconEmailSuccess className={css.modalIcon} />
<h1 className={css.modalTitle}>
<FormattedMessage id="EmailVerificationForm.noPendingTitle" values={{ name }} />
</h1>

<p className={css.modalMessage}>
<FormattedMessage
id="EmailVerificationForm.noPendingText"
values={{ email: currentEmail, breakline: <br /> }}
/>
</p>
</div>

<div className={css.bottomWrapper}>
<NamedLink className={css.submitButton} name="LandingPage">
<FormattedMessage id="EmailVerificationForm.successButtonText" />
</NamedLink>
</div>
</div>
);

const anyPendingEmailHasBeenVerifiedForCurrentUser = emailVerified && !pendingEmail;
return anyPendingEmailHasBeenVerifiedForCurrentUser && verificationError
? alreadyVerifiedButErrorReturned
: anyPendingEmailHasBeenVerifiedForCurrentUser
? alreadyVerified
: verifyEmail;
}}
/>
);
Expand Down
2 changes: 2 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@
"EditListingWizard.tabLabelPolicy": "Sauna rules",
"EditListingWizard.tabLabelPricing": "Pricing",
"EmailVerificationForm.finishAccountSetup": "We will need to send you email notifications. To allow this, please verify your email address {email}.",
"EmailVerificationForm.noPendingText": "Everything looks good. Your current email address is {email}. {breakline}Time to get out there – have a great day.",
"EmailVerificationForm.noPendingTitle": "You didn't have any pending email address, {name}.",
"EmailVerificationForm.successButtonText": "Continue exploring",
"EmailVerificationForm.successText": "Everything looks good. Time to get out there – have a great day.",
"EmailVerificationForm.successTitle": "Thanks for verifying your email address, {name}.",
Expand Down