]> git.r.bdr.sh - rbdr/forum/blob - src/routes/$layout.svelte
Mock config for tests
[rbdr/forum] / src / routes / $layout.svelte
1 <script>
2 import '$/config/i18n';
3
4 import { isLoading } from 'svelte-i18n';
5 import { _ } from 'svelte-i18n';
6
7 import { forums } from '$/stores/forums';
8
9 import ErrorBlock from '$/components/error_block/error_block.svelte';
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';
14 </script>
15
16 {#if $isLoading}
17 <Loader />
18 {:else}
19 <Header />
20 <main>
21 <slot />
22 </main>
23 <nav title={$_('forum_list.title')}>
24 {#if $forums.loading}
25 <Loader />
26 {/if}
27 {#if $forums.error}
28 <ErrorBlock message={$_('forum_list.error.unavailable')} />
29 {/if}
30 {#if $forums.data}
31 <ForumList forums={$forums.data} />
32 {/if}
33 </nav>
34 <Footer />
35 {/if}
36
37 <style>
38 nav {
39 grid-column: col-start 1;
40 grid-row: 2;
41 border-right: 1px solid black;
42 }
43 </style>