]> git.r.bdr.sh - rbdr/forum/blame - src/lib/components/forum_list/forum_list.svelte
Update / use typescript
[rbdr/forum] / src / lib / components / forum_list / forum_list.svelte
CommitLineData
a7cf03c1 1<script lang="ts">
47b0bfe4
RBR
2 import { _ } from 'svelte-i18n';
3 export let forums;
879fa389 4
47b0bfe4 5 $: sortedForums = forums.slice().sort((a, b) => a.position - b.position);
890274a7
BB
6</script>
7
879fa389
RBR
8<ul>
9 {#each sortedForums as forum}
10 <li>
11 <a href="/f/{forum.id}">
12 <span aria-hidden="true" class="navigation-glyph {forum.glyph}">{forum.glyph}</span>
13 <span class="navigation-label">{$_(forum.label)}</span>
14 </a>
15 </li>
16 {/each}
17</ul>
66dc4cae
BB
18
19<style>
58f7d521
RBR
20 ul {
21 padding: 0;
22 }
66dc4cae 23
58f7d521
RBR
24 li {
25 display: block;
26 text-align: left;
27 margin-bottom: 20px;
28 }
66dc4cae 29
58f7d521
RBR
30 .navigation-glyph {
31 font-size: 1.5rem;
32 display: block;
33 }
66dc4cae 34
58f7d521
RBR
35 .☽ {
36 font-size: 2rem;
37 }
66dc4cae 38
58f7d521
RBR
39 a {
40 text-decoration: none;
41 }
66dc4cae 42</style>