Merge branch 'master' into gui_search

This commit is contained in:
venashial
2022-08-03 00:44:17 -07:00
parent b0a55c9b18
commit 51982dde62
79 changed files with 6320 additions and 6336 deletions

View File

@@ -1,36 +1,39 @@
<script lang="ts">
import { page } from "$app/stores";
import type { SvelteComponent } from 'svelte';
import { page } from '$app/stores';
export let items: {
label: string,
/** Page href, without slash prefix */
href: string,
/** An icon, as a svelte component */
icon: any, // `SvelteComponentDev` has type errors
}[];
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} sveltekit:prefetch>
<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}
sveltekit:prefetch
>
<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>