diff --git a/src/components/AppBar/AppBar.tsx b/src/components/AppBar/AppBar.tsx index 68b04dd..e1c2220 100644 --- a/src/components/AppBar/AppBar.tsx +++ b/src/components/AppBar/AppBar.tsx @@ -181,7 +181,7 @@ export const AppBar = () => { onClick={() => { setAnchorElUser(null) - navigate(appPrivateRoutes.settings) + navigate(appPrivateRoutes.profileSettings) }} sx={{ justifyContent: 'center' diff --git a/src/pages/profile/index.tsx b/src/pages/profile/index.tsx index 8e1e8c0..e5b29f6 100644 --- a/src/pages/profile/index.tsx +++ b/src/pages/profile/index.tsx @@ -13,7 +13,7 @@ import { Footer } from '../../components/Footer/Footer' import { LoadingSpinner } from '../../components/LoadingSpinner' import { useAppSelector } from '../../hooks/store' -import { getProfileSettingsRoute } from '../../routes' +import { appPrivateRoutes } from '../../routes' import { getProfileUsername, @@ -168,7 +168,7 @@ export const ProfilePage = () => { {isUsersOwnProfile && ( navigate(getProfileSettingsRoute(pubkey))} + onClick={() => navigate(appPrivateRoutes.profileSettings)} > diff --git a/src/pages/settings/Settings.tsx b/src/pages/settings/Settings.tsx index f00eab4..4bd9735 100644 --- a/src/pages/settings/Settings.tsx +++ b/src/pages/settings/Settings.tsx @@ -3,7 +3,7 @@ import RouterIcon from '@mui/icons-material/Router' import { Button } from '@mui/material' import { useAppSelector } from '../../hooks/store' import { NavLink, Outlet, To } from 'react-router-dom' -import { appPrivateRoutes, getProfileSettingsRoute } from '../../routes' +import { appPrivateRoutes } from '../../routes' import { Container } from '../../components/Container' import { Footer } from '../../components/Footer/Footer' import ExtensionIcon from '@mui/icons-material/Extension' @@ -50,7 +50,7 @@ const Item = (to: To, icon: ReactNode, label: string) => { } export const SettingsLayout = () => { - const { usersPubkey, loginMethod } = useAppSelector((state) => state.auth) + const { loginMethod } = useAppSelector((state) => state.auth) return ( <> @@ -60,7 +60,7 @@ export const SettingsLayout = () => {
)} - {isUsersOwnProfile && ( - - PUBLISH CHANGES - - )} + + PUBLISH CHANGES + ) } diff --git a/src/routes/index.tsx b/src/routes/index.tsx index f514e78..f1bd004 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -4,8 +4,7 @@ export const appPrivateRoutes = { homePage: '/', create: '/create', sign: '/sign', - settings: '/settings', - profileSettings: '/settings/profile/:npub', + profileSettings: '/settings/profile', relays: '/settings/relays', nostrLogin: '/settings/nostrLogin' } @@ -23,6 +22,3 @@ export const appPublicRoutes = { export const getProfileRoute = (hexKey: string) => appPublicRoutes.profile.replace(':npub', hexToNpub(hexKey)) - -export const getProfileSettingsRoute = (hexKey: string) => - appPrivateRoutes.profileSettings.replace(':npub', hexToNpub(hexKey)) diff --git a/src/routes/util.tsx b/src/routes/util.tsx index 99fe70f..e0356dd 100644 --- a/src/routes/util.tsx +++ b/src/routes/util.tsx @@ -37,7 +37,7 @@ export function recursiveRouteRenderer( return routes.map((route, index) => renderConditionCallbackFn(route) ? ( @@ -67,7 +67,7 @@ export const publicRoutes: PublicRouteProps[] = [ } ] -export const privateRoutes = [ +export const privateRoutes: CustomRouteProps[] = [ { path: appPrivateRoutes.homePage, element: ( @@ -93,7 +93,6 @@ export const privateRoutes = [ ) }, { - path: appPrivateRoutes.settings, element: (