forked from coracle/flotilla
Use thread item for profile detail
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
} from "@welshman/util"
|
} from "@welshman/util"
|
||||||
import {deriveEvents} from "@welshman/store"
|
import {deriveEvents} from "@welshman/store"
|
||||||
import {
|
import {
|
||||||
|
session,
|
||||||
repository,
|
repository,
|
||||||
userFollows,
|
userFollows,
|
||||||
tagPubkey,
|
tagPubkey,
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
deriveProfile,
|
deriveProfile,
|
||||||
displayNip05,
|
displayNip05,
|
||||||
feedLoader,
|
feedLoader,
|
||||||
|
tracker,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import {createScroller} from "@lib/html"
|
import {createScroller} from "@lib/html"
|
||||||
import {fly} from "@lib/transition"
|
import {fly} from "@lib/transition"
|
||||||
@@ -28,7 +30,7 @@
|
|||||||
import Avatar from "@lib/components/Avatar.svelte"
|
import Avatar from "@lib/components/Avatar.svelte"
|
||||||
import Spinner from "@lib/components/Spinner.svelte"
|
import Spinner from "@lib/components/Spinner.svelte"
|
||||||
import Content from "@app/components/Content.svelte"
|
import Content from "@app/components/Content.svelte"
|
||||||
import NoteCard from "@app/components/NoteCard.svelte"
|
import ThreadItem from "@app/components/ThreadItem.svelte"
|
||||||
import {entityLink} from "@app/state"
|
import {entityLink} from "@app/state"
|
||||||
|
|
||||||
export let pubkey
|
export let pubkey
|
||||||
@@ -40,6 +42,7 @@
|
|||||||
const loader = feedLoader.getLoader(feedFromFilter(filter), {})
|
const loader = feedLoader.getLoader(feedFromFilter(filter), {})
|
||||||
const relays = ctx.app.router.FromPubkeys([pubkey]).getUrls()
|
const relays = ctx.app.router.FromPubkeys([pubkey]).getUrls()
|
||||||
const nprofile = nip19.nprofileEncode({pubkey, relays})
|
const nprofile = nip19.nprofileEncode({pubkey, relays})
|
||||||
|
const isSelf = $session!.pubkey === pubkey
|
||||||
|
|
||||||
let element: Element
|
let element: Element
|
||||||
|
|
||||||
@@ -75,30 +78,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#if getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)}
|
{#if !isSelf}
|
||||||
<button
|
{#if getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)}
|
||||||
type="button"
|
<button
|
||||||
class="btn btn-neutral"
|
type="button"
|
||||||
on:click|preventDefault={() => unfollow(pubkey)}>
|
class="btn btn-neutral"
|
||||||
Unfollow
|
on:click|preventDefault={() => unfollow(pubkey)}>
|
||||||
</button>
|
Unfollow
|
||||||
{:else}
|
</button>
|
||||||
<button
|
{:else}
|
||||||
type="button"
|
<button
|
||||||
class="btn btn-primary"
|
type="button"
|
||||||
on:click|preventDefault={() => follow(tagPubkey(pubkey))}>
|
class="btn btn-primary"
|
||||||
Follow
|
on:click|preventDefault={() => follow(tagPubkey(pubkey))}>
|
||||||
</button>
|
Follow
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</Link>
|
</Link>
|
||||||
<Content event={{content: $profile.about, tags: []}} hideMedia />
|
<Content event={{content: $profile.about, tags: []}} hideMedia />
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
{#each sortBy(e => -e.created_at, $events) as event (event.id)}
|
{#each sortBy(e => -e.created_at, $events) as event (event.id)}
|
||||||
{#if flatten(Object.values(getAncestorTags(event.tags))).length === 0}
|
{#if flatten(Object.values(getAncestorTags(event.tags))).length === 0}
|
||||||
<div class="card2 bg-alt" in:fly>
|
{@const [url] = Array.from(tracker.getRelays(event.id))}
|
||||||
<NoteCard hideProfile {event}>
|
<div in:fly>
|
||||||
<Content {event} />
|
<ThreadItem hideActions {url} {event} />
|
||||||
</NoteCard>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
export let url
|
export let url
|
||||||
export let event
|
export let event
|
||||||
|
export let hideActions = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Link class="col-2 card2 bg-alt w-full cursor-pointer" href={makeThreadPath(url, event.id)}>
|
<Link class="col-2 card2 bg-alt w-full cursor-pointer" href={makeThreadPath(url, event.id)}>
|
||||||
@@ -19,6 +20,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-4 w-full pl-12">
|
<div class="col-4 w-full pl-12">
|
||||||
<Content {event} />
|
<Content {event} />
|
||||||
<ThreadActions showActivity {url} {event} />
|
{#if !hideActions}
|
||||||
|
<ThreadActions showActivity {url} {event} />
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
showReply = false
|
showReply = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const onReplySubmit = (thunk: Thunk) => {}
|
|
||||||
|
|
||||||
let showReply = false
|
let showReply = false
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
@@ -79,5 +77,5 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{#if showReply}
|
{#if showReply}
|
||||||
<ThreadReply {url} event={$event} onClose={closeReply} onSubmit={onReplySubmit} />
|
<ThreadReply {url} event={$event} onClose={closeReply} onSubmit={closeReply} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user