From 76d239df7b1ea29b3ca6f9edd1fd6495b8f8a92a Mon Sep 17 00:00:00 2001 From: Chneemann Date: Fri, 14 Aug 2026 11:54:42 +0200 Subject: [PATCH] fix(nav): correctly highlight "Add Task" active state on task creation and edit routes --- app/components/layout/Navbar.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/layout/Navbar.tsx b/app/components/layout/Navbar.tsx index 39ee62a..92e4842 100644 --- a/app/components/layout/Navbar.tsx +++ b/app/components/layout/Navbar.tsx @@ -18,7 +18,7 @@ const fetcher = (url: string) => fetch(url).then((res) => res.json()); const navItems = [ { name: "Summary", href: "/summary", icon: FileText }, { name: "Dashboard", href: "/dashboard", icon: LayoutDashboard }, - { name: "Add Task", href: "/tasks?task=new", icon: FilePenLine }, + { name: "Add Task", href: "/tasks", icon: FilePenLine }, { name: "Trash", href: "/trash", icon: Trash2 }, ]; @@ -38,7 +38,7 @@ export default function Navbar() { const trashCount = data?.count || 0; - // Shared function to render navigation links to avoid code duplication + // Shared function to render navigation links const renderNavLinks = (isMobile = false) => navItems.map((item) => { const Icon = item.icon; @@ -50,13 +50,13 @@ export default function Navbar() { return (