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
+12 -2
View File
@@ -1,19 +1,29 @@
<script lang="ts">
import {readable} from "svelte/store"
import Icon from "@lib/components/Icon.svelte"
import SecondaryNavItem from "@lib/components/SecondaryNavItem.svelte"
import ChannelName from "@app/components/ChannelName.svelte"
import {makeSpacePath} from "@app/routes"
import {deriveChannel, channelIsLocked} from "@app/state"
import {deriveNotification, getRoomFilters} from "@app/notifications"
export let url
export let room
export let notify = false
const path = makeSpacePath(url, room)
const notification = deriveNotification(path, getRoomFilters(room), url)
const channel = deriveChannel(url, room)
const notification = notify
? deriveNotification(path, getRoomFilters(room), url)
: readable(false)
</script>
<SecondaryNavItem href={path} notification={$notification}>
<Icon icon="hashtag" />
{#if channelIsLocked($channel)}
<Icon icon="lock" size={4} />
{:else}
<Icon icon="hashtag" />
{/if}
<div class="min-w-0 overflow-hidden text-ellipsis">
<ChannelName {url} {room} />
</div>