replace state when navigating from space menu

This commit is contained in:
Jon Staab
2025-02-11 11:42:49 -08:00
parent d8cf48381b
commit 622214713b
4 changed files with 24 additions and 13 deletions
+3 -2
View File
@@ -24,15 +24,16 @@
import {fade} from "@lib/transition"
import {page} from "$app/stores"
const {children, href = "", notification = false, ...restProps} = $props()
const {children, href = "", notification = false, replaceState = false, ...restProps} = $props()
const active = $derived($page.url.pathname === href)
</script>
{#if href}
<a
{...restProps}
{href}
{...restProps}
data-sveltekit-replacestate={replaceState}
class="{restProps.class} relative flex items-center gap-3 text-left transition-all hover:bg-base-100 hover:text-base-content"
class:text-base-content={active}
class:bg-base-100={active}>