This commit is contained in:
+23
-30
@@ -24,6 +24,7 @@ export type RootNavItem = {
|
||||
href: string;
|
||||
icon: LucideIcon;
|
||||
active?: boolean;
|
||||
expanded?: boolean;
|
||||
children?: RootNavItem[];
|
||||
};
|
||||
|
||||
@@ -67,36 +68,28 @@ export function getRootNavigation(
|
||||
label: copy.portfolio,
|
||||
href: "/root/portfolio",
|
||||
icon: FolderKanban,
|
||||
active: active === "portfolio",
|
||||
children:
|
||||
active === "portfolio"
|
||||
? [
|
||||
{
|
||||
label: "Overview",
|
||||
href: "/root/portfolio",
|
||||
icon: LayoutDashboard,
|
||||
active: portfolioChild === "overview",
|
||||
},
|
||||
{
|
||||
label: "Add Project",
|
||||
href: "/root/portfolio/projects/new",
|
||||
icon: PlusSquare,
|
||||
active: portfolioChild === "new-project",
|
||||
},
|
||||
{
|
||||
label: "Add Category",
|
||||
href: "/root/portfolio/categories",
|
||||
icon: Tags,
|
||||
active: portfolioChild === "categories",
|
||||
},
|
||||
{
|
||||
label: "Projects",
|
||||
href: "/root/portfolio/projects",
|
||||
icon: FolderKanban,
|
||||
active: portfolioChild === "projects",
|
||||
},
|
||||
].filter((item, index, array) => array.findIndex((entry) => entry.href === item.href) === index)
|
||||
: undefined,
|
||||
active: active === "portfolio" && !portfolioChild,
|
||||
expanded: active === "portfolio",
|
||||
children: [
|
||||
{
|
||||
label: "Overview",
|
||||
href: "/root/portfolio",
|
||||
icon: LayoutDashboard,
|
||||
active: portfolioChild === "overview",
|
||||
},
|
||||
{
|
||||
label: "Add Project",
|
||||
href: "/root/portfolio/projects/new",
|
||||
icon: PlusSquare,
|
||||
active: portfolioChild === "new-project",
|
||||
},
|
||||
{
|
||||
label: "Add Category",
|
||||
href: "/root/portfolio/categories",
|
||||
icon: Tags,
|
||||
active: portfolioChild === "categories",
|
||||
},
|
||||
].filter((item, index, array) => array.findIndex((entry) => entry.href === item.href) === index),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user