Add profile detail modal

This commit is contained in:
Jon Staab
2024-12-16 12:54:17 -08:00
parent 3b202b31cb
commit cd8d8b548f
11 changed files with 150 additions and 55 deletions
+6 -3
View File
@@ -4,15 +4,18 @@
import Link from "@lib/components/Link.svelte"
import Content from "@app/components/Content.svelte"
import ProfileName from "@app/components/ProfileName.svelte"
import ProfileDetail from "@app/components/ProfileDetail.svelte"
import ThreadActions from "@app/components/ThreadActions.svelte"
import {makeThreadPath} from "@app/routes"
import {pubkeyLink} from "@app/state"
import {pushModal} from "@app/modal"
export let url
export let event
export let hideActions = false
const title = event.tags.find(nthEq(0, "title"))?.[1]
const openProfile = () => pushModal(ProfileDetail, {pubkey: event.pubkey})
</script>
<Link class="col-2 card2 bg-alt w-full cursor-pointer" href={makeThreadPath(url, event.id)}>
@@ -32,9 +35,9 @@
<div class="flex w-full flex-col items-end justify-between gap-2 sm:flex-row">
<span class="whitespace-nowrap py-1 text-sm opacity-75">
Posted by
<Link external href={pubkeyLink(event.pubkey)} class="link-content">
<button type="button" on:click|preventDefault={openProfile} class="link-content">
@<ProfileName pubkey={event.pubkey} />
</Link>
</button>
</span>
{#if !hideActions}
<ThreadActions showActivity {url} {event} />