-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path+layout.svelte
37 lines (35 loc) · 1.05 KB
/
+layout.svelte
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
<script lang="ts">
import '../app.postcss';
import { AppShell, AppBar } from '@skeletonlabs/skeleton';
// Floating UI for Popups
import { computePosition, autoUpdate, flip, shift, offset, arrow } from '@floating-ui/dom';
import { storePopup } from '@skeletonlabs/skeleton';
import LoginWithGuilded from '$lib/client/components/LoginWithGuilded.svelte';
import { page } from '$app/stores';
storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow });
</script>
<!-- App Shell -->
<AppShell>
<svelte:fragment slot="header">
<!-- App Bar -->
<AppBar>
<svelte:fragment slot="lead">
<strong class="text-xl uppercase">CB Example</strong>
</svelte:fragment>
<svelte:fragment slot="trail">
{#if $page.data.user}
<a href="/logout">
<button class="btn variant-ghost-surface flex gap-2">
<iconify-icon icon="fa-solid:sign-out-alt" />
Logout
</button>
</a>
{:else}
<LoginWithGuilded />
{/if}
</svelte:fragment>
</AppBar>
</svelte:fragment>
<!-- Page Route Content -->
<slot />
</AppShell>