Add room info button to VoiceWidget
This commit is contained in:
@@ -3,10 +3,14 @@
|
|||||||
import Microphone from "@assets/icons/microphone.svg?dataurl"
|
import Microphone from "@assets/icons/microphone.svg?dataurl"
|
||||||
import MicrophoneOff from "@assets/icons/microphone-off.svg?dataurl"
|
import MicrophoneOff from "@assets/icons/microphone-off.svg?dataurl"
|
||||||
import PhoneRounded from "@assets/icons/phone-rounded.svg?dataurl"
|
import PhoneRounded from "@assets/icons/phone-rounded.svg?dataurl"
|
||||||
|
import InfoCircle from "@assets/icons/info-circle.svg?dataurl"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import Button from "@lib/components/Button.svelte"
|
import Button from "@lib/components/Button.svelte"
|
||||||
import {displayRoom} from "@app/core/state"
|
import {displayRoom} from "@app/core/state"
|
||||||
|
import {get} from "svelte/store"
|
||||||
import {currentVoiceSession, leaveVoiceRoom, toggleMute} from "@app/voice"
|
import {currentVoiceSession, leaveVoiceRoom, toggleMute} from "@app/voice"
|
||||||
|
import RoomDetail from "@app/components/RoomDetail.svelte"
|
||||||
|
import {pushModal} from "@app/util/modal"
|
||||||
|
|
||||||
const roomName = $derived(
|
const roomName = $derived(
|
||||||
$currentVoiceSession ? displayRoom($currentVoiceSession.url, $currentVoiceSession.h) : "",
|
$currentVoiceSession ? displayRoom($currentVoiceSession.url, $currentVoiceSession.h) : "",
|
||||||
@@ -15,15 +19,24 @@
|
|||||||
|
|
||||||
const handleDisconnect = () => leaveVoiceRoom()
|
const handleDisconnect = () => leaveVoiceRoom()
|
||||||
const handleToggleMute = () => toggleMute()
|
const handleToggleMute = () => toggleMute()
|
||||||
|
const showRoomDetail = () => {
|
||||||
|
const session = get(currentVoiceSession)
|
||||||
|
if (session) pushModal(RoomDetail, {url: session.url, h: session.h})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $currentVoiceSession}
|
{#if $currentVoiceSession}
|
||||||
<div class="flex flex-col gap-2 rounded-box bg-base-100 p-3">
|
<div class="flex flex-col gap-2 rounded-box bg-base-100 p-3">
|
||||||
<div class="flex flex-col gap-0.5">
|
<div class="flex items-start justify-between gap-2">
|
||||||
<span class="text-sm font-semibold text-success">Voice Connected</span>
|
<div class="min-w-0 flex flex-col gap-0.5">
|
||||||
<span class="ellipsize text-xs opacity-70">
|
<span class="text-sm font-semibold text-success">Voice Connected</span>
|
||||||
{roomName} / {spaceName}
|
<span class="ellipsize text-xs opacity-70">
|
||||||
</span>
|
{roomName} / {spaceName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<Button class="btn btn-sm btn-square btn-ghost shrink-0" onclick={showRoomDetail}>
|
||||||
|
<Icon icon={InfoCircle} size={4} />
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user