feat: change navbar to dock

This commit is contained in:
Xylight committed 2024-04-13 12:46:17 -07:00
1 parent 4dab003ae2
commit e51c4530f0
7 files changed
+99 -83

No files matched your search

+13 -5
View File
@@ -1,23 +1,31 @@
<script lang="ts">
import { page } from '$app/stores'
import { Button } from 'mono-svelte'
import { Icon, type IconSource } from 'svelte-hero-icons'
export let label: string
export let icon: IconSource | undefined = undefined
export let href: string | undefined = undefined
$: isSelected = href != undefined && $page.url.pathname == href
</script>
<Button
color="tertiary"
{...$$restProps}
class="px-3 py-1.5 max-md:py-0 max-md:px-0 max-md:h-8 max-md:w-8 {$$props.class ??
''}"
class="rounded-full w-9 h-9 {isSelected
? 'bg-slate-200 dark:bg-zinc-900'
: ''} {$$props.class ?? ''}"
size="custom"
{href}
rounding="pill"
title={label}
>
{#if icon}
<Icon src={icon} mini size="16" />
<Icon src={icon} mini={isSelected} size="18" />
{:else}
<slot name="icon" />
<slot {isSelected} name="icon" />
{/if}
<span class="max-md:hidden">{label}</span>
<!-- <span class="max-md:hidden">{label}</span> -->
<slot />
</Button>