Fix more stuff, particularly event handlers

This commit is contained in:
Jon Staab
2025-02-03 17:21:46 -08:00
parent 8d3433b167
commit 24045a7e2a
150 changed files with 424 additions and 392 deletions
+16 -8
View File
@@ -1,8 +1,10 @@
<script lang="ts">
import cx from "classnames"
import type {Snippet} from "svelte"
import {nip19} from "nostr-tools"
import {ctx} from "@welshman/lib"
import {getListTags, getPubkeyTagValues} from "@welshman/util"
import type {TrustedEvent} from "@welshman/util"
import {formatTimestamp, userMutes} from "@welshman/app"
import Link from "@lib/components/Link.svelte"
import Icon from "@lib/components/Icon.svelte"
@@ -11,13 +13,19 @@
import ProfileName from "@app/components/ProfileName.svelte"
import {entityLink} from "@app/state"
interface Props {
const {
event,
children,
minimal = false,
hideProfile = false,
...restProps
}: {
event: TrustedEvent
minimal: boolean
hideProfile: boolean
}
let {event, children, minimal = false, hideProfile = false, ...restProps} = $props()
children: Snippet
minimal?: boolean
hideProfile?: boolean
class?: string
} = $props()
const relays = ctx.app.router.Event(event).getUrls()
const nevent = nip19.neventEncode({id: event.id, relays})
@@ -26,7 +34,7 @@
muted = false
}
let muted = getPubkeyTagValues(getListTags($userMutes)).includes(event.pubkey)
let muted = $state(getPubkeyTagValues(getListTags($userMutes)).includes(event.pubkey))
</script>
<div class="flex flex-col gap-2 {restProps.class}">
@@ -36,7 +44,7 @@
<Icon icon="danger" class="mt-1" />
<p>You have muted this person.</p>
</div>
<Button class="link ml-8" on:click={ignoreMute}>Show anyway</Button>
<Button class="link ml-8" onclick={ignoreMute}>Show anyway</Button>
</div>
{:else}
<div class="flex justify-between gap-2">