Handle deleted threads

This commit is contained in:
Jon Staab
2024-10-24 11:52:02 -07:00
parent 33c8142eda
commit dd7c0f3b07
13 changed files with 102 additions and 68 deletions
+8 -1
View File
@@ -2,7 +2,7 @@
import {type Instance} from "tippy.js"
import type {NativeEmoji} from "emoji-picker-element/shared"
import {max} from "@welshman/lib"
import {deriveEvents} from "@welshman/store"
import {deriveEvents, deriveIsDeleted} from "@welshman/store"
import type {TrustedEvent} from "@welshman/util"
import {pubkey, repository, formatTimestampRelative} from "@welshman/app"
import Icon from "@lib/components/Icon.svelte"
@@ -18,6 +18,8 @@
export let event
export let showActivity = false
const deleted = deriveIsDeleted(repository, event)
const replies = deriveEvents(repository, {filters: [{kinds: [REPLY], "#E": [event.id]}]})
const showPopover = () => popover.show()
@@ -47,6 +49,11 @@
<ReactionSummary {event} {onReactionClick} />
</Button>
<div class="flex flex-grow justify-end gap-2">
{#if $deleted}
<div class="btn btn-error btn-xs rounded-full">
Deleted
</div>
{/if}
{#if showActivity}
<div class="flex-inline btn btn-neutral btn-xs gap-1 rounded-full">
<Icon icon="reply" />