From 05c06a56f7c240a2a3384e8e4493fa1a6d8728a0 Mon Sep 17 00:00:00 2001 From: Githan Mayurathan Date: Thu, 9 Apr 2026 17:35:36 +0200 Subject: [PATCH] =?UTF-8?q?lagt=20til=20ny=20meny=20for=20mobil,=20og=20en?= =?UTF-8?q?dra=20utseende=20p=C3=A5=20navbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/nav.tsx | 106 +++++++++++++++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 15 deletions(-) diff --git a/app/components/nav.tsx b/app/components/nav.tsx index c8fd10d..1ad53e4 100644 --- a/app/components/nav.tsx +++ b/app/components/nav.tsx @@ -1,24 +1,100 @@ -import { Link } from "react-router"; +import { useLocation, Link } from "react-router"; import { ConsultingLogo } from "./icons/consulting-logo"; +import { useState, useEffect } from "react"; +import { Menu, X } from "lucide-react"; export function Nav() { + const [open, setOpen] = useState(false); + const location = useLocation(); + + useEffect(() => { + const handleResize = () => { + if (window.innerWidth >= 768) setOpen(false); + }; + window.addEventListener("resize", handleResize); + return () => window.removeEventListener("resize", handleResize); + }, []); + + const isActive = (path: string) => location.pathname === path; + + const navLinks = [ + { name: "Hjem", path: "/", mobileOnly: true }, + { name: "Tjenester", path: "/tjenester" }, + { name: "Prosjekter", path: "/prosjekter" }, + { name: "Om oss", path: "/om-oss" }, + ]; + return ( -