]> git.r.bdr.sh - rbdr/forum/blame - src/routes/$layout.svelte
Add tests for actions + pacts for graphql errrors
[rbdr/forum] / src / routes / $layout.svelte
CommitLineData
58f7d521
RBR
1<script>
2 import '$/config/i18n';
879fa389 3
58f7d521 4 import { isLoading } from 'svelte-i18n';
879fa389
RBR
5 import { _ } from 'svelte-i18n';
6
73973eda 7 import { getForums } from '$/stores/forums';
879fa389
RBR
8
9 import ErrorBlock from '$/components/error_block/error_block.svelte';
58f7d521
RBR
10 import ForumList from '$/components/forum_list/forum_list.svelte';
11 import Header from '$/components/header/header.svelte';
12 import Loader from '$/components/loader/loader.svelte';
13 import Footer from '$/components/footer/footer.svelte';
73973eda
RBR
14
15 $: store = getForums();
16 $: forums = $store.data;
58f7d521
RBR
17</script>
18
19{#if $isLoading}
20 <Loader />
21{:else}
22 <Header />
23 <main>
24 <slot />
25 </main>
879fa389 26 <nav title={$_('forum_list.title')}>
73973eda 27 {#if $store.loading}
879fa389
RBR
28 <Loader />
29 {/if}
73973eda 30 {#if $store.error}
879fa389
RBR
31 <ErrorBlock message={$_('forum_list.error.unavailable')} />
32 {/if}
73973eda
RBR
33 {#if forums}
34 <ForumList forums={forums} />
879fa389
RBR
35 {/if}
36 </nav>
58f7d521
RBR
37 <Footer />
38{/if}
879fa389
RBR
39
40<style>
41 nav {
42 grid-column: col-start 1;
43 grid-row: 2;
44 border-right: 1px solid black;
45 }
46</style>