summaryrefslogtreecommitdiff
path: root/ui/routes/+layout.svelte
blob: 22377bbb5c5c6729eb218ab008fce59fe3564bb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script>
	import '../app.css';
	import logo from '$lib/assets/logo.png';

	import { AppBar } from '@skeletonlabs/skeleton';
	import { showMenu, currentUser } from '$lib/store';

	import CurrentUser from '$lib/components/CurrentUser.svelte';

	function toggleMenu() {
		showMenu.update((value) => !value);
	}
</script>

<div id="app" class="m-0 p-0 h-vh w-full">
	<div class="w-full">
		<AppBar class="app-bar">
			<svelte:fragment slot="lead">
				<a on:click|preventDefault={toggleMenu} class="cursor-pointer">
					<img class="w-8 h-8" alt="logo" src={logo} />
				</a>
			</svelte:fragment>
			<a href="/">understory</a>
			<svelte:fragment slot="trail">
				{#if $currentUser}
					<CurrentUser />
				{/if}
			</svelte:fragment>
		</AppBar>
	</div>

	<slot />
</div>

<style>
	#app {
		margin: 0;
		height: 100vh;
		width: 100%;
	}
</style>