Integrate new PageBar behavior

This commit is contained in:
mplorentz
2026-03-13 09:13:57 -04:00
committed by hodlbod
parent 1e42fd9b2d
commit 2acf971a10
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
</script> </script>
{#if roomType === RoomType.Voice} {#if roomType === RoomType.Voice}
<VoiceRoomItem {url} {h} /> <VoiceRoomItem {url} {h} {replaceState} />
{:else} {:else}
<SecondaryNavItem <SecondaryNavItem
href={path} href={path}
+5 -1
View File
@@ -6,6 +6,7 @@
import RoomImage from "@app/components/RoomImage.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 {makeRoomPath} from "@app/util/routes"
import { import {
deriveVoiceParticipants, deriveVoiceParticipants,
joinVoiceRoom, joinVoiceRoom,
@@ -19,9 +20,10 @@
interface Props { interface Props {
url: string url: string
h: string h: string
replaceState?: boolean
} }
const {url, h}: Props = $props() const {url, h, replaceState = false}: Props = $props()
const participants = deriveVoiceParticipants(url, h) const participants = deriveVoiceParticipants(url, h)
const isActive = $derived($currentVoiceSession?.url === url && $currentVoiceSession?.h === h) const isActive = $derived($currentVoiceSession?.url === url && $currentVoiceSession?.h === h)
@@ -55,6 +57,8 @@
</script> </script>
<SecondaryNavItem <SecondaryNavItem
href={makeRoomPath(url, h)}
{replaceState}
onclick={handleClick} onclick={handleClick}
class={cx("!items-start", isActive && "!bg-base-100 !text-base-content")}> class={cx("!items-start", isActive && "!bg-base-100 !text-base-content")}>
<div class="flex w-full min-w-0 flex-col gap-2"> <div class="flex w-full min-w-0 flex-col gap-2">