From 95ee968f3912c353e22f8b8fa882c34ed069bffc Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Sun, 26 Apr 2026 16:56:04 +0200 Subject: [PATCH] feat(ST-359): add Solo nav link between Producten and Todos - Active on /solo and /products/[id]/solo; Producten inactive when on solo pages - Refactored navLinks to carry explicit active boolean for custom path matching Co-Authored-By: Claude Sonnet 4.6 --- components/shared/nav-bar.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/shared/nav-bar.tsx b/components/shared/nav-bar.tsx index 10514e9..e6db444 100644 --- a/components/shared/nav-bar.tsx +++ b/components/shared/nav-bar.tsx @@ -26,8 +26,9 @@ export function NavBar({ isDemo, roles }: NavBarProps) { const productId = productMatch ? productMatch[1] : null const navLinks = [ - { href: '/dashboard', label: 'Producten' }, - { href: '/todos', label: "Todo's" }, + { href: '/dashboard', label: 'Producten', active: pathname.startsWith('/dashboard') || pathname.startsWith('/products') && !pathname.includes('/solo') }, + { href: '/solo', label: 'Solo', active: pathname.includes('/solo') }, + { href: '/todos', label: "Todo's", active: pathname.startsWith('/todos') }, ] return ( @@ -51,7 +52,7 @@ export function NavBar({ isDemo, roles }: NavBarProps) { href={link.href} className={cn( 'px-3 py-1.5 rounded-md text-sm transition-colors', - pathname.startsWith(link.href) + link.active ? 'bg-primary-container text-primary-container-foreground font-medium' : 'text-muted-foreground hover:text-foreground hover:bg-surface-container' )}