Show user badge even if we have no user data

This commit is contained in:
Jonathan Staab 2022-12-06 22:00:05 -08:00
parent 8d033ea6a4
commit aeade5b2b4
3 changed files with 5 additions and 7 deletions

View File

@ -1,5 +1,6 @@
Bugs
- [ ] Pubkeys expand the width of the page, hiding the plus post button
- [ ] Permalink note detail (share/permalink button?)
- [ ] Back button no longer works if a modal is closed normally
- [ ] Prevent tabs from re-mounting (or at least re- animating)
@ -17,7 +18,6 @@ Features
- [ ] Fix replies - notes may only include a "root" in its tags
- [x] Link previews
- [ ] Add notes, follows, likes tab to profile
- [ ] Followers, blocks, likes on profile
- [ ] Notifications
- [ ] Images
- [ ] Server discovery and relay publishing - https://github.com/nostr-protocol/nips/pull/32/files

View File

@ -106,7 +106,7 @@
"border border-solid border-dark hover:border-medium hover:bg-medium": interactive && invertColors,
})}>
<div class="flex gap-4 items-center justify-between">
<UserBadge user={$accounts[note.pubkey]} />
<UserBadge user={{...$accounts[note.pubkey], pubkey: note.pubkey}} />
<p class="text-sm text-light">{formatTimestamp(note.created_at)}</p>
</div>
<div class="ml-6 flex flex-col gap-2">

View File

@ -2,11 +2,9 @@
export let user
</script>
{#if user}
<a href={`/users/${user.pubkey}`} class="flex gap-2 items-center">
<a href={`/users/${user?.pubkey}`} class="flex gap-2 items-center">
<div
class="overflow-hidden w-4 h-4 rounded-full bg-cover bg-center shrink-0 border border-solid border-white"
style="background-image: url({user.picture})" />
<span class="text-lg font-bold">{user.name || user.pubkey.slice(0, 8)}</span>
style="background-image: url({user?.picture})" />
<span class="text-lg font-bold">{user?.name || user?.pubkey.slice(0, 8)}</span>
</a>
{/if}