diff --git a/app/components/NavItem.tsx b/app/components/NavItem.tsx index 7f4755c..1cab969 100644 --- a/app/components/NavItem.tsx +++ b/app/components/NavItem.tsx @@ -1,4 +1,6 @@ +'use client' import Link from "next/link"; +import { usePathname } from "next/navigation"; export default function NavItem({ children, @@ -7,7 +9,8 @@ export default function NavItem({ children: React.ReactNode; href: string; }>) { - return + const highlighted = usePathname() === href; + return {children} } \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index 7c4987a..9425a8a 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -5,6 +5,7 @@ import NavItem from "./components/NavItem"; import Header from "./components/Header"; import Image from "next/image"; import logo from "./logo.png" +import Link from "next/link"; export const metadata: Metadata = { title: "Portfolio - Mike Karl", @@ -20,13 +21,14 @@ export default function RootLayout({