Skip to content

Commit

Permalink
Replace profiles page with dashboard (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardier16 authored Feb 8, 2024
1 parent 87e2985 commit 884a6cf
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 24 deletions.
3 changes: 3 additions & 0 deletions src/assets/icons/house-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions src/common/AppNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -54,12 +52,11 @@ const AppNavbar = () => {

const navbarItems = useMemo(
() => [
{ route: RoutePaths.Profiles, iconComponent: <UiIcon name={Icons.Wallet} size={5} /> },
{ route: RoutePaths.Dashboard, iconComponent: <UiIcon name={Icons.House} size={5} /> },
{
route: RoutePaths.Credentials,
iconComponent: <UiIcon componentName={'layers'} size={6} />,
},
{ route: RoutePaths.UiKit, iconComponent: <UiIcon componentName={'info'} size={5} /> },
],
[],
)
Expand All @@ -78,7 +75,7 @@ const AppNavbar = () => {
borderColor={palette.divider}
>
<Stack spacing={4}>
<Stack component={NavLink} to={RoutePaths.Profiles} alignItems={'center'}>
<Stack component={NavLink} to={RoutePaths.Dashboard} alignItems={'center'}>
<UiIcon name={Icons.Rarime} size={10} sx={{ color: palette.text.primary }} />
</Stack>
<Divider />
Expand Down
9 changes: 5 additions & 4 deletions src/enums/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion src/enums/routes.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
5 changes: 5 additions & 0 deletions src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PageTitles } from '@/common'

export default function Dashboard() {
return <PageTitles title={'Dashboard'} />
}
9 changes: 0 additions & 9 deletions src/pages/Profiles.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -70,9 +70,9 @@ export const AppRoutes = () => {
),
children: [
{
path: createDeepPath(RoutePaths.Profiles),
path: createDeepPath(RoutePaths.Dashboard),
loader: authProtectedGuard,
element: <Profiles />,
element: <Dashboard />,
},
{
path: createDeepPath(RoutePaths.Orgs),
Expand Down Expand Up @@ -103,7 +103,7 @@ export const AppRoutes = () => {
},
{
path: RoutePaths.Root,
element: <Navigate replace to={RoutePaths.Profiles} />,
element: <Navigate replace to={RoutePaths.Dashboard} />,
},
{
path: '*',
Expand Down

0 comments on commit 884a6cf

Please sign in to comment.