From a348d080bddbbc18baef07470547a22a65f0d98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Sat, 16 Aug 2025 16:59:16 +0200 Subject: [PATCH] Search results, partial --- src/lib/a/cards/AEventPreview.svelte | 199 +++++++++++++++------------ src/lib/snippets/UserSnippets.svelte | 10 +- src/routes/+layout.svelte | 2 +- 3 files changed, 116 insertions(+), 95 deletions(-) diff --git a/src/lib/a/cards/AEventPreview.svelte b/src/lib/a/cards/AEventPreview.svelte index 621c8e3..54f9ad7 100644 --- a/src/lib/a/cards/AEventPreview.svelte +++ b/src/lib/a/cards/AEventPreview.svelte @@ -1,15 +1,13 @@ -
-
+ +
+ +
{#if label} - {label} + + {label} + {/if} {#if showKind} - Kind: {event.kind} + + Kind {event.kind} + {/if} {#if community} -
- - - -
- {:else} -
+ + + + Community + {/if} - - {@render userBadge( - toNpub(event.pubkey) as string, - profileData?.display_name || profileData?.name - )} - - - {event.created_at - ? new Date(event.created_at * 1000).toLocaleDateString() - : "Unknown date"} - + + {createdDate} +
- {#if event.kind === 0 && profileData} -
- {#if profileData.picture} - Profile { - (e.target as HTMLImageElement).style.display = "none"; - }} - /> - {:else} -
- - {(profileData.display_name || profileData.name || event.pubkey.slice(0, 1)).toUpperCase()} - -
- {/if} -
- {#if profileData.display_name || profileData.name} - - {profileData.display_name || profileData.name} - - {/if} - {#if profileData.about} - - {profileData.about} - - {/if} -
+
+ {@render userBadge(toNpub(event.pubkey) as string, displayName)} +
+
+ + +
+ {#if event.kind === 0 && profileData?.about} +
+ {clippedContent(profileData.about)}
{:else} {#if summary} -
+
{summary}
{/if} {#if deferralNaddr} -
+
Read { - e.stopPropagation(); - // Parent should intercept navigation by listening onSelect and inspecting event tags if needed + role="button" + tabindex="0" + onclick={handleDeferralClick} + onkeydown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + handleDeferralClick(e as unknown as MouseEvent); + } }} > {deferralNaddr}
{/if} - {#if showPublicationLink} -
- -
- {/if} - {#if event.content} -
+ + {#if showContent && event.content} +
{clippedContent(event.content)}
{/if} {/if}
+ + + {#if showPublicationLink && event.kind !== 0} +
+ +
+ {/if} diff --git a/src/lib/snippets/UserSnippets.svelte b/src/lib/snippets/UserSnippets.svelte index c687b73..ad4f505 100644 --- a/src/lib/snippets/UserSnippets.svelte +++ b/src/lib/snippets/UserSnippets.svelte @@ -19,7 +19,7 @@ {@const p = profile as UserProfile}