]> git.r.bdr.sh - rbdr/forum/blobdiff - src/routes/$layout.svelte
Add tests for header
[rbdr/forum] / src / routes / $layout.svelte
index 49ceb4921851f8209a9c2dba4796631d8ff85dc3..8fd2ae04c247ac23f8a08af1faf2076335663d6b 100644 (file)
@@ -1,6 +1,12 @@
 <script>
        import '$/config/i18n';
+
        import { isLoading } from 'svelte-i18n';
+       import { _ } from 'svelte-i18n';
+
+       import { forums } from '$/stores/forums';
+
+       import ErrorBlock from '$/components/error_block/error_block.svelte';
        import ForumList from '$/components/forum_list/forum_list.svelte';
        import Header from '$/components/header/header.svelte';
        import Loader from '$/components/loader/loader.svelte';
        <main>
                <slot />
        </main>
-       <ForumList />
+  <nav title={$_('forum_list.title')}>
+    {#if $forums.loading}
+      <Loader />
+    {/if}
+    {#if $forums.error}
+      <ErrorBlock message={$_('forum_list.error.unavailable')} />
+    {/if}
+    {#if $forums.data}
+      <ForumList forums={$forums.data} />
+    {/if}
+  </nav>
        <Footer />
 {/if}
+
+<style>
+       nav {
+               grid-column: col-start 1;
+               grid-row: 2;
+               border-right: 1px solid black;
+       }
+</style>