From 884a6cfeb2a019d1029b59debbebacabab645b73 Mon Sep 17 00:00:00 2001 From: Maksym Date: Thu, 8 Feb 2024 11:05:36 +0200 Subject: [PATCH] Replace profiles page with dashboard (#40) --- src/assets/icons/house-icon.svg | 3 +++ src/common/AppNavbar.tsx | 9 +++------ src/enums/icons.ts | 9 +++++---- src/enums/routes.ts | 3 ++- src/pages/Dashboard.tsx | 5 +++++ src/pages/Profiles.tsx | 9 --------- src/routes.tsx | 8 ++++---- 7 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 src/assets/icons/house-icon.svg create mode 100644 src/pages/Dashboard.tsx delete mode 100644 src/pages/Profiles.tsx diff --git a/src/assets/icons/house-icon.svg b/src/assets/icons/house-icon.svg new file mode 100644 index 00000000..3525ed07 --- /dev/null +++ b/src/assets/icons/house-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/common/AppNavbar.tsx b/src/common/AppNavbar.tsx index bca39823..2a084c27 100644 --- a/src/common/AppNavbar.tsx +++ b/src/common/AppNavbar.tsx @@ -19,9 +19,7 @@ const NavbarLink = ({ children, to }: NavbarLinkProps) => { const { palette, spacing } = useTheme() const isRouteActive = useMemo(() => { - const locationRoot = location.pathname.split('/')[1] - - return to.split('/').includes(locationRoot) + return location.pathname.startsWith(to) }, [location.pathname, to]) return ( @@ -54,12 +52,11 @@ const AppNavbar = () => { const navbarItems = useMemo( () => [ - { route: RoutePaths.Profiles, iconComponent: }, + { route: RoutePaths.Dashboard, iconComponent: }, { route: RoutePaths.Credentials, iconComponent: , }, - { route: RoutePaths.UiKit, iconComponent: }, ], [], ) @@ -78,7 +75,7 @@ const AppNavbar = () => { borderColor={palette.divider} > - + diff --git a/src/enums/icons.ts b/src/enums/icons.ts index 2a5fa647..30c2c27c 100644 --- a/src/enums/icons.ts +++ b/src/enums/icons.ts @@ -30,13 +30,14 @@ import WarningAmberIcon from '@mui/icons-material/WarningAmber' import Work from '@mui/icons-material/Work' export enum Icons { - Metamask = 'metamask', - User = 'user', - Wallet = 'wallet', Facebook = 'facebook', + House = 'house', Instagram = 'instagram', - Twitter = 'twitter', + Metamask = 'metamask', Rarime = 'rarime', + Twitter = 'twitter', + User = 'user', + Wallet = 'wallet', } export const ICON_COMPONENTS = { diff --git a/src/enums/routes.ts b/src/enums/routes.ts index a0d3b826..fd122f72 100644 --- a/src/enums/routes.ts +++ b/src/enums/routes.ts @@ -1,9 +1,10 @@ export enum RoutePaths { Root = '/', UiKit = '/ui-kit', - Profiles = '/profiles', SignIn = '/sign-in', + Dashboard = '/dashboard', + Orgs = '/organisations', OrgsList = '/organisations/list', OrgsListAll = '/organisations/list/all', diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx new file mode 100644 index 00000000..2efa9299 --- /dev/null +++ b/src/pages/Dashboard.tsx @@ -0,0 +1,5 @@ +import { PageTitles } from '@/common' + +export default function Dashboard() { + return +} diff --git a/src/pages/Profiles.tsx b/src/pages/Profiles.tsx deleted file mode 100644 index 545fa0ca..00000000 --- a/src/pages/Profiles.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { PageTitles } from '@/common' - -export default function Profiles() { - return ( - <> - - - ) -} diff --git a/src/routes.tsx b/src/routes.tsx index a901aec4..bc649c16 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -18,7 +18,7 @@ import PublicLayout from './layouts/PublicLayout' export const AppRoutes = () => { const SignIn = lazy(() => import('@/pages/SignIn')) const Credentials = lazy(() => import('@/pages/Credentials')) - const Profiles = lazy(() => import('@/pages/Profiles')) + const Dashboard = lazy(() => import('@/pages/Dashboard')) const UiKit = lazy(() => import('@/pages/UiKit')) const VerifyProofAlias = lazy(() => import('@/pages/VerifyProofAlias')) const AcceptInvitation = lazy(() => import('@/pages/AcceptInvitation')) @@ -70,9 +70,9 @@ export const AppRoutes = () => { ), children: [ { - path: createDeepPath(RoutePaths.Profiles), + path: createDeepPath(RoutePaths.Dashboard), loader: authProtectedGuard, - element: , + element: , }, { path: createDeepPath(RoutePaths.Orgs), @@ -103,7 +103,7 @@ export const AppRoutes = () => { }, { path: RoutePaths.Root, - element: , + element: , }, { path: '*',