tweak chat message layout

This commit is contained in:
Jon Staab
2024-10-15 13:12:38 -07:00
parent 6f4fe1f674
commit c3cd4db270
2 changed files with 13 additions and 14 deletions
+4 -4
View File
@@ -2,7 +2,7 @@
import {derived} from "svelte/store"
import {hash, uniqBy, groupBy, now} from "@welshman/lib"
import type {TrustedEvent} from "@welshman/util"
import {deriveEvents} from "@welshman/store"
import {deriveEvents, throttled} from "@welshman/store"
import {PublishStatus} from "@welshman/net"
import {
publishStatusData,
@@ -33,7 +33,7 @@
const reactions = deriveEvents(repository, {filters: [{kinds: [REACTION], "#e": [event.id]}]})
const zaps = deriveEvents(repository, {filters: [{kinds: [ZAP_RESPONSE], "#e": [event.id]}]})
const [_, colorValue] = colors[parseInt(hash(event.pubkey)) % colors.length]
const ps = derived(publishStatusData, $m => Object.values($m[event.id] || {}))
const ps = throttled(300, derived(publishStatusData, $m => Object.values($m[event.wrap!.id] || {})))
const showProfile = () => pushDrawer(ProfileDetail, {pubkey: event.pubkey})
@@ -58,7 +58,7 @@
class:chat-start={event.pubkey !== $pubkey}
class:chat-end={event.pubkey === $pubkey}>
<div class="chat-bubble mx-1 max-w-sm">
<div class="flex items-start gap-2">
<div class="flex items-start gap-2 w-full">
{#if showPubkey}
<Button on:click={showProfile}>
<Avatar
@@ -115,7 +115,7 @@
</div>
{/if}
<Button
class="join absolute -top-2 right-0 border border-solid border-neutral text-xs opacity-0 transition-all group-hover:opacity-100">
class="join absolute -bottom-5 right-0 border border-solid border-neutral text-xs">
<ChatMessageEmojiButton {event} {pubkeys} />
<div class="btn join-item btn-xs">
<Icon icon="menu-dots" size={4} />