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

Move up warning message on backup code screen. #303

Merged
merged 1 commit into from
Aug 23, 2024
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
14 changes: 7 additions & 7 deletions settings/src/components/backup-codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@
};

generateCodes();
}, [] );

Check warning on line 104 in settings/src/components/backup-codes.js

View workflow job for this annotation

GitHub Actions / All

React Hook useEffect has missing dependencies: 'setBackupCodesVerified', 'setError', and 'userRecord'. Either include them or remove the dependency array

// Finish the setup process.
const handleFinished = useCallback( async () => {

Check warning on line 107 in settings/src/components/backup-codes.js

View workflow job for this annotation

GitHub Actions / All

React Hook useCallback does nothing when called with only one argument. Did you forget to pass an array of dependencies?
// TODO: Add try catch here after https://github.com/WordPress/wporg-two-factor/pull/187/files is merged.
// The codes have already been saved to usermeta, see `generateCodes()` above.
setBackupCodesVerified( true );
Expand All @@ -123,6 +123,13 @@
</p>

<p>Please print the codes and keep them in a safe place.</p>

<Notice status="warning" isDismissible={ false }>
<Icon icon={ warning } className="wporg-2fa__print-codes-warning" />
Without access to the one-time password app or a backup code, you will lose
access to your account. Once you navigate away from this page, you will not be
be able to view these codes again.
</Notice>
</div>

{ error ? (
Expand All @@ -140,13 +147,6 @@
<DownloadButton codes={ backupCodes } />
</ButtonGroup>

<Notice status="warning" isDismissible={ false }>
<Icon icon={ warning } className="wporg-2fa__print-codes-warning" />
Without access to the one-time password app or a backup code, you will lose
access to your account. Once you navigate away from this page, you will not
be able to view these codes again.
</Notice>

<CheckboxControl
label="I have printed or saved these codes"
checked={ hasPrinted }
Expand Down
1 change: 1 addition & 0 deletions settings/src/components/backup-codes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

.wporg-2fa__backup-codes-list {
background-color: $gray-300;
margin-top: 24px;
padding: 15px 20px;

ol {
Expand Down
Loading