]> git.r.bdr.sh - rbdr/forum/blob - src/lib/components/forum_list/forum_list.svelte
d1518bdd6ec90840802a419cf4ab952beae29f02
[rbdr/forum] / src / lib / components / forum_list / forum_list.svelte
1 <script lang="ts">
2 import type { Forum } from '$lib/data/types';
3
4 export let forums: Forum[];
5
6 import { _ } from 'svelte-i18n';
7 $: sortedForums = forums
8 .slice()
9 .sort((a, b) => a.position - b.position);
10 </script>
11
12 <ul class="p-0 pl-2">
13 {#each sortedForums as forum}
14 <li class="block text-left mb-5">
15 <a class="no-underline text-blue-600 visited:text-purple-500" href="/f/{forum.id}">
16 <span aria-hidden="true" class="block text-2xl {forum.glyph}">{forum.glyph}</span>
17 <span class="navigation-label">{$_(forum.label)}</span>
18 </a>
19 </li>
20 {/each}
21 </ul>
22
23 <style>
24 .☽ {
25 font-size: 2rem;
26 }
27 </style>