diff --git a/eslint.config.mjs b/eslint.config.mjs index 28e82c0..3abf475 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,7 +4,6 @@ import tseslint from "typescript-eslint"; import react from "eslint-plugin-react"; import prettier from "eslint-plugin-prettier/recommended"; import query from "@tanstack/eslint-plugin-query"; -import reactHooks from "eslint-plugin-react-hooks"; export default [ { @@ -24,12 +23,15 @@ export default [ prettier: prettier, "@typescript-eslint": tseslint.plugin, "@tanstack/query": query, - "react-hooks": reactHooks, }, }, { rules: { "react/react-in-jsx-scope": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { argsIgnorePattern: "^_" }, + ], "@typescript-eslint/no-unused-expressions": [ "error", { allowShortCircuit: true, allowTernary: true }, diff --git a/src/app/director/[program]/applications/page.tsx b/src/app/director/[program]/application/page.tsx similarity index 100% rename from src/app/director/[program]/applications/page.tsx rename to src/app/director/[program]/application/page.tsx diff --git a/src/app/director/layout.tsx b/src/app/director/layout.tsx index 969c15d..1c93a8e 100644 --- a/src/app/director/layout.tsx +++ b/src/app/director/layout.tsx @@ -1,3 +1,5 @@ +"use client"; + import Navigation from "@/components/global/navigation/side"; import { links } from "@/data/director/navigation"; @@ -7,7 +9,7 @@ type LayoutProps = { const Layout = ({ children }: LayoutProps) => { return ( -
+
{children}
diff --git a/src/components/global/navigation/side.tsx b/src/components/global/navigation/side.tsx index 010f3cb..fc460ff 100644 --- a/src/components/global/navigation/side.tsx +++ b/src/components/global/navigation/side.tsx @@ -1,10 +1,13 @@ +"use client"; + +import { usePathname } from "next/navigation"; import Image from "next/image"; import Link from "next/link"; import Logo from "@/public/logo.webp"; interface link { name: string; - link: string; + link: string | ((_program: string, _uid: string) => string); } interface props { @@ -12,12 +15,27 @@ interface props { } const SideNav = ({ links }: props) => { + const pathname = usePathname(); + const segments = pathname.split("/"); + const staticRoutePattern = /^(leads|contacts)$/; + const isStaticRoute = staticRoutePattern.test(segments[2]); + const navigation = links.map(({ name, link }) => { + const resolvedLink = + typeof link === "function" + ? link( + isStaticRoute ? "Ignite" : segments[2] || "Ignite", + segments[4] || "guest", + ) + : link; + + return { name, link: resolvedLink }; + }); + return (