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 <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-26 16:56:04 +02:00
parent 89e5164a28
commit 95ee968f39

View file

@ -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'
)}