From 2f56c7b95b790cb61949f241ea75b2e4a6792e0e Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Fri, 16 Aug 2024 08:35:48 -0700 Subject: [PATCH] Allow custom kinds in filters, fix link underline --- src/app/shared/FeedFormSectionKinds.svelte | 12 +++++++++++- src/app/shared/Note.svelte | 4 ++-- src/app/shared/NoteContentLink.svelte | 3 +++ src/app/shared/NoteContentQuote.svelte | 2 +- src/app/shared/NoteContentRating.svelte | 2 +- src/app/shared/NoteContentTopic.svelte | 2 +- src/app/views/Feeds.svelte | 2 +- src/app/views/UserProfile.svelte | 6 +++--- src/partials/Anchor.svelte | 1 + src/partials/SearchSelect.svelte | 2 ++ src/partials/Suggestions.svelte | 3 ++- 11 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/app/shared/FeedFormSectionKinds.svelte b/src/app/shared/FeedFormSectionKinds.svelte index 423e5baf..b14a8622 100644 --- a/src/app/shared/FeedFormSectionKinds.svelte +++ b/src/app/shared/FeedFormSectionKinds.svelte @@ -33,6 +33,10 @@ const onKindsChange = kinds => onChange([FeedType.Kind, ...kinds]) + const termToItem = (s: string) => parseInt(s) + + const termIsValid = (s: string) => !isNaN(parseInt(s)) + const helper = new KindSearch([ {label: "Note", kind: NOTE}, {label: "Profile", kind: PROFILE}, @@ -61,6 +65,12 @@ What kind of content do you want to see? - +
{helper.displayValue(item)}
diff --git a/src/app/shared/Note.svelte b/src/app/shared/Note.svelte index 4fe5a0ec..845531ba 100644 --- a/src/app/shared/Note.svelte +++ b/src/app/shared/Note.svelte @@ -277,13 +277,13 @@ {#if showReply} - View Parent + View Parent {/if} {#if showRoot} - View Thread + View Thread {/if} diff --git a/src/app/shared/NoteContentLink.svelte b/src/app/shared/NoteContentLink.svelte index d04158b4..36205f87 100644 --- a/src/app/shared/NoteContentLink.svelte +++ b/src/app/shared/NoteContentLink.svelte @@ -22,6 +22,7 @@ {#if url.match(coracleRegexp)} @@ -32,6 +33,7 @@ {:else if isShareableRelayUrl(url)} @@ -40,6 +42,7 @@ {:else} You have hidden this note. - Show + Show

{:else} {#if !isGroup} diff --git a/src/app/shared/NoteContentRating.svelte b/src/app/shared/NoteContentRating.svelte index 3701c3bd..726deed6 100644 --- a/src/app/shared/NoteContentRating.svelte +++ b/src/app/shared/NoteContentRating.svelte @@ -38,7 +38,7 @@
Rated {#if href} - {display} + {display} {:else} {display} {/if} diff --git a/src/app/shared/NoteContentTopic.svelte b/src/app/shared/NoteContentTopic.svelte index a8049800..7d38b341 100644 --- a/src/app/shared/NoteContentTopic.svelte +++ b/src/app/shared/NoteContentTopic.svelte @@ -5,6 +5,6 @@ export let value - + #{value} diff --git a/src/app/views/Feeds.svelte b/src/app/views/Feeds.svelte index d4b46fac..e91c894c 100644 --- a/src/app/views/Feeds.svelte +++ b/src/app/views/Feeds.svelte @@ -25,7 +25,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/UserProfile.svelte b/src/app/views/UserProfile.svelte index 4a18a448..6b507294 100644 --- a/src/app/views/UserProfile.svelte +++ b/src/app/views/UserProfile.svelte @@ -54,7 +54,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.

@@ -69,7 +69,7 @@
- Enter a NIP-05 address to verify + Enter a NIP-05 address to verify your public key.
@@ -78,7 +78,7 @@
- Enter a lightning address to enable + Enter a lightning address to enable sending and receiving bitcoin tips.
diff --git a/src/partials/Anchor.svelte b/src/partials/Anchor.svelte index 1c76adbb..a3c99e10 100644 --- a/src/partials/Anchor.svelte +++ b/src/partials/Anchor.svelte @@ -33,6 +33,7 @@ $: className = cx($$props.class, "transition-all cursor-pointer", { underline: underline, + '!no-underline': !underline, "opacity-50 pointer-events-none": loading || disabled, "bg-white text-black hover:bg-white-l": button && !accent && !low, "text-base bg-tinted-700 text-tinted-200 hover:bg-tinted-600 border border-solid border-tinted-600": diff --git a/src/partials/SearchSelect.svelte b/src/partials/SearchSelect.svelte index 436bf33f..a98d3a2b 100644 --- a/src/partials/SearchSelect.svelte +++ b/src/partials/SearchSelect.svelte @@ -14,6 +14,7 @@ export let delimiters = [] export let search = null export let termToItem = null + export let termIsValid = null export let getKey: (x: any) => any = identity export let displayItem = getKey export let autofocus = false @@ -158,6 +159,7 @@ - {#if create && term} + {#if create && term && (!termIsValid || termIsValid(term))} {@const i = data.length}