From 4966a3ac4589019ecccbfbc67a17dbabdae0221b Mon Sep 17 00:00:00 2001 From: Danny Morabito Date: Thu, 5 Dec 2024 21:51:12 +0100 Subject: [PATCH] fix for #3 note to self: get rid of svelte and other frameworks they always cause more problems than they solve --- src/components/LetterPreview.svelte | 4 +- src/components/NostrIdentifier.svelte | 155 ++++++++++---------------- src/lib/utils.svelte.ts | 66 +++++++++++ src/routes/+page.svelte | 14 --- 4 files changed, 125 insertions(+), 114 deletions(-) diff --git a/src/components/LetterPreview.svelte b/src/components/LetterPreview.svelte index bdc72ca..aec1634 100644 --- a/src/components/LetterPreview.svelte +++ b/src/components/LetterPreview.svelte @@ -51,7 +51,9 @@ {/each} {:else if letter.from} - + {#key letter.from.npub} + + {/key} {/if}
diff --git a/src/components/NostrIdentifier.svelte b/src/components/NostrIdentifier.svelte index 8b7c5b8..694e346 100644 --- a/src/components/NostrIdentifier.svelte +++ b/src/components/NostrIdentifier.svelte @@ -1,125 +1,82 @@ -
-
- {#if isLoading} - - {:else if avatarUrl} - User avatar +{#if emailAddress} +
+
+ +
+ + {emailAddress} + +
+{:else} +
+
+ {#await getAvatarForUser()} + + {:then avatarUrl} + {#if avatarUrl} + User avatar + {:else} + + {/if} + {/await} +
+ {#if npub !== displayString} + + {displayString} + {:else} - + {displayString} {/if}
- {#if npub !== displayString} - - {displayString} - - {:else} - {displayString} - {/if} + {@render extraButtons?.()} -
+{/if}