Show custom icon for voice rooms

This commit is contained in:
mplorentz
2026-03-10 12:06:33 -04:00
parent 5bd9a7f55a
commit 9a17ae745e
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -8,9 +8,10 @@
h: string h: string
url: string url: string
size?: number size?: number
fallbackIcon?: string
} }
const {url, h, size = 5}: Props = $props() const {url, h, size = 5, fallbackIcon = Hashtag}: Props = $props()
const room = deriveRoom(url, h) const room = deriveRoom(url, h)
</script> </script>
@@ -18,5 +19,5 @@
{#if $room.picture} {#if $room.picture}
<ImageIcon src={$room.picture} {size} alt="" class="rounded-lg" /> <ImageIcon src={$room.picture} {size} alt="" class="rounded-lg" />
{:else} {:else}
<Icon icon={Hashtag} {size} /> <Icon icon={fallbackIcon} {size} />
{/if} {/if}
+2 -2
View File
@@ -3,9 +3,9 @@
import {loadProfile, displayProfileByPubkey} from "@welshman/app" import {loadProfile, displayProfileByPubkey} from "@welshman/app"
import Volume from "@assets/icons/volume.svg?dataurl" import Volume from "@assets/icons/volume.svg?dataurl"
import VolumeLoud from "@assets/icons/volume-loud.svg?dataurl" import VolumeLoud from "@assets/icons/volume-loud.svg?dataurl"
import Icon from "@lib/components/Icon.svelte"
import SecondaryNavItem from "@lib/components/SecondaryNavItem.svelte" import SecondaryNavItem from "@lib/components/SecondaryNavItem.svelte"
import ProfileCircle from "@app/components/ProfileCircle.svelte" import ProfileCircle from "@app/components/ProfileCircle.svelte"
import RoomImage from "@app/components/RoomImage.svelte"
import RoomName from "@app/components/RoomName.svelte" import RoomName from "@app/components/RoomName.svelte"
import {pushToast} from "@app/util/toast" import {pushToast} from "@app/util/toast"
import { import {
@@ -62,7 +62,7 @@
{#if joinAbortController} {#if joinAbortController}
<span class="loading loading-spinner loading-sm"></span> <span class="loading loading-spinner loading-sm"></span>
{:else} {:else}
<Icon icon={isActive ? VolumeLoud : Volume} size={4} class="opacity-70" /> <RoomImage {url} {h} size={4} fallbackIcon={isActive ? VolumeLoud : Volume} />
{/if} {/if}
<RoomName {url} {h} /> <RoomName {url} {h} />
</div> </div>