mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-11 11:27:03 +00:00
Fix external links, people item note links
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
formatTimestampRelative,
|
formatTimestampRelative,
|
||||||
} from "@welshman/app"
|
} from "@welshman/app"
|
||||||
import Link from "@lib/components/Link.svelte"
|
import Link from "@lib/components/Link.svelte"
|
||||||
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import Button from "@lib/components/Button.svelte"
|
import Button from "@lib/components/Button.svelte"
|
||||||
import Profile from "@app/components/Profile.svelte"
|
import Profile from "@app/components/Profile.svelte"
|
||||||
import ProfileInfo from "@app/components/ProfileInfo.svelte"
|
import ProfileInfo from "@app/components/ProfileInfo.svelte"
|
||||||
@@ -52,12 +53,15 @@
|
|||||||
{@const nevent = nip19.neventEncode({id: event.id, relays})}
|
{@const nevent = nip19.neventEncode({id: event.id, relays})}
|
||||||
{@const following = getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)}
|
{@const following = getPubkeyTagValues(getListTags($userFollows)).includes(pubkey)}
|
||||||
<div class="divider" />
|
<div class="divider" />
|
||||||
<Link external href={entityLink(nevent)} class="chat chat-start">
|
<button type="button" class="chat chat-start cursor-default" on:click|stopPropagation>
|
||||||
<div class="bg-alt chat-bubble text-left">
|
<div class="bg-alt chat-bubble text-left col-4">
|
||||||
<Content hideMedia={!following} {event} />
|
<Content hideMedia={!following} {event} />
|
||||||
<p class="text-right text-xs">{formatTimestamp(event.created_at)}</p>
|
<Link external href={entityLink(nevent)} class="row-2 justify-end group whitespace-nowrap">
|
||||||
|
<Icon icon="link-round" size={3} />
|
||||||
|
<p class="text-xs">{formatTimestamp(event.created_at)}</p>
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</button>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<div class="bg-alt badge badge-neutral border-none">
|
<div class="bg-alt badge badge-neutral border-none">
|
||||||
{roots.length} recent {roots.length === 1 ? "note" : "notes"}
|
{roots.length} recent {roots.length === 1 ? "note" : "notes"}
|
||||||
|
|||||||
@@ -4,14 +4,20 @@
|
|||||||
export let href
|
export let href
|
||||||
export let external = false
|
export let external = false
|
||||||
|
|
||||||
const go = () => goto(href)
|
const go = (e: Event) => {
|
||||||
|
if (!external) {
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
|
goto(href)
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
{href}
|
{href}
|
||||||
{...$$props}
|
{...$$props}
|
||||||
|
on:click|stopPropagation={go}
|
||||||
class="cursor-pointer {$$props.class}"
|
class="cursor-pointer {$$props.class}"
|
||||||
on:click|preventDefault|stopPropagation={go}
|
|
||||||
rel={external ? "noopener noreferer" : ""}
|
rel={external ? "noopener noreferer" : ""}
|
||||||
target={external ? "_blank" : ""}>
|
target={external ? "_blank" : ""}>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
Reference in New Issue
Block a user