More nav tweaking

This commit is contained in:
Jon Staab
2024-10-21 13:46:32 -07:00
parent dea34f96ec
commit ee6c79cad3
5 changed files with 21 additions and 79 deletions
+2 -4
View File
@@ -4,11 +4,9 @@
export let title = ""
export let href = ""
export let noActive = false
export let prefix = ""
$: itemSegment = href.split("/")[1]
$: currentSegment = $page.route?.id?.split("/")[1]
$: active = itemSegment === currentSegment && !noActive
$: active = $page.url?.pathname?.startsWith(prefix || href || "bogus")
</script>
{#if href}