diff --git a/settings/src/components/account-status.js b/settings/src/components/account-status.js index 39b68dc7..ed2d3a19 100644 --- a/settings/src/components/account-status.js +++ b/settings/src/components/account-status.js @@ -48,7 +48,7 @@ export default function AccountStatus() { diff --git a/settings/src/components/screen-navigation.js b/settings/src/components/screen-navigation.js index cd9a7eca..82fd1193 100644 --- a/settings/src/components/screen-navigation.js +++ b/settings/src/components/screen-navigation.js @@ -32,14 +32,7 @@ const ScreenNavigation = ( { screen, children, title = '', canNavigate = true } /> ) } -

- { title.length - ? title - : screen - .replace( '-', ' ' ) - .replace( 'totp', 'Two-Factor Authentication' ) - .replace( 'webauthn', 'Two-Factor Security Key' ) } -

+

{ title }

{ children } diff --git a/settings/src/components/screen-navigation.scss b/settings/src/components/screen-navigation.scss index a6a67ad9..9cbc4a1a 100644 --- a/settings/src/components/screen-navigation.scss +++ b/settings/src/components/screen-navigation.scss @@ -21,7 +21,6 @@ h3 { font-weight: 600; margin: unset; - text-transform: capitalize; } } \ No newline at end of file diff --git a/settings/src/components/settings.js b/settings/src/components/settings.js index 0f763a47..69249244 100644 --- a/settings/src/components/settings.js +++ b/settings/src/components/settings.js @@ -24,37 +24,53 @@ export default function Settings() { // The index is the URL slug and the value is the React component. const components = { - home: , - email: , - password: , - totp: ( - { - if ( ! backupCodesEnabled ) { - navigateToScreen( 'backup-codes' ); - } else { - navigateToScreen( 'home' ); - } - } } - /> - ), - webauthn: ( - { - if ( ! backupCodesEnabled ) { - navigateToScreen( 'backup-codes' ); - } - } } - /> - ), - 'backup-codes': navigateToScreen( 'home' ) } />, + email: { + title: 'Account email', + component: , + }, + password: { + title: 'Password', + component: , + }, + totp: { + title: 'Two-factor authentication', + component: ( + { + if ( ! backupCodesEnabled ) { + navigateToScreen( 'backup-codes' ); + } else { + navigateToScreen( 'home' ); + } + } } + /> + ), + }, + 'backup-codes': { + title: 'Backup codes', + component: navigateToScreen( 'home' ) } />, + }, + webauthn: { + title: 'Two-factor security key', + component: ( + { + if ( ! backupCodesEnabled ) { + navigateToScreen( 'backup-codes' ); + } + } } + /> + ), + }, }; const currentScreenComponent = 'home' === screen ? ( - components[ screen ] + ) : ( - { components[ screen ] } + + { components[ screen ].component } + ); return currentScreenComponent;