Menu bar.
This commit is contained in:
@@ -1,13 +1,45 @@
|
||||
<script lang="ts">
|
||||
import './layout.css';
|
||||
import favicon from '#lib/assets/favicon.svg';
|
||||
import { resolve } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import type { LayoutProps } from './$types';
|
||||
|
||||
let { children }: LayoutProps = $props();
|
||||
|
||||
const menuItems = [
|
||||
{ label: 'Dashboard', href: '/' },
|
||||
{ label: 'Accounts', href: '/accounts' },
|
||||
{ label: 'Scheduled transactions', href: '/scheduled-transactions' },
|
||||
{ label: 'Transaction history', href: '/transaction-history' }
|
||||
] as const;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<link rel="icon" href={favicon} />
|
||||
</svelte:head>
|
||||
|
||||
{@render children()}
|
||||
<div class="grid min-h-dvh grid-cols-[min(16rem,48vw)_minmax(0,1fr)]">
|
||||
<aside class="sticky top-0 h-dvh overflow-y-auto px-4 py-8">
|
||||
<div class="mx-3 mb-8 text-2xl font-normal">Expenses</div>
|
||||
<nav aria-label="Main navigation">
|
||||
<ul class="grid gap-2">
|
||||
{#each menuItems as item (item.href)}
|
||||
<li>
|
||||
<a
|
||||
href={resolve(item.href)}
|
||||
aria-current={page.url.pathname === resolve(item.href) ? 'page' : undefined}
|
||||
class="flex px-3 py-[0.3175rem] text-sm wrap-anywhere text-neutral-400 no-underline hover:text-neutral-100 focus-visible:text-neutral-100 focus-visible:underline focus-visible:underline-offset-2 focus-visible:outline-none aria-[current=page]:text-neutral-100 aria-[current=page]:not-italic"
|
||||
>
|
||||
{item.label}
|
||||
</a>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<main id="main-content" tabindex="-1" class="min-w-0">
|
||||
{@render children()}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user