mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-11 11:27:03 +00:00
Make quotes in channels more minimal
This commit is contained in:
@@ -98,7 +98,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="text-sm">
|
<div class="text-sm">
|
||||||
<Content {event} />
|
<Content {event} quoteProps={{minimal: true}} />
|
||||||
{#if thunk}
|
{#if thunk}
|
||||||
<ThunkStatus {thunk} class="mt-2" />
|
<ThunkStatus {thunk} class="mt-2" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
export let showEntire = false
|
export let showEntire = false
|
||||||
export let hideMedia = false
|
export let hideMedia = false
|
||||||
export let expandMode = "block"
|
export let expandMode = "block"
|
||||||
|
export let quoteProps: Record<string, any> = {}
|
||||||
export let depth = 0
|
export let depth = 0
|
||||||
|
|
||||||
const fullContent = parse(event)
|
const fullContent = parse(event)
|
||||||
@@ -131,7 +132,7 @@
|
|||||||
<ContentMention value={parsed.value} />
|
<ContentMention value={parsed.value} />
|
||||||
{:else if isEvent(parsed) || isAddress(parsed)}
|
{:else if isEvent(parsed) || isAddress(parsed)}
|
||||||
{#if isBlock(i)}
|
{#if isBlock(i)}
|
||||||
<ContentQuote value={parsed.value} {depth} {event}>
|
<ContentQuote {...quoteProps} value={parsed.value} {depth} {event}>
|
||||||
<div slot="note-content" let:event>
|
<div slot="note-content" let:event>
|
||||||
<svelte:self {hideMedia} {event} depth={depth + 1} />
|
<svelte:self {hideMedia} {event} depth={depth + 1} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
export let value
|
export let value
|
||||||
export let event
|
export let event
|
||||||
export let depth = 0
|
export let depth = 0
|
||||||
|
export let minimal = false
|
||||||
|
|
||||||
const {id, identifier, kind, pubkey, relays: relayHints = []} = value
|
const {id, identifier, kind, pubkey, relays: relayHints = []} = value
|
||||||
const addr = new Address(kind, pubkey, identifier)
|
const addr = new Address(kind, pubkey, identifier)
|
||||||
@@ -91,7 +92,7 @@
|
|||||||
|
|
||||||
<Button class="my-2 block max-w-full text-left" on:click={onClick}>
|
<Button class="my-2 block max-w-full text-left" on:click={onClick}>
|
||||||
{#if $quote}
|
{#if $quote}
|
||||||
<NoteCard event={$quote} class="bg-alt rounded-box p-4">
|
<NoteCard {minimal} event={$quote} class="bg-alt rounded-box p-4">
|
||||||
<slot name="note-content" event={$quote} {depth} />
|
<slot name="note-content" event={$quote} {depth} />
|
||||||
</NoteCard>
|
</NoteCard>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import cx from "classnames"
|
||||||
import {nip19} from "nostr-tools"
|
import {nip19} from "nostr-tools"
|
||||||
import {ctx} from "@welshman/lib"
|
import {ctx} from "@welshman/lib"
|
||||||
import {getListTags, getPubkeyTagValues} from "@welshman/util"
|
import {getListTags, getPubkeyTagValues} from "@welshman/util"
|
||||||
@@ -7,9 +8,11 @@
|
|||||||
import Icon from "@lib/components/Icon.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 ProfileName from "@app/components/ProfileName.svelte"
|
||||||
import {entityLink} from "@app/state"
|
import {entityLink} from "@app/state"
|
||||||
|
|
||||||
export let event
|
export let event
|
||||||
|
export let minimal = false
|
||||||
export let hideProfile = false
|
export let hideProfile = false
|
||||||
|
|
||||||
const relays = ctx.app.router.Event(event).getUrls()
|
const relays = ctx.app.router.Event(event).getUrls()
|
||||||
@@ -34,9 +37,16 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<div class="flex justify-between gap-2">
|
<div class="flex justify-between gap-2">
|
||||||
{#if !hideProfile}
|
{#if !hideProfile}
|
||||||
<Profile pubkey={event.pubkey} />
|
{#if minimal}
|
||||||
|
@<ProfileName pubkey={event.pubkey} />
|
||||||
|
{:else}
|
||||||
|
<Profile pubkey={event.pubkey} />
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<Link external href={entityLink(nevent)} class="text-sm opacity-75">
|
<Link
|
||||||
|
external
|
||||||
|
href={entityLink(nevent)}
|
||||||
|
class={cx("text-sm opacity-75", {"text-xs": minimal})}>
|
||||||
{formatTimestamp(event.created_at)}
|
{formatTimestamp(event.created_at)}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user