From c1a9475a89bb07ec522a95fede276d09eafd0813 Mon Sep 17 00:00:00 2001 From: en Date: Mon, 10 Mar 2025 11:57:08 +0000 Subject: [PATCH] refactor(settings): update settings layout --- src/pages/settings/Settings.tsx | 131 ++++++----- src/pages/settings/nostrLogin/index.tsx | 62 ++---- src/pages/settings/profile/index.tsx | 217 +++++++++---------- src/pages/settings/profile/style.module.scss | 6 - src/pages/settings/relays/index.tsx | 7 +- src/pages/settings/relays/style.module.scss | 170 +++++++-------- src/pages/settings/style.module.scss | 43 ++++ src/routes/util.tsx | 44 ++-- 8 files changed, 325 insertions(+), 355 deletions(-) create mode 100644 src/pages/settings/style.module.scss diff --git a/src/pages/settings/Settings.tsx b/src/pages/settings/Settings.tsx index 1382bc1..f00eab4 100644 --- a/src/pages/settings/Settings.tsx +++ b/src/pages/settings/Settings.tsx @@ -1,87 +1,82 @@ import AccountCircleIcon from '@mui/icons-material/AccountCircle' -import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos' import RouterIcon from '@mui/icons-material/Router' -import { ListItem, useTheme } from '@mui/material' -import List from '@mui/material/List' -import ListItemIcon from '@mui/material/ListItemIcon' -import ListItemText from '@mui/material/ListItemText' -import ListSubheader from '@mui/material/ListSubheader' +import { Button } from '@mui/material' import { useAppSelector } from '../../hooks/store' -import { Link } from 'react-router-dom' +import { NavLink, Outlet, To } from 'react-router-dom' import { appPrivateRoutes, getProfileSettingsRoute } from '../../routes' import { Container } from '../../components/Container' import { Footer } from '../../components/Footer/Footer' import ExtensionIcon from '@mui/icons-material/Extension' import { LoginMethod } from '../../store/auth/types' +import styles from './style.module.scss' +import { ReactNode } from 'react' -export const SettingsPage = () => { - const theme = useTheme() - const { usersPubkey, loginMethod } = useAppSelector((state) => state.auth) - const listItem = (label: string, disabled = false) => { - return ( - <> - { + return ( + + {({ isActive }) => ( + + )} + + ) +} - {!disabled && ( - - )} - - ) - } +export const SettingsLayout = () => { + const { usersPubkey, loginMethod } = useAppSelector((state) => state.auth) return ( <> - - Settings - - } - > - - - - - {listItem('Profile')} - - - - - - {listItem('Relays')} - - {loginMethod === LoginMethod.nostrLogin && ( - - - - - {listItem('Nostr Login')} - - )} - +

Settings

+
+
+ +
+
+ +
+