1
0

Run pnpm format

This commit is contained in:
venashial
2022-08-03 00:24:44 -07:00
parent e17eb02341
commit 13c417fcee
21 changed files with 579 additions and 565 deletions

View File

@@ -1,36 +1,34 @@
<script lang="ts">
import { SvelteComponent } from 'svelte'
import { page } from "$app/stores";
import { SvelteComponent } from 'svelte';
import { page } from '$app/stores';
export let items: {
label: string,
/** Page href, without slash prefix */
href: string,
icon: SvelteComponent
}[];
export let items: {
label: string;
/** Page href, without slash prefix */
href: string;
icon: SvelteComponent;
}[];
/** Path level in URL, zero-indexed */
export let level = 0;
/** Path level in URL, zero-indexed */
export let level = 0;
let path: string[];
$: path = $page.url.pathname
.substring(1)
.split('/')
let path: string[];
$: path = $page.url.pathname.substring(1).split('/');
</script>
<div class="vertical-nav">
{#each items as item (item.href)}
<a class="nav-item" href="/{item.href}" class:active={path[level] === item.href}>
<svelte:component this={item.icon} />
{item.label}
</a>
{/each}
{#each items as item (item.href)}
<a class="nav-item" href="/{item.href}" class:active={path[level] === item.href}>
<svelte:component this={item.icon} />
{item.label}
</a>
{/each}
</div>
<style lang="postcss">
.vertical-nav {
display: flex;
flex-direction: column;
grid-gap: 0.25rem;
}
.vertical-nav {
display: flex;
flex-direction: column;
grid-gap: 0.25rem;
}
</style>