WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 6a04b30

Browse files
authored
Merge pull request #17982 from mozilla/FXA-10210
feat(ux): Update 2fa signin screens/reset PW copy, create HeadingPrimary
2 parents 448265b + d722c1f commit 6a04b30

File tree

20 files changed

+144
-150
lines changed

20 files changed

+144
-150
lines changed

packages/functional-tests/pages/resetPassword.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class ResetPasswordPage extends BaseLayout {
194194
}
195195

196196
async fillOutTotpForm(code: string) {
197-
await this.page.getByLabel('Enter code').fill(code);
197+
await this.page.getByLabel('Enter 6-digit code').fill(code);
198198
return this.page.getByRole('button', { name: 'Confirm' }).click();
199199
}
200200

@@ -203,9 +203,7 @@ export class ResetPasswordPage extends BaseLayout {
203203
}
204204

205205
async fillOurRecoveryCodeForm(code: string) {
206-
await this.page
207-
.getByLabel('Enter 10-digit backup authentication code')
208-
.fill(code);
206+
await this.page.getByLabel('Enter 10-character code').fill(code);
209207
return this.page.getByRole('button', { name: 'Confirm' }).click();
210208
}
211209

packages/functional-tests/pages/signinRecoveryCode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class SigninRecoveryCodePage extends BaseTokenCodePage {
1010
get codeInput() {
1111
this.checkPath();
1212
return this.page
13-
.getByLabel('Enter 10-digit backup') // React
13+
.getByLabel('Enter 10-character code') // React
1414
.or(this.page.getByPlaceholder('Enter 10-digit backup')); //Backbone
1515
}
1616
}

