Get rid of profile detail, redirect externally

This commit is contained in:
Jon Staab
2024-10-24 12:50:49 -07:00
parent 03b4f2c46c
commit cad096b019
15 changed files with 57 additions and 201 deletions
+4 -13
View File
@@ -1,6 +1,4 @@
<script lang="ts">
import {nip19} from 'nostr-tools'
import {ctx} from "@welshman/lib"
import {displayPubkey, getPubkeyTagValues, getListTags} from "@welshman/util"
import {
session,
@@ -12,12 +10,9 @@
deriveProfileDisplay,
} from "@welshman/app"
import Link from "@lib/components/Link.svelte"
import Button from "@lib/components/Button.svelte"
import Avatar from "@lib/components/Avatar.svelte"
import WotScore from "@lib/components/WotScore.svelte"
import ProfileDetail from "@app/components/ProfileDetail.svelte"
import {pushDrawer} from "@app/modal"
import {entityLink} from "@app/state"
import {pubkeyLink} from "@app/state"
export let pubkey
@@ -25,24 +20,20 @@
const profileDisplay = deriveProfileDisplay(pubkey)
const handle = deriveHandleForPubkey(pubkey)
const score = deriveUserWotScore(pubkey)
const relays = ctx.app.router.FromPubkeys([pubkey]).getUrls()
const nprofile = nip19.nprofileEncode({pubkey, relays})
const onClick = () => pushDrawer(ProfileDetail, {pubkey})
$: following =
pubkey === $session!.pubkey || getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)
</script>
<div class="flex max-w-full gap-3">
<Link external href={entityLink(nprofile)} class="py-1">
<Link external href={pubkeyLink(pubkey)} class="py-1">
<Avatar src={$profile?.picture} size={10} />
</Link>
<div class="flex min-w-0 flex-col">
<div class="flex items-center gap-2">
<Button class="text-bold overflow-hidden text-ellipsis" on:click={onClick}>
<Link external href={pubkeyLink(pubkey)} class="text-bold overflow-hidden text-ellipsis">
{$profileDisplay}
</Button>
</Link>
<WotScore score={$score} active={following} />
</div>
<div class="overflow-hidden text-ellipsis text-sm opacity-75">