mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
fix: update active state logic to include nested routes in navigation components
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
let { label, href, isOpen, hasItems, onToggle }: Props = $props();
|
||||
|
||||
const isActive = $derived($page.url.pathname === href);
|
||||
const isActive = $derived($page.url.pathname === href || $page.url.pathname.startsWith(href + '/'));
|
||||
</script>
|
||||
|
||||
<div class="group/header flex items-center">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
let { label, href }: Props = $props();
|
||||
|
||||
const isActive = $derived($page.url.pathname === href);
|
||||
const isActive = $derived($page.url.pathname === href || $page.url.pathname.startsWith(href + '/'));
|
||||
</script>
|
||||
|
||||
<a
|
||||
|
||||
Reference in New Issue
Block a user