Skip to content

Commit e1b04e9

Browse files
Merge pull request #18832 from mozilla/FXA-10726
fix(settings): break long email in verification code pages
2 parents 28a628d + 7d7af50 commit e1b04e9

5 files changed

Lines changed: 20 additions & 7 deletions

File tree

packages/fxa-settings/src/pages/Signin/SigninTokenCode/en.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# can stand alone as "{ -product-mozilla-account }"
88
signin-token-code-heading-2 = Enter confirmation code<span> for your { -product-mozilla-account }</span>
99
# { $email } represents the email that the user entered to sign in
10-
signin-token-code-instruction = Enter the code that was sent to { $email } within 5 minutes.
10+
signin-token-code-instruction-v2 = Enter the code that was sent to <email>{ $email }</email> within 5 minutes.
1111
signin-token-code-input-label-v2 = Enter 6-digit code
1212
# Form button to confirm if the confirmation code entered by the user is valid
1313
signin-token-code-confirm-button = Confirm

packages/fxa-settings/src/pages/Signin/SigninTokenCode/index.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ describe('SigninTokenCode page', () => {
104104
'Enter confirmation code for your Mozilla account'
105105
);
106106
screen.getByText(
107-
`Enter the code that was sent to ${MOCK_EMAIL} within 5 minutes.`
107+
(_, element) =>
108+
element?.tagName === 'P' &&
109+
element?.textContent ===
110+
`Enter the code that was sent to ${MOCK_EMAIL} within 5 minutes.`
108111
);
109112
screen.getByLabelText('Enter 6-digit code');
110113
screen.getByRole('button', { name: 'Confirm' });

packages/fxa-settings/src/pages/Signin/SigninTokenCode/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,14 @@ const SigninTokenCode = ({
228228

229229
<EmailCodeImage />
230230

231-
<FtlMsg id="signin-token-code-instruction" vars={{ email }}>
231+
<FtlMsg
232+
id="signin-token-code-instruction-v2"
233+
vars={{ email }}
234+
elems={{ email: <span className="break-all" /> }}
235+
>
232236
<p id="verification-email-message" className="my-4 text-sm">
233-
Enter the code that was sent to {email} within 5 minutes.
237+
Enter the code that was sent to{' '}
238+
<span className="break-all">{email}</span> within 5 minutes.
234239
</p>
235240
</FtlMsg>
236241

packages/fxa-settings/src/pages/Signup/ConfirmSignupCode/en.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ confirm-signup-code-page-title = Enter confirmation code
1010
# can stand alone as "{ -product-mozilla-account }"
1111
confirm-signup-code-heading-2 = Enter confirmation code <span>for your { -product-mozilla-account }</span>
1212
# { $email } represents the email that the user entered to sign in
13-
confirm-signup-code-instruction = Enter the code that was sent to { $email } within 5 minutes.
13+
confirm-signup-code-instruction-v2 = Enter the code that was sent to <email>{ $email }</email> within 5 minutes.
1414
confirm-signup-code-input-label = Enter 6-digit code
1515
# Form button to confirm if the confirmation code entered by the user is valid
1616
confirm-signup-code-confirm-button = Confirm

packages/fxa-settings/src/pages/Signup/ConfirmSignupCode/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,14 @@ const ConfirmSignupCode = ({
299299

300300
<EmailCodeImage />
301301

302-
<FtlMsg id="confirm-signup-code-instruction" vars={{ email: email! }}>
302+
<FtlMsg
303+
id="confirm-signup-code-instruction-v2"
304+
vars={{ email: email! }}
305+
elems={{ email: <span className="break-all" /> }}
306+
>
303307
<p className="mt-2 text-sm">
304-
Enter the code that was sent to {email} within 5 minutes.
308+
Enter the code that was sent to{' '}
309+
<span className="break-all">{email}</span> within 5 minutes.
305310
</p>
306311
</FtlMsg>
307312

0 commit comments

Comments
 (0)