packages/functional-tests/pages/signinTotpCode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class SigninTotpCodePage extends BaseTokenCodePage {
1010
get codeInput() {
1111
this.checkPath();
1212
return this.page
13-
.getByLabel('Enter code') // React
13+
.getByLabel('Enter 6-digit code') // React
1414
.or(this.page.getByPlaceholder('Enter 6-digit code')); //Backbone
1515
}
1616

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
import React from 'react';
6+
import { HeadingPrimary } from '.';
7+
import { Meta } from '@storybook/react';
8+
9+
export default {
10+
title: 'Components/HeadingPrimary',
11+
component: HeadingPrimary,
12+
} as Meta;
13+
14+
export const Default = <HeadingPrimary>Primary heading text</HeadingPrimary>;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
import React from 'react';
6+
7+
export const HeadingPrimary = ({
8+
children,
9+
marginClass = 'mb-5',
10+
}: {
11+
children: React.ReactNode;
12+
marginClass?: string;
13+
}) => <h1 className={`${marginClass} text-grey-400 text-base`}>{children}</h1>;

packages/fxa-settings/src/components/InlineRecoveryKeySetupCreate/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { FtlMsg } from 'fxa-react/lib/utils';
88
import { CreateRecoveryKeyHandler } from '../../pages/InlineRecoveryKeySetup/interfaces';
99
import Banner from '../Banner';
1010
import { useFtlMsgResolver } from '../../models';
11+
import { HeadingPrimary } from '../HeadingPrimary';
1112

1213
export const InlineRecoveryKeySetupCreate = ({
1314
createRecoveryKeyHandler,
@@ -50,11 +51,9 @@ export const InlineRecoveryKeySetupCreate = ({
5051
content={{ localizedHeading: localizedErrorBannerMessage }}
5152
/>
5253
)}
53-
<h1 className="text-grey-400 mb-3 mt-5">
54-
<FtlMsg id="inline-recovery-key-setup-create-header">
55-
Secure your account
56-
</FtlMsg>
57-
</h1>
54+
<FtlMsg id="inline-recovery-key-setup-create-header">
55+
<HeadingPrimary>Secure your account</HeadingPrimary>
56+
</FtlMsg>
5857

5958
<RecoveryKeyImage className="my-6 mx-auto" />
6059

packages/fxa-settings/src/pages/InlineRecoveryKeySetup/index.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { InlineRecoveryKeySetupProps } from './interfaces';
1414
import RecoveryKeySetupHint from '../../components/RecoveryKeySetupHint';
1515
import Banner from '../../components/Banner';
1616
import { useFtlMsgResolver } from '../../models';
17+
import { HeadingPrimary } from '../../components/HeadingPrimary';
1718

1819
const viewName = 'inline-recovery-key-setup';
1920

@@ -43,11 +44,9 @@ export const InlineRecoveryKeySetup = ({
4344
case 3:
4445
return (
4546
<>
46-
<h1 className="text-grey-400">
47-
<FtlMsg id="inline-recovery-key-setup-hint-header">
48-
Security recommendation
49-
</FtlMsg>
50-
</h1>
47+
<FtlMsg id="inline-recovery-key-setup-hint-header">
48+
<HeadingPrimary>Security recommendation</HeadingPrimary>
49+
</FtlMsg>
5150
<RecoveryKeySetupHint
5251
{...{ viewName }}
5352
navigateForward={() => {
@@ -69,11 +68,9 @@ export const InlineRecoveryKeySetup = ({
6968
),
7069
}}
7170
/>
72-
<h1 className="text-grey-400 mb-3 mt-5">
73-
<FtlMsg id="inline-recovery-key-setup-download-header">
74-
Secure your account
75-
</FtlMsg>
76-
</h1>
71+
<FtlMsg id="inline-recovery-key-setup-download-header">
72+
<HeadingPrimary>Secure your account</HeadingPrimary>
73+
</FtlMsg>
7774
<RecoveryKeyImage className="my-6 mx-auto" />
7875

7976
<h2 className="font-bold text-xl mb-5">

packages/fxa-settings/src/pages/ResetPassword/AccountRecoveryConfirmKey/index.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { getLocalizedErrorMessage } from '../../../lib/error-utils';
2222
import { RecoveryKeyImage } from '../../../components/images';
2323
import { Constants } from '../../../lib/constants';
2424
import Banner from '../../../components/Banner';
25+
import { HeadingPrimary } from '../../../components/HeadingPrimary';
2526

2627
// TODO in FXA-7894 use sensitive data client to pass sensitive data
2728
// Depends on FXA-7400
@@ -138,23 +139,19 @@ const AccountRecoveryConfirmKey = ({
138139
};
139140

140141
return (
141-
<AppLayout>
142+
<AppLayout cardClass="card-base">
142143
<FtlMsg id="password-reset-flow-heading">
143-
<h1 className="text-start text-grey-400 text-sm">
144-
Reset your password
145-
</h1>
144+
<HeadingPrimary>Reset your password</HeadingPrimary>
146145
</FtlMsg>
147146
{errorMessage && (
148147
<Banner type="error" content={{ localizedHeading: errorMessage }} />
149148
)}
150149
<RecoveryKeyImage className="mx-auto my-2" />
151150
<FtlMsg id="account-recovery-confirm-key-heading">
152-
<h2 className="card-header text-start mb-2">
153-
Enter your account recovery key
154-
</h2>
151+
<h2 className="card-header mb-2">Enter your account recovery key</h2>
155152
</FtlMsg>
156153
<FtlMsg id="account-recovery-confirm-key-instruction">
157-
<p className="text-start text-sm">
154+
<p className="text-sm">
158155
This key recovers your encrypted browsing data, such as passwords and
159156
bookmarks, from Firefox servers.
160157
</p>
@@ -190,7 +187,7 @@ const AccountRecoveryConfirmKey = ({
190187
</FtlMsg>
191188

192189
{recoveryKeyHint && (
193-
<div className="bg-grey-50 p-4 text-start text-sm rounded-md">
190+
<div className="bg-grey-50 p-4 text-sm rounded-md">
194191
<FtlMsg id="account-recovery-confirm-key-hint">
195192
<p className="text-grey-500">Your storage hint is:</p>
196193
</FtlMsg>

packages/fxa-settings/src/pages/ResetPassword/CompleteResetPassword/index.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { FtlMsg } from 'fxa-react/lib/utils';
1818
import ResetPasswordWarning from '../../../components/ResetPasswordWarning';
1919
import { Link, useLocation } from '@reach/router';
2020
import Banner from '../../../components/Banner';
21+
import { HeadingPrimary } from '../../../components/HeadingPrimary';
2122

2223
const CompleteResetPassword = ({
2324
email,
@@ -63,11 +64,9 @@ const CompleteResetPassword = ({
6364
};
6465

6566
return (
66-
<AppLayout>
67+
<AppLayout cardClass="card-base">
6768
<FtlMsg id="password-reset-flow-heading">
68-
<p className="text-start text-grey-400 text-sm mb-6">
69-
Reset your password
70-
</p>
69+
<HeadingPrimary>Reset your password</HeadingPrimary>
7170
</FtlMsg>
7271

7372
{/*
@@ -92,11 +91,9 @@ const CompleteResetPassword = ({
9291
<input type="email" value={email} className="hidden" readOnly />
9392

9493
<FtlMsg id="complete-reset-pw-header-v2">
95-
<h1 className="font-semibold text-xl text-start mt-6">
96-
Create a new password
97-
</h1>
94+
<h1 className="font-semibold text-xl mt-6">Create a new password</h1>
9895
</FtlMsg>
99-
<section className="text-start mt-2">
96+
<section className="mt-2">
10097
<FormPasswordWithInlineCriteria
10198
{...{
10299
email,

packages/fxa-settings/src/pages/ResetPassword/ConfirmResetPassword/index.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { ResendStatus } from '../../../lib/types';
1414
import { EmailCodeImage } from '../../../components/images';
1515
import GleanMetrics from '../../../lib/glean';
1616
import Banner, { ResendCodeSuccessBanner } from '../../../components/Banner';
17+
import { HeadingPrimary } from '../../../components/HeadingPrimary';
1718

1819
const ConfirmResetPassword = ({
1920
clearBanners,
@@ -43,9 +44,9 @@ const ConfirmResetPassword = ({
4344
};
4445

4546
return (
46-
<AppLayout>
47+
<AppLayout cardClass="card-base">
4748
<FtlMsg id="password-reset-flow-heading">
48-
<p className="text-start text-grey-400 text-sm">Reset your password</p>
49+
<HeadingPrimary marginClass="">Reset your password</HeadingPrimary>
4950
</FtlMsg>
5051
{resendStatus === ResendStatus.sent && !hasResendError && (
5152
<ResendCodeSuccessBanner />
@@ -61,16 +62,14 @@ const ConfirmResetPassword = ({
6162
)}
6263
<EmailCodeImage className="mx-auto" />
6364
<FtlMsg id="confirm-reset-password-with-code-heading">
64-
<h2 className="card-header text-start my-4">Check your email</h2>
65+
<h2 className="card-header my-4">Check your email</h2>
6566
</FtlMsg>
6667
<FtlMsg
6768
id="confirm-reset-password-with-code-instruction"
6869
vars={{ email }}
6970
elems={{ span: spanElement }}
7071
>
71-
<p className="text-start">
72-
We sent a confirmation code to {spanElement}.
73-
</p>
72+
<p>We sent a confirmation code to {spanElement}.</p>
7473
</FtlMsg>
7574
<FormVerifyTotp
7675
codeLength={8}
@@ -91,7 +90,7 @@ const ConfirmResetPassword = ({
9190
}}
9291
/>
9392
<LinkRememberPassword {...{ email }} clickHandler={signinClickHandler} />
94-
<div className="flex justify-between mt-4 text-sm">
93+
<div className="flex justify-between mt-5 text-sm">
9594
<FtlMsg id="confirm-reset-password-otp-resend-code-button">
9695
<button type="button" className="link-blue" onClick={resendCode}>
9796
Resend code

0 commit comments

Comments
 (0)