Show lock icon for closed channels

This commit is contained in:
Jon Staab
2024-12-10 13:38:34 -08:00
parent a5dfa02771
commit 80d44a097a
8 changed files with 47 additions and 17 deletions
+18 -3
View File
@@ -10,7 +10,14 @@
import ChannelName from "@app/components/ChannelName.svelte"
import RelayName from "@app/components/RelayName.svelte"
import RelayDescription from "@app/components/RelayDescription.svelte"
import {decodeRelay, deriveUserRooms, deriveOtherRooms} from "@app/state"
import {
decodeRelay,
channelIsLocked,
makeChannelId,
channelsById,
deriveUserRooms,
deriveOtherRooms,
} from "@app/state"
import {makeChatPath, makeRoomPath, makeSpacePath} from "@app/routes"
const url = decodeRelay($page.params.relay)
@@ -98,7 +105,11 @@
<Link
href={makeRoomPath(url, room)}
class="btn btn-neutral flex-nowrap justify-start whitespace-nowrap border-none">
<Icon icon="hashtag" />
{#if channelIsLocked($channelsById.get(makeChannelId(url, room)))}
<Icon icon="lock" size={4} />
{:else}
<Icon icon="hashtag" />
{/if}
<div class="min-w-0 overflow-hidden text-ellipsis">
<ChannelName {url} {room} />
</div>
@@ -108,7 +119,11 @@
<Link
href={makeRoomPath(url, room)}
class="bg-alt btn btn-neutral flex-nowrap justify-start whitespace-nowrap border-none">
<Icon icon="hashtag" />
{#if channelIsLocked($channelsById.get(makeChannelId(url, room)))}
<Icon icon="lock" size={4} />
{:else}
<Icon icon="hashtag" />
{/if}
<div class="min-w-0 overflow-hidden text-ellipsis">
<ChannelName {url} {room} />
</div>