Skip to content

Commit

Permalink
Fix the linter.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne committed Jul 17, 2024
1 parent b1b8f8c commit 8f3c857
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
1 change: 0 additions & 1 deletion settings/src/components/first-time/first-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export default function FirstTime() {
<div className="wporg-2fa__first-time__inner-content">
<WordPressLogo />
{ currentScreenComponent }

</div>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion settings/src/components/first-time/first-time.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
height: 100%;
z-index: 1000;


.wporg-2fa__first-time__inner {
padding: 80px 0;
margin-top: 20px;
Expand Down Expand Up @@ -36,6 +35,10 @@
.components-card {
width: 100%;
}

.components-card__body {
padding: 32px;
}
}

.wporg-2fa__first-time-default {
Expand Down
5 changes: 3 additions & 2 deletions settings/src/components/first-time/home.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jsx-a11y/label-has-associated-control */
/**
* WordPress dependencies
*/
Expand All @@ -23,7 +24,7 @@ export default function Select( { onSelect } ) {
<>
<p>Select a method to configure two-factor authentication for your account.</p>
<form className="wporg-2fa__first-time-default">
<label htmlFor="totp" className="wporg-2fa__first-time-default-item">
<label className="wporg-2fa__first-time-default-item">
<input
type="radio"
id="totp"
Expand All @@ -37,7 +38,7 @@ export default function Select( { onSelect } ) {
<p>Use an application to get two-factor authentication codes.</p>
</div>
</label>
<label htmlFor="webauthn" className="wporg-2fa__first-time-default-item">
<label className="wporg-2fa__first-time-default-item">
<input
type="radio"
id="webauthn"
Expand Down
1 change: 1 addition & 0 deletions settings/src/components/screen-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ScreenLink from './screen-link';
* @param props.children
* @param props.screen
* @param props.title
* @param props.canNavigate
*/
// eslint-disable-next-line no-unused-vars
const ScreenNavigation = ( { screen, children, title = '', canNavigate = true } ) => (
Expand Down
5 changes: 2 additions & 3 deletions settings/src/components/totp.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ import Success from './success';

export default function TOTP( { onSuccess } ) {
const {
user: { backupCodesEnabled, totpEnabled },
navigateToScreen,
user: { totpEnabled },
} = useContext( GlobalContext );
const [ success, setSuccess ] = useState( false );

const afterTimeout = useCallback( () => {
setSuccess( false );

onSuccess();
}, [ backupCodesEnabled, navigateToScreen ] );
}, [ onSuccess ] );

if ( success ) {
return (
Expand Down
2 changes: 1 addition & 1 deletion settings/src/components/webauthn/webauthn.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function WebAuthn( { onKeyAdd = () => {} } ) {

updateFlow( 'manage' );
onKeyAdd();
}, [ webAuthnEnabled, toggleProvider, updateFlow ] );
}, [ webAuthnEnabled, toggleProvider, updateFlow, onKeyAdd ] );

if ( 'register' === flow ) {
return (
Expand Down
9 changes: 7 additions & 2 deletions settings/src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Spinner } from '@wordpress/components';
import { useUser } from './hooks/useUser';
import GlobalNotice from './components/global-notice';
import RevalidateModal from './components/revalidate-modal';
//import Settings from './components/settings';
import Settings from './components/settings';
import FirstTime from './components/first-time/first-time';

export const GlobalContext = createContext( null );
Expand Down Expand Up @@ -144,7 +144,12 @@ function Main( { userId } ) {
} }
>
<GlobalNotice notice={ globalNotice } setNotice={ setGlobalNotice } />
<FirstTime />

{ new URLSearchParams( window.location.search ).get( 'first-time' ) ? (
<FirstTime />
) : (
<Settings />
) }
{ shouldRevalidate && <RevalidateModal /> }
</GlobalContext.Provider>
);
Expand Down

0 comments on commit 8f3c857

Please sign in to comment.