From d95a018c4336c951115f985e37841f682b488707 Mon Sep 17 00:00:00 2001 From: Mickael Sermont Date: Sat, 16 Sep 2023 21:31:01 +0200 Subject: [PATCH] fix: types for sheet nav --- src/components/layout/sheet-mobile-nav.tsx | 1 + src/components/main-navigation-menu.tsx | 10 +--------- src/types/index.d.ts | 4 ++-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/layout/sheet-mobile-nav.tsx b/src/components/layout/sheet-mobile-nav.tsx index 9718ea75..6eda0348 100644 --- a/src/components/layout/sheet-mobile-nav.tsx +++ b/src/components/layout/sheet-mobile-nav.tsx @@ -80,6 +80,7 @@ export function SheetMobileNav() { {subItem.href ? ( {subItem.title} diff --git a/src/components/main-navigation-menu.tsx b/src/components/main-navigation-menu.tsx index 18a94494..5655900c 100644 --- a/src/components/main-navigation-menu.tsx +++ b/src/components/main-navigation-menu.tsx @@ -12,15 +12,7 @@ import { } from "@/components/ui/navigation-menu"; import { Badge } from "@/components/ui/badge"; import { navMenuConfig } from "@/config/nav-menu"; - -type MenuItem = { - title: string; - href: string; - description: string; - launched?: boolean; - disabled?: boolean; - external?: boolean; -}; +import type { MenuItem } from "@/types"; const infos = navMenuConfig.infosNav[0]; const examples = navMenuConfig.examplesNav[0]; diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 7852351a..0a66208c 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -6,7 +6,7 @@ export type NavItem = { disabled?: boolean; }; export type MenuItem = NavItem & { - description: string; + description?: string; launched?: boolean; external?: boolean; }; @@ -24,7 +24,7 @@ export type SidebarNavItem = { } | { href?: string; - items: NavLink[]; + items: MenuItem[]; } );