feat: better menu matching and overview page (#4384)
parent
0f8de33f2f
commit
ff26673659
|
@ -15,12 +15,13 @@
|
|||
"Manage your security keys": "Manage your security keys",
|
||||
"Name": "Name",
|
||||
"No": "No",
|
||||
"Overview": "Overview",
|
||||
"Provide the details for the new security key": "Provide the details for the new security key",
|
||||
"Relying Party ID": "Relying Party ID",
|
||||
"Security Keys": "Security Keys",
|
||||
"Settings": "Settings",
|
||||
"Show Details": "Show Details",
|
||||
"Transports": "Transports",
|
||||
"Two-Factor Authentication": "Two-Factor Authentication",
|
||||
"Usage Count": "Usage Count",
|
||||
"Webauthn Credential Identifier": "Credential Identifier: {{id}}",
|
||||
"Webauthn Public Key": "Public Key: {{key}}",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React, { ReactNode, useCallback, useEffect } from "react";
|
||||
|
||||
import { Dashboard } from "@mui/icons-material";
|
||||
import SystemSecurityUpdateGoodIcon from "@mui/icons-material/SystemSecurityUpdateGood";
|
||||
import {
|
||||
AppBar,
|
||||
|
@ -68,9 +69,10 @@ const SettingsLayout = function (props: Props) {
|
|||
<Toolbar variant="dense" />
|
||||
<Box sx={{ overflow: "auto" }}>
|
||||
<List>
|
||||
<SettingsMenuItem pathname={SettingsRoute} text={translate("Overview")} icon={<Dashboard />} />
|
||||
<SettingsMenuItem
|
||||
pathname={`${SettingsRoute}${SettingsTwoFactorAuthenticationSubRoute}`}
|
||||
text={translate("Security Keys")}
|
||||
text={translate("Two-Factor Authentication")}
|
||||
icon={<SystemSecurityUpdateGoodIcon />}
|
||||
/>
|
||||
</List>
|
||||
|
@ -97,7 +99,7 @@ interface SettingsMenuItemProps {
|
|||
}
|
||||
|
||||
const SettingsMenuItem = function (props: SettingsMenuItemProps) {
|
||||
const selected = window.location.pathname === props.pathname;
|
||||
const selected = window.location.pathname === props.pathname || window.location.pathname === props.pathname + "/";
|
||||
const navigate = useRouterNavigate();
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue