From 19d00412150db786d8442a8441aaae68c931a614 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Tue, 21 Nov 2023 16:18:17 -0800 Subject: [PATCH] Tidy up feed controls --- src/app/shared/FeedControls.svelte | 95 ++++++++++++++---------------- src/app/views/Feeds.svelte | 2 +- src/util/notes.ts | 6 +- 3 files changed, 48 insertions(+), 55 deletions(-) diff --git a/src/app/shared/FeedControls.svelte b/src/app/shared/FeedControls.svelte index 5b8381bd..e2cc7c08 100644 --- a/src/app/shared/FeedControls.svelte +++ b/src/app/shared/FeedControls.svelte @@ -176,11 +176,11 @@ }) const open = () => { - modal = "maxi" + isOpen = true } const onEscape = () => { - modal = null + isOpen = false } const submit = () => { @@ -188,7 +188,7 @@ applyFilter() } - let modal = null + let isOpen = false let scopeOptions = [] let _filter: { kinds?: Kind[] @@ -211,17 +211,12 @@
-
-
+
+
Show replies
- { - modal = modal ? null : "mini" - }} /> - +
{#if parts.length > 0 || relays.length > 0} @@ -239,8 +234,8 @@ {/if}
-{#if modal} - +{#if isOpen} +
@@ -250,48 +245,46 @@
- {#if modal === "maxi"} -
-
- Since - -
-
- Until - -
+
+
+ Since +
- Kinds - -
{item.label} (kind {item.kind})
-
+ Until +
-
- Authors - - {#if Array.isArray(_filter.authors)} - - {/if} -
-
- Topics - -
-
- #{item.name} -
+
+
+ Kinds + +
{item.label} (kind {item.kind})
+
+
+
+ Authors + + {#if Array.isArray(_filter.authors)} + + {/if} +
+
+ Topics + +
+
+ #{item.name}
- -
-
- Mentions - -
- {/if} +
+
+
+
+ Mentions + +
Apply Filters
diff --git a/src/app/views/Feeds.svelte b/src/app/views/Feeds.svelte index 0dd115b7..d06075f9 100644 --- a/src/app/views/Feeds.svelte +++ b/src/app/views/Feeds.svelte @@ -64,7 +64,7 @@ {#if $canSign} {#if $userLists.length > 0} - +
diff --git a/src/util/notes.ts b/src/util/notes.ts index 541bbe69..490e2fc1 100644 --- a/src/util/notes.ts +++ b/src/util/notes.ts @@ -20,7 +20,7 @@ export const urlIsMedia = (url: string) => export const parseContent = ({content, tags = []}: {content: string; tags?: string[][]}) => { const result: any[] = [] - let text = content.trim() || new Tags(tags).getValue('alt') || "" + let text = content.trim() || new Tags(tags).getValue("alt") || "" let buffer = "" const parseNewline = () => { @@ -59,7 +59,7 @@ export const parseContent = ({content, tags = []}: {content: string; tags?: stri } const parseTopic = () => { - const topic = first(text.match(/^#\w+/i)) + const topic: string = first(text.match(/^#\w+/i)) // Skip numeric topics if (topic && !topic.match(/^#\d+$/)) { @@ -100,7 +100,7 @@ export const parseContent = ({content, tags = []}: {content: string; tags?: stri } const parseUrl = () => { - const raw = first( + const raw: string = first( text.match(/^([a-z\+:]{2,30}:\/\/)?[^<>\(\)\s]+\.[a-z]{2,6}[^\s]*[^<>"'\.!?,:\s]/gi) )