]> git.r.bdr.sh - rbdr/forum/blame - src/components/forum_list/forum_list.svelte
Use routify and GraphQL server
[rbdr/forum] / src / components / forum_list / forum_list.svelte
CommitLineData
890274a7 1<script>
8050f772 2 import { _ } from 'svelte-i18n';
c1bc5993 3 import { forums } from '$stores/forums';
8050f772 4 import ErrorBlock from '../error_block/error_block.svelte';
890274a7
BB
5</script>
6
bd8e98d7 7<nav title="{$_('forum_list.title')}">
c1bc5993
RBR
8 {#if $forums.loading}
9 <p>Loading...</p>
10 {/if}
11 {#if $forums.error}
8050f772
BB
12 <ErrorBlock message={$_('forum_list.error.unavailable')} />
13 {/if}
66dc4cae 14 <ul>
c1bc5993 15 {#each $forums.data as forum}
66dc4cae
BB
16 <li>
17 <a href="/f/{forum.id}">
18 <span aria-hidden="true" class="navigation-glyph {forum.glyph}">{forum.glyph}</span>
862a5f9c 19 <span class="navigation-label">{$_(forum.label)}</span>
66dc4cae
BB
20 </a>
21 </li>
22 {/each}
23 </ul>
24</nav>
25
26<style>
27 nav {
28 grid-column: col-start 1;
29 grid-row: 2;
30 border-right: 1px solid black;
31 }
32
33 ul {
34 padding: 0;
35 }
36
37 li {
38 display: block;
39 text-align: left;
40 margin-bottom: 20px;
41 }
42
43 .navigation-glyph {
44 font-size: 1.5rem;
45 display: block;
46 }
47
48 .☽ {
49 font-size: 2rem;
50 }
51
52 a {
53 text-decoration: none;
54 }
55</style>