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 backup code actions directly below codes #295

Merged
merged 1 commit into from
Aug 14, 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
12 changes: 6 additions & 6 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 Down Expand Up @@ -134,6 +134,12 @@
<>
<CodeList codes={ backupCodes } />

<ButtonGroup>
<CopyToClipboardButton codes={ backupCodes } />
<PrintButton />
<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
Expand All @@ -159,12 +165,6 @@
>
All Finished
</Button>

<ButtonGroup>
<CopyToClipboardButton codes={ backupCodes } />
<PrintButton />
<DownloadButton codes={ backupCodes } />
</ButtonGroup>
</Flex>
</>
);
Expand Down
9 changes: 4 additions & 5 deletions settings/src/components/backup-codes.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.wporg-2fa__backup-codes {
> * {
margin-bottom: 1em;
}

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

ol {
Expand All @@ -18,10 +21,6 @@
color: $gray-700;
}
}

.components-notice {
margin: 0 0 1em;
}
}

#bbpress-forums .wporg-2fa__backup-codes {
Expand Down
Loading