From 973605f54141a07a853c72d6a26c335d0713c8f2 Mon Sep 17 00:00:00 2001 From: Owen Schwartz Date: Sun, 13 Oct 2024 23:42:09 -0400 Subject: [PATCH] Fix nav --- src/app/[orgId]/sites/[siteId]/layout.tsx | 2 +- src/components/sidebar-nav.tsx | 76 ++++++++++++----------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/src/app/[orgId]/sites/[siteId]/layout.tsx b/src/app/[orgId]/sites/[siteId]/layout.tsx index dae1a54..e161b9a 100644 --- a/src/app/[orgId]/sites/[siteId]/layout.tsx +++ b/src/app/[orgId]/sites/[siteId]/layout.tsx @@ -84,7 +84,7 @@ export default async function SettingsLayout({ children, params }: SettingsLayou
diff --git a/src/components/sidebar-nav.tsx b/src/components/sidebar-nav.tsx index abfbbe0..bd8d466 100644 --- a/src/components/sidebar-nav.tsx +++ b/src/components/sidebar-nav.tsx @@ -1,49 +1,53 @@ "use client" import React from 'react' import Link from "next/link" -import { usePathname } from "next/navigation" +import { useParams, usePathname, useRouter } from "next/navigation" import { cn } from "@/lib/utils" import { buttonVariants } from "@/components/ui/button" interface SidebarNavProps extends React.HTMLAttributes { - items: { - href: string - title: string - }[] - disabled?: boolean + items: { + href: string + title: string + }[] + disabled?: boolean } export function SidebarNav({ className, items, disabled = false, ...props }: SidebarNavProps) { - const pathname = usePathname() + const pathname = usePathname(); + const params = useParams(); + const orgId = params.orgId as string; + const siteId = params.siteId as string; + const resourceId = params.resourceId as string; - return ( - + ) } \ No newline at end of file