Add back button to chat detail

This commit is contained in:
Jon Staab
2026-03-30 14:24:40 -07:00
parent 2fd7556a52
commit 5760be4313
+36 -28
View File
@@ -34,6 +34,7 @@
messagingRelayListsByPubkey, messagingRelayListsByPubkey,
} from "@welshman/app" } from "@welshman/app"
import Danger from "@assets/icons/danger-triangle.svg?dataurl" import Danger from "@assets/icons/danger-triangle.svg?dataurl"
import ArrowLeft from "@assets/icons/arrow-left.svg?dataurl"
import Icon from "@lib/components/Icon.svelte" import Icon from "@lib/components/Icon.svelte"
import Spinner from "@lib/components/Spinner.svelte" import Spinner from "@lib/components/Spinner.svelte"
import PageBar from "@lib/components/PageBar.svelte" import PageBar from "@lib/components/PageBar.svelte"
@@ -72,6 +73,8 @@
? pushModal(ProfileDetail, {pubkey: others[0]}) ? pushModal(ProfileDetail, {pubkey: others[0]})
: pushModal(ChatMembers, {pubkeys: others}) : pushModal(ChatMembers, {pubkeys: others})
const back = () => history.back()
const replyTo = (event: TrustedEvent) => { const replyTo = (event: TrustedEvent) => {
parent = event parent = event
compose?.focus() compose?.focus()
@@ -251,35 +254,40 @@
</script> </script>
<PageBar> <PageBar>
<div class="flex items-center justify-between gap-4"> <div class="flex">
<div class="ellipsize flex items-center gap-4 whitespace-nowrap"> <Button onclick={back} class="place-self-start pr-3 md:hidden flex items-center">
<Button class="flex flex-col gap-1 sm:flex-row sm:gap-2" onclick={showMembers}> <Icon icon={ArrowLeft} size={7} />
{#if others.length === 0} </Button>
<div class="row-2"> <div class="flex items-center justify-between gap-4">
<ProfileCircle pubkey={$pubkey!} size={5} /> <div class="ellipsize flex items-center gap-4 whitespace-nowrap">
<ProfileName pubkey={$pubkey!} /> <Button class="flex flex-col gap-1 sm:flex-row sm:gap-2" onclick={showMembers}>
</div> {#if others.length === 0}
{:else if others.length === 1} <div class="row-2">
<div class="row-2"> <ProfileCircle pubkey={$pubkey!} size={5} />
<ProfileCircle pubkey={others[0]} size={5} /> <ProfileName pubkey={$pubkey!} />
<ProfileName pubkey={others[0]} /> </div>
</div> {:else if others.length === 1}
{:else} <div class="row-2">
<div class="flex items-center gap-2"> <ProfileCircle pubkey={others[0]} size={5} />
<ProfileCircles pubkeys={others} size={5} />
<p class="overflow-hidden text-ellipsis whitespace-nowrap">
<ProfileName pubkey={others[0]} /> <ProfileName pubkey={others[0]} />
and </div>
{#if others.length === 2} {:else}
<ProfileName pubkey={others[1]} /> <div class="flex items-center gap-2">
{:else} <ProfileCircles pubkeys={others} size={5} />
{others.length - 1} <p class="overflow-hidden text-ellipsis whitespace-nowrap">
{others.length > 2 ? "others" : "other"} <ProfileName pubkey={others[0]} />
{/if} and
</p> {#if others.length === 2}
</div> <ProfileName pubkey={others[1]} />
{/if} {:else}
</Button> {others.length - 1}
{others.length > 2 ? "others" : "other"}
{/if}
</p>
</div>
{/if}
</Button>
</div>
</div> </div>
</div> </div>
</PageBar> </PageBar>