Display rooms using nip29 meta

This commit is contained in:
Jon Staab
2024-12-09 17:04:39 -08:00
parent ea0e1a6c9a
commit 404dc94c34
7 changed files with 157 additions and 72 deletions
+7 -6
View File
@@ -7,7 +7,8 @@
import Button from "@lib/components/Button.svelte"
import ModalHeader from "@lib/components/ModalHeader.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import {roomsByUrl} from "@app/state"
import ChannelName from "@app/components/ChannelName.svelte"
import {channelsByUrl} from "@app/state"
import {makeRoomPath} from "@app/routes"
import {setKey} from "@app/implicit"
@@ -37,14 +38,14 @@
<div slot="info">Which room would you like to share this thread to?</div>
</ModalHeader>
<div class="grid grid-cols-3 gap-2">
{#each $roomsByUrl.get(url) || [] as room (room)}
{#each $channelsByUrl.get(url) || [] as channel (channel.room)}
<button
type="button"
class="btn"
class:btn-neutral={selection !== room}
class:btn-primary={selection === room}
on:click={() => toggleRoom(room)}>
#{room}
class:btn-neutral={selection !== channel.room}
class:btn-primary={selection === channel.room}
on:click={() => toggleRoom(channel.room)}>
#<ChannelName {...channel} />
</button>
{/each}
</div>