diff --git a/src/assets/ChevronUpIcon.tsx b/src/assets/ChevronUpIcon.tsx deleted file mode 100644 index 439699e..0000000 --- a/src/assets/ChevronUpIcon.tsx +++ /dev/null @@ -1,18 +0,0 @@ -export default function ChevronUpIcon(props: React.SVGProps) { - return ( - - - - ); -} diff --git a/src/components/SideNavigation/sideNavItems.tsx b/src/components/SideNavigation/sideNavItems.tsx index 07c35b5..f19bb19 100644 --- a/src/components/SideNavigation/sideNavItems.tsx +++ b/src/components/SideNavigation/sideNavItems.tsx @@ -1,5 +1,4 @@ import DownArrow from "@/assets/ChevronDownIcon"; -import UpArrow from "@/assets/ChevronUpIcon"; import { PermissionProtector } from "@/components/PermissionProtector"; import RouteElement from "@/types/routeElement"; import { useEffect, useState } from "react"; @@ -44,10 +43,10 @@ function SidebarItem({ return null; } - if (items.children) { + if (items.submenu) { return ( -
+
- {is_expanded ? : } +
{isSidebarOpen && is_expanded ? (
- {items.children.map((item, index) => ( + {items.submenu.map((item, index) => (
, permission: [Permission.ReadBlog], - children: [ + submenu: [ { path: "new-story/", element: , @@ -117,7 +117,7 @@ const routeMap: CustomRouteElement[] = [ ), - children: [ + submenu: [ { path: "new-edition/", element: , @@ -149,7 +149,7 @@ const routeMap: CustomRouteElement[] = [ ), - children: [ + submenu: [ { path: "all-roles/", element: , @@ -180,7 +180,7 @@ const routeMap: CustomRouteElement[] = [ permission: [], label: "Member", icon: , - children: [ + submenu: [ { path: "all-members/", element: , @@ -240,8 +240,8 @@ const routeMap: CustomRouteElement[] = [ const make_protected = (routes: CustomRouteElement[]) => { return routes.map((route) => { - if (route.children) { - route.children = make_protected(route.children); + if (route.submenu) { + route.children = make_protected(route.submenu); } else { route.element = ( diff --git a/src/types/routeElement.ts b/src/types/routeElement.ts index 663c830..de3b24d 100644 --- a/src/types/routeElement.ts +++ b/src/types/routeElement.ts @@ -6,7 +6,7 @@ interface RouteElement extends NonIndexRouteObject { label: string; icon?: React.SVGProps; hide?: true; - children?: RouteElement[]; + submenu?: RouteElement[]; } export default RouteElement;