|
|
@@ -4,33 +4,33 @@ import { useState } from "react";
|
|
|
import Image from "next/image";
|
|
|
import Link from "next/link";
|
|
|
import type { TreefrontMenu } from "@/types/theme/menus";
|
|
|
-interface MenuEdge {
|
|
|
- node: MenuItem;
|
|
|
-}
|
|
|
+// interface MenuEdge {
|
|
|
+// node: MenuItem;
|
|
|
+// }
|
|
|
|
|
|
-interface MenuChildren {
|
|
|
- edges: MenuEdge[];
|
|
|
-}
|
|
|
+// interface MenuChildren {
|
|
|
+// edges: MenuEdge[];
|
|
|
+// }
|
|
|
|
|
|
-export interface MenuItem {
|
|
|
- _id: number;
|
|
|
- name: string;
|
|
|
- slug: string;
|
|
|
- url: string;
|
|
|
+// export interface MenuItem {
|
|
|
+// _id: number;
|
|
|
+// name: string;
|
|
|
+// slug: string;
|
|
|
+// url: string;
|
|
|
|
|
|
- showIcon?: boolean;
|
|
|
+// showIcon?: boolean;
|
|
|
|
|
|
- image?: string;
|
|
|
- wapImage?: string;
|
|
|
+// image?: string;
|
|
|
+// wapImage?: string;
|
|
|
|
|
|
- banner?: string;
|
|
|
- wapBanner?: string;
|
|
|
+// banner?: string;
|
|
|
+// wapBanner?: string;
|
|
|
|
|
|
- sortOrder: number;
|
|
|
- status: boolean;
|
|
|
+// sortOrder: number;
|
|
|
+// status: boolean;
|
|
|
|
|
|
- children?: MenuChildren;
|
|
|
-}
|
|
|
+// children?: MenuChildren;
|
|
|
+// }
|
|
|
|
|
|
interface DesktopNavigationProps {
|
|
|
menus:TreefrontMenu[];
|
|
|
@@ -50,7 +50,7 @@ const getMenuUrl = (url?: string) => {
|
|
|
return `/${url}`;
|
|
|
};
|
|
|
|
|
|
-const getChildren = (menu?: MenuItem) => {
|
|
|
+const getChildren = (menu?: TreefrontMenu) => {
|
|
|
if (!menu?.children?.edges) {
|
|
|
return [];
|
|
|
}
|
|
|
@@ -66,7 +66,7 @@ export default function DesktopNavigation({
|
|
|
menus,
|
|
|
}: DesktopNavigationProps) {
|
|
|
const [activeMenu, setActiveMenu] =
|
|
|
- useState<MenuItem | null>(null);
|
|
|
+ useState<TreefrontMenu | null>(null);
|
|
|
|
|
|
const topMenus = menus
|
|
|
.filter((item) => item.status)
|