From 0a15170757e4d7809dc76d9f5c431fe10278caae Mon Sep 17 00:00:00 2001 From: Jonathan Staab Date: Wed, 28 Jun 2023 13:33:54 -0700 Subject: [PATCH] Fix anchor styling --- CHANGELOG.md | 8 +++++++ src/agent/user.ts | 6 +---- src/app/shared/Note.svelte | 4 ++-- src/app/shared/NoteContentEntity.svelte | 2 +- src/app/shared/NoteContentKind1985.svelte | 3 ++- src/app/shared/NoteContentLink.svelte | 2 +- src/app/shared/NoteContentPerson.svelte | 2 +- src/app/shared/NoteContentQuote.svelte | 2 +- src/app/shared/NoteContentRating.svelte | 2 +- src/app/shared/NoteContentTopic.svelte | 2 +- src/app/shared/PersonAbout.svelte | 4 ++-- src/app/shared/PersonInfo.svelte | 17 ++++++++------ src/app/shared/PersonSummary.svelte | 2 +- src/app/shared/RelayCard.svelte | 2 +- src/app/views/ChatDetail.svelte | 2 +- src/app/views/Feeds.svelte | 2 +- src/app/views/ListList.svelte | 2 +- src/app/views/Login.svelte | 11 ++++----- src/app/views/LoginConnect.svelte | 4 ++-- src/app/views/MessagesDetail.svelte | 2 +- src/app/views/NaddrDetail.svelte | 27 ++++++++++++++--------- src/app/views/NoteZap.svelte | 2 +- src/app/views/OnboardingFollows.svelte | 2 +- src/app/views/OnboardingIntro.svelte | 6 ++--- src/app/views/OnboardingKey.svelte | 2 +- src/app/views/OnboardingNote.svelte | 2 +- src/app/views/OnboardingProfile.svelte | 2 +- src/app/views/OnboardingRelays.svelte | 2 +- src/app/views/PersonFeed.svelte | 2 +- src/app/views/UserProfile.svelte | 9 ++++---- src/partials/Anchor.svelte | 2 +- 31 files changed, 77 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 041c72d8..9a3f1e69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +# 0.2.34 + +- [x] Fix mentions on Safari +- [x] Fix quoted 30023 events +- [x] Fix Safari performance issues +- [x] Small note display bugfixes +- [x] Fix inability to publish on first signup + # 0.2.33 - [x] Add rendering support for kind 1985 (labels and reviews) diff --git a/src/agent/user.ts b/src/agent/user.ts index 418ee595..8a42a83c 100644 --- a/src/agent/user.ts +++ b/src/agent/user.ts @@ -6,7 +6,6 @@ import { without, reject, prop, - find, pipe, assoc, whereEq, @@ -53,10 +52,7 @@ const relays = derived(profile, p => const mutes = derived(profile, prop("mutes")) as Readable> const lists = derived(profile, prop("lists")) as Readable> -const canPublish = derived( - [keys.pubkey, relays], - ([$pubkey, $relays]) => keys.canSign() && find(prop("write"), $relays) -) +const canPublish = derived([keys.pubkey], ([$pubkey]) => keys.canSign()) // Keep a copy so we can avoid calling `get` all the time diff --git a/src/app/shared/Note.svelte b/src/app/shared/Note.svelte index 30ea2e42..dc1b478d 100644 --- a/src/app/shared/Note.svelte +++ b/src/app/shared/Note.svelte @@ -151,13 +151,13 @@ {#if findReplyId(note) && showParent} - View Parent + View Parent {/if} {#if findRootId(note) && findRootId(note) !== findReplyId(note) && showParent} - View Thread + View Thread {/if} diff --git a/src/app/shared/NoteContentEntity.svelte b/src/app/shared/NoteContentEntity.svelte index d5c8402f..bbce2f0a 100644 --- a/src/app/shared/NoteContentEntity.svelte +++ b/src/app/shared/NoteContentEntity.svelte @@ -4,6 +4,6 @@ export let value - + {value.entity.slice(0, 16) + "..."} diff --git a/src/app/shared/NoteContentKind1985.svelte b/src/app/shared/NoteContentKind1985.svelte index 24fe84c5..423fac33 100644 --- a/src/app/shared/NoteContentKind1985.svelte +++ b/src/app/shared/NoteContentKind1985.svelte @@ -1,4 +1,5 @@
- {#if rating} + {#if !isNil(rating)} {/if} diff --git a/src/app/shared/NoteContentLink.svelte b/src/app/shared/NoteContentLink.svelte index 287455db..89044da5 100644 --- a/src/app/shared/NoteContentLink.svelte +++ b/src/app/shared/NoteContentLink.svelte @@ -18,7 +18,7 @@
{:else} - + {value.url.replace(/https?:\/\/(www\.)?/, "")} {/if} diff --git a/src/app/shared/NoteContentPerson.svelte b/src/app/shared/NoteContentPerson.svelte index 3a3cdfd6..b68eeb7b 100644 --- a/src/app/shared/NoteContentPerson.svelte +++ b/src/app/shared/NoteContentPerson.svelte @@ -9,6 +9,6 @@ const openPerson = () => modal.push({type: "person/feed", pubkey: value.pubkey}) -@ +@ {displayPerson(getPersonWithFallback(value.pubkey))} diff --git a/src/app/shared/NoteContentQuote.svelte b/src/app/shared/NoteContentQuote.svelte index aca7b679..b96afae8 100644 --- a/src/app/shared/NoteContentQuote.svelte +++ b/src/app/shared/NoteContentQuote.svelte @@ -59,7 +59,7 @@ {#if muted}

You have muted this note. - Show + Show

{:else} {@const person = getPersonWithFallback(quote.pubkey)} diff --git a/src/app/shared/NoteContentRating.svelte b/src/app/shared/NoteContentRating.svelte index 1dcf0a3c..fff1093c 100644 --- a/src/app/shared/NoteContentRating.svelte +++ b/src/app/shared/NoteContentRating.svelte @@ -29,7 +29,7 @@
Rated {#if action} - {display} + {display} {:else} {display} {/if} diff --git a/src/app/shared/NoteContentTopic.svelte b/src/app/shared/NoteContentTopic.svelte index 98aa7f68..0a665f1c 100644 --- a/src/app/shared/NoteContentTopic.svelte +++ b/src/app/shared/NoteContentTopic.svelte @@ -9,4 +9,4 @@ } - openTopic(value)}>#{value} + openTopic(value)}>#{value} diff --git a/src/app/shared/PersonAbout.svelte b/src/app/shared/PersonAbout.svelte index 7424b4c0..843a1409 100644 --- a/src/app/shared/PersonAbout.svelte +++ b/src/app/shared/PersonAbout.svelte @@ -19,11 +19,11 @@
{/each} {:else if type === "link"} - + {value.url.replace(/https?:\/\/(www\.)?/, "")} {:else if type.startsWith("nostr:")} - + {#if value.pubkey} {displayPerson(getPersonWithFallback(value.pubkey))} {:else if value.id} diff --git a/src/app/shared/PersonInfo.svelte b/src/app/shared/PersonInfo.svelte index a5d71151..e6c17119 100644 --- a/src/app/shared/PersonInfo.svelte +++ b/src/app/shared/PersonInfo.svelte @@ -9,7 +9,7 @@ import {getPubkeyWriteRelays, sampleRelays} from "src/agent/relays" import user from "src/agent/user" - const {petnames} = user + const {petnames, canPublish} = user export let person export let hasPetname = null @@ -45,12 +45,15 @@
{/if} - {#if isFollowing} - removePetname(person)}> - Following - - {:else} - addPetname(person)}>Follow + {#if $canPublish} + {#if isFollowing} + removePetname(person)}> + Following + + {:else} + addPetname(person)} + >Follow + {/if} {/if}

diff --git a/src/app/shared/PersonSummary.svelte b/src/app/shared/PersonSummary.svelte index 0659ba73..edac319d 100644 --- a/src/app/shared/PersonSummary.svelte +++ b/src/app/shared/PersonSummary.svelte @@ -34,7 +34,7 @@

- +

{displayPerson($person)}

diff --git a/src/app/shared/RelayCard.svelte b/src/app/shared/RelayCard.svelte index 1612816c..b10b5cb2 100644 --- a/src/app/shared/RelayCard.svelte +++ b/src/app/shared/RelayCard.svelte @@ -63,7 +63,7 @@
- {displayRelay(relay)} + {displayRelay(relay)} {#if showStatus} { diff --git a/src/app/views/ChatDetail.svelte b/src/app/views/ChatDetail.svelte index c745a525..7dcf84cc 100644 --- a/src/app/views/ChatDetail.svelte +++ b/src/app/views/ChatDetail.svelte @@ -47,7 +47,7 @@
- +
diff --git a/src/app/views/Feeds.svelte b/src/app/views/Feeds.svelte index ac36bc18..7eff511c 100644 --- a/src/app/views/Feeds.svelte +++ b/src/app/views/Feeds.svelte @@ -57,7 +57,7 @@

Don't have an account?

- Click here to join the nostr network. + Click here to join the nostr network.

{/if} diff --git a/src/app/views/ListList.svelte b/src/app/views/ListList.svelte index af70c75b..3a6d8bc0 100644 --- a/src/app/views/ListList.svelte +++ b/src/app/views/ListList.svelte @@ -48,7 +48,7 @@ {meta.d}
- editList(e)}>Edit + editList(e)}>Edit
{:else} diff --git a/src/app/views/Login.svelte b/src/app/views/Login.svelte index d70cd209..f436da69 100644 --- a/src/app/views/Login.svelte +++ b/src/app/views/Login.svelte @@ -46,16 +46,17 @@

Click below to log in or create an account. {#if !Capacitor.isNativePlatform()} - If you have a compatible browser extension installed, - we will use that. + If you have a compatible browser extension installed, we will use that. {/if}

- Log In - Sign Up + Log In + Sign Up
- + Advanced Login
diff --git a/src/app/views/LoginConnect.svelte b/src/app/views/LoginConnect.svelte index 2c007b72..b9304aa8 100644 --- a/src/app/views/LoginConnect.svelte +++ b/src/app/views/LoginConnect.svelte @@ -150,8 +150,8 @@
We didn't have any luck finding your profile data - you'll need to select your relays manually to continue. You can skip this step by clicking - here, but be aware that any new relay selections will - replace your old ones. + here, but be aware that any new relay + selections will replace your old ones.
{:else if modal === "custom"}
diff --git a/src/app/views/MessagesDetail.svelte b/src/app/views/MessagesDetail.svelte index 22a7233b..a2ec99fe 100644 --- a/src/app/views/MessagesDetail.svelte +++ b/src/app/views/MessagesDetail.svelte @@ -82,7 +82,7 @@
- + {displayPerson($person)}
diff --git a/src/app/views/NaddrDetail.svelte b/src/app/views/NaddrDetail.svelte index 561f7e2c..d1d25db6 100644 --- a/src/app/views/NaddrDetail.svelte +++ b/src/app/views/NaddrDetail.svelte @@ -2,7 +2,7 @@ import {onMount} from "svelte" import {first, quantify} from "hurdak/lib/hurdak" import {displayPerson} from "src/util/nostr" - import {routes} from 'src/app/state' + import {routes} from "src/app/state" import Content from "src/partials/Content.svelte" import Anchor from "src/partials/Anchor.svelte" import NoteContent from "src/app/shared/NoteContent.svelte" @@ -20,10 +20,12 @@ let loading = true onMount(async () => { - note = first(await network.load({ - relays: sampleRelays(relays), - filter: {kinds: [kind], pubkey, '#d': [identifier]}, - })) + note = first( + await network.load({ + relays: sampleRelays(relays), + filter: {kinds: [kind], pubkey, "#d": [identifier]}, + }) + ) loading = false }) @@ -32,23 +34,26 @@

This is a kind {kind} event called "{identifier}", published by - @{displayPerson(getPersonWithFallback(pubkey))}. + @{displayPerson(getPersonWithFallback(pubkey))}.

{#if note?.content} {/if} {#if note?.tags.length > 1} -

This note has {quantify(note.tags.length - 1, 'tag')}:

-
    +

    This note has {quantify(note.tags.length - 1, "tag")}:

    +
      {#each note.tags as [type, value, ...rest]} {#if type !== "d"}
    • {#if type === "p"} - @{displayPerson(getPersonWithFallback(value))} + @{displayPerson(getPersonWithFallback(value))} {:else if type === "e"} - Event {value} + Event {value} {:else} - {type}: {value} {rest.length > 0 ? rest.join(', ') : ""} + {type}: {value} {rest.length > 0 ? rest.join(", ") : ""} {/if}
    • {/if} diff --git a/src/app/views/NoteZap.svelte b/src/app/views/NoteZap.svelte index 7d112b14..d9070f10 100644 --- a/src/app/views/NoteZap.svelte +++ b/src/app/views/NoteZap.svelte @@ -112,7 +112,7 @@ sats - Zap! + Zap!
{/if} diff --git a/src/app/views/OnboardingFollows.svelte b/src/app/views/OnboardingFollows.svelte index 1de7b471..abe4cd7f 100644 --- a/src/app/views/OnboardingFollows.svelte +++ b/src/app/views/OnboardingFollows.svelte @@ -38,7 +38,7 @@ your follows list at any time.

modal.replace({type: "onboarding", stage: "note"})}> Continue diff --git a/src/app/views/OnboardingIntro.svelte b/src/app/views/OnboardingIntro.svelte index 867b5393..d60f4ac7 100644 --- a/src/app/views/OnboardingIntro.svelte +++ b/src/app/views/OnboardingIntro.svelte @@ -11,8 +11,8 @@ Create an Account

- New to Nostr? Click here or watch the video below for - a crash course on what it is, and how to use it. + New to Nostr? Click here or watch + the video below for a crash course on what it is, and how to use it.

Say Hello! - + Skip and see your feed diff --git a/src/app/views/OnboardingProfile.svelte b/src/app/views/OnboardingProfile.svelte index 027e9e1a..36020ff5 100644 --- a/src/app/views/OnboardingProfile.svelte +++ b/src/app/views/OnboardingProfile.svelte @@ -38,7 +38,7 @@
modal.replace({type: "onboarding", stage: "key"})}> Continue diff --git a/src/app/views/OnboardingRelays.svelte b/src/app/views/OnboardingRelays.svelte index c2ec2d5f..1b1da6a5 100644 --- a/src/app/views/OnboardingRelays.svelte +++ b/src/app/views/OnboardingRelays.svelte @@ -34,7 +34,7 @@

modal.replace({type: "onboarding", stage: "follows"})}> Continue diff --git a/src/app/views/PersonFeed.svelte b/src/app/views/PersonFeed.svelte index 907efdab..291af617 100644 --- a/src/app/views/PersonFeed.svelte +++ b/src/app/views/PersonFeed.svelte @@ -46,7 +46,7 @@
- +

{displayPerson($person)}

diff --git a/src/app/views/UserProfile.svelte b/src/app/views/UserProfile.svelte index 10e025fc..7fed5ec2 100644 --- a/src/app/views/UserProfile.svelte +++ b/src/app/views/UserProfile.svelte @@ -43,7 +43,7 @@

Give people a friendly way to recognize you. We recommend you do not use your real name or share your personal information. The future of the internet is - pseudonymous. + pseudonymous.

@@ -63,7 +63,8 @@

- Enter a NIP-05 address to verify your public key. + Enter a NIP-05 address to verify + your public key.

@@ -72,8 +73,8 @@

- Enter a LUD-16 address to enable sending and receiving - lightning tips (LUD-06 will also work). + Enter a LUD-16 address to enable + sending and receiving lightning tips (LUD-06 will also work).

diff --git a/src/partials/Anchor.svelte b/src/partials/Anchor.svelte index 2b00262b..5e860162 100644 --- a/src/partials/Anchor.svelte +++ b/src/partials/Anchor.svelte @@ -9,7 +9,7 @@ export let killEvent = false export let external = false export let loading = false - export let theme = "anchor" + export let theme = "unstyled" export let type = null export let href = null export let tag = "a"