import {List, ListItem} from '@common/ui/list/list'; import {PersonIcon} from '@common/icons/material/Person'; import {Trans} from '@common/i18n/trans'; import {LoginIcon} from '@common/icons/material/Login'; import {LockIcon} from '@common/icons/material/Lock'; import {PhonelinkLockIcon} from '@common/icons/material/PhonelinkLock'; import {LanguageIcon} from '@common/icons/material/Language'; import {ApiIcon} from '@common/icons/material/Api'; import {DangerousIcon} from '@common/icons/material/Dangerous'; import {ReactNode, useContext} from 'react'; import {DevicesIcon} from '@common/icons/material/Devices'; import {useAuth} from '@common/auth/use-auth'; import {useSettings} from '@common/core/settings/use-settings'; import {SiteConfigContext} from '@common/core/settings/site-config-context'; export enum AccountSettingsId { AccountDetails = 'account-details', SocialLogin = 'social-login', Password = 'password', TwoFactor = 'two-factor', LocationAndLanguage = 'location-and-language', Developers = 'developers', DeleteAccount = 'delete-account', Sessions = 'sessions', } export function AccountSettingsSidenav() { const p = AccountSettingsId; const {hasPermission} = useAuth(); const {api, social} = useSettings(); const {auth} = useContext(SiteConfigContext); const socialEnabled = social?.envato || social?.google || social?.facebook || social?.twitter; return ( ); } interface ItemProps { children: ReactNode; icon: ReactNode; isLast?: boolean; panel: AccountSettingsId; } function Item({children, icon, isLast, panel}: ItemProps) { return ( { const panelEl = document.querySelector(`#${panel}`); if (panelEl) { panelEl.scrollIntoView({ behavior: 'smooth', block: 'start', }); } }} > {children} ); }