feat(MED-97): fix /home/[account] and /admin* routes layout consistencies
This commit is contained in:
33
packages/shared/src/config/admin-navigation.config.tsx
Normal file
33
packages/shared/src/config/admin-navigation.config.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { LayoutDashboard, Users } from 'lucide-react';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { pathsConfig } from '@kit/shared/config';
|
||||
import { NavigationConfigSchema } from '@kit/ui/navigation-schema';
|
||||
|
||||
const iconClasses = 'w-4 stroke-[1.5px]';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
children: [
|
||||
{
|
||||
label: 'Dashboard',
|
||||
path: pathsConfig.app.admin,
|
||||
Icon: <LayoutDashboard className={iconClasses} />,
|
||||
end: true,
|
||||
},
|
||||
{
|
||||
label: 'Accounts',
|
||||
path: `${pathsConfig.app.admin}/accounts`,
|
||||
Icon: <Users className={iconClasses} />,
|
||||
end: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
] satisfies z.infer<typeof NavigationConfigSchema>['routes'];
|
||||
|
||||
export const adminNavigationConfig = NavigationConfigSchema.parse({
|
||||
routes,
|
||||
style: 'custom',
|
||||
sidebarCollapsed: false,
|
||||
sidebarCollapsedStyle: 'icon',
|
||||
});
|
||||
@@ -1,6 +1,7 @@
|
||||
import appConfig from './app.config';
|
||||
import authConfig from './auth.config';
|
||||
import billingConfig from './billing.config';
|
||||
import { adminNavigationConfig } from './admin-navigation.config';
|
||||
import {
|
||||
DynamicAuthConfig,
|
||||
getCachedAuthConfig,
|
||||
@@ -15,6 +16,7 @@ import {
|
||||
} from './team-account-navigation.config';
|
||||
|
||||
export {
|
||||
adminNavigationConfig,
|
||||
appConfig,
|
||||
authConfig,
|
||||
billingConfig,
|
||||
|
||||
@@ -7,7 +7,6 @@ const iconClasses = 'w-4';
|
||||
|
||||
const getRoutes = (account: string) => [
|
||||
{
|
||||
label: 'common:routes.application',
|
||||
children: [
|
||||
{
|
||||
label: 'common:routes.dashboard',
|
||||
@@ -15,12 +14,6 @@ const getRoutes = (account: string) => [
|
||||
Icon: <LayoutDashboard className={iconClasses} />,
|
||||
end: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'common:routes.settings',
|
||||
collapsible: false,
|
||||
children: [
|
||||
{
|
||||
label: 'common:routes.settings',
|
||||
path: createPath(pathsConfig.app.accountSettings, account),
|
||||
|
||||
Reference in New Issue
Block a user