Fix more stuff, particularly event handlers

This commit is contained in:
Jon Staab
2025-02-03 17:21:46 -08:00
parent 8d3433b167
commit 24045a7e2a
150 changed files with 424 additions and 392 deletions
+3 -5
View File
@@ -24,7 +24,7 @@
import {fade} from "@lib/transition"
import {page} from "$app/stores"
let {href = "", notification = "false", ...restProps} = $props()
const {children, href = "", notification = false, ...restProps} = $props()
const active = $derived($page.url.pathname === href)
</script>
@@ -33,11 +33,10 @@
<a
{...restProps}
{href}
on:click
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}>
<slot />
{@render children?.()}
{#if !active && notification}
<div class="absolute right-2 top-5 h-2 w-2 rounded-full bg-primary" transition:fade></div>
{/if}
@@ -45,13 +44,12 @@
{:else}
<button
{...restProps}
on:click
class="{restProps.class} relative flex w-full 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}>
{#if !active && notification}
<div class="absolute right-2 top-5 h-2 w-2 rounded-full bg-primary" transition:fade></div>
{/if}
<slot />
{@render children?.()}
</button>
{/if}