Routing
1. How to add a new route?
// ----------------------------------------------------
// File: src/routes/Router.tsx
// ----------------------------------------------------
const ModernDash = Loadable(lazy(() => import('../views/dashboard/Modern')));
const EcommerceDash = Loadable(lazy(() => import('../views/dashboard/Ecommerce')));
const Router = [
{
path: "/",
element: <FullLayout />,
children: [
{ path: "/", element: <Navigate to="dashboards/modern" /> },
{ path: "dashboards/modern", exact: true, element: <ModernDash /> },
{ path: "dashboards/ecommerce", exact: true, element: <EcommerceDash /> },
]
}
]
2. How to add page to sidebar ?
// ------------------------------------------------------------------------
// File: src/layouts/full/vertical/sidebar/Sidebaritems.ts
// ------------------------------------------------------------------------
const SidebarContent: MenuItem[] = [
{
id: 1,
name: "Dashboard",
items: [
{
heading: "Dashboards",
children: [
{
name: "Dashboard1",
icon: "solar:atom-line-duotone",
id: uniqueId(),
url: "/",
},
{
name: "Dashboard2",
icon: "solar:chart-line-duotone",
id: uniqueId(),
url: "/dashboards/dashboard2",
},
{
name: "Dashboard3",
icon: "solar:screencast-2-line-duotone",
id: uniqueId(),
url: "/dashboards/dashboard3",
},
],
},
}
]