From 448cdc13e989f038f4e265a47eca7a1e00a98042 Mon Sep 17 00:00:00 2001 From: gsovereignty Date: Fri, 19 Apr 2024 12:52:22 +1200 Subject: [PATCH] problem: menu looks shit --- src/lib/components/Button.svelte | 6 + src/lib/components/ChatLayout.svelte | 47 ++++--- src/lib/components/EntriesList.svelte | 72 ---------- src/lib/components/EntryCard.svelte | 130 ------------------ .../components/EntryCardSupportFooter.svelte | 92 ------------- src/lib/components/EventContent.svelte | 14 -- src/lib/components/Filters.svelte | 0 src/lib/components/LoginButton.svelte | 7 +- src/lib/components/TopicEntriesList.svelte | 48 ------- .../components/TopicEntriesListItem.svelte | 36 ----- 10 files changed, 33 insertions(+), 419 deletions(-) create mode 100644 src/lib/components/Button.svelte delete mode 100644 src/lib/components/EntriesList.svelte delete mode 100644 src/lib/components/EntryCard.svelte delete mode 100644 src/lib/components/EntryCardSupportFooter.svelte delete mode 100644 src/lib/components/EventContent.svelte delete mode 100644 src/lib/components/Filters.svelte delete mode 100644 src/lib/components/TopicEntriesList.svelte delete mode 100644 src/lib/components/TopicEntriesListItem.svelte diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte new file mode 100644 index 0000000..105bedf --- /dev/null +++ b/src/lib/components/Button.svelte @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/src/lib/components/ChatLayout.svelte b/src/lib/components/ChatLayout.svelte index 1542555..7c8325f 100644 --- a/src/lib/components/ChatLayout.svelte +++ b/src/lib/components/ChatLayout.svelte @@ -4,39 +4,44 @@ import { toggleMode } from 'mode-watcher'; import { Home, Moon, QuestionMark, Sun } from 'radix-icons-svelte'; import LoginButton from './LoginButton.svelte'; - import { Button } from './ui/button'; import { Input } from './ui/input'; - import { FaucetSolid, GearSolid, ListCheckSolid, PodcastSolid, ToolboxSolid } from 'svelte-awesome-icons'; + import { + CircleQuestionSolid, + FaucetSolid, + GearSolid, + ListCheckSolid, + PodcastSolid, + ToolboxSolid + } from 'svelte-awesome-icons'; + import Button from './Button.svelte';
- - + + + + + - {goto(`${base}/debug`)}}> - {goto(`${base}/marcus`)}} + >
- import { ndk } from "@/ndk"; - import { minimumScore, wot, wotFilter } from "@/stores/wot"; - import type { NDKEvent } from "@nostr-dev-kit/ndk"; - import type { NDKEventStore } from "@nostr-dev-kit/ndk-svelte"; - import { Avatar } from "@nostr-dev-kit/ndk-svelte-components"; - import { derived } from "svelte/store"; - - export let entries: NDKEventStore; - export let entriesVisible = 0; - export let entriesNotVisible = 0; - - const entriesByTopic = derived([entries, wotFilter, minimumScore], ([$entries]) => { - entriesVisible = 0; - entriesNotVisible = 0; - - const byDtag: Record = {}; - $entries.forEach((entry) => { - const dTag = entry.dTag; - const pubkey = entry.pubkey; - const deferred = entry.getMatchingTags("a").some(t => t[3] === "defer"); - - if (!dTag) return; - if (deferred) return; - - // if we are filtering by wot, we need to check if the pubkey is in the wot - if ($wotFilter && !$wot.has(pubkey)) { - entriesNotVisible++; - return; - } - - entriesVisible++; - - if (!byDtag[dTag]) byDtag[dTag] = []; - - byDtag[dTag].push(entry); - }); - - return byDtag; - }); - - -
-{#each Object.entries($entriesByTopic) as [topic, entries], i (topic)} -
- - {topic} -
- {Array.from(new Set( - entries.map((entry) => entry.relay?.url).filter(r => r) - )).join(", ")} -
-
- -
- {#each Array.from(entries) as entry (entry.pubkey)} - - {/each} -
- -
-{/each} -
- \ No newline at end of file diff --git a/src/lib/components/EntryCard.svelte b/src/lib/components/EntryCard.svelte deleted file mode 100644 index dfb57d5..0000000 --- a/src/lib/components/EntryCard.svelte +++ /dev/null @@ -1,130 +0,0 @@ - - -
-
- {#if !skipTitle} -
-

{title}

- -
- -
-
- {/if} -
- - - - - - {(new Date(event.created_at*1000)).toLocaleDateString()} - -
- {$reactions.length} reactions -
- - {#if fork} - - Forked from - - - {#if $currentUser?.pubkey === event.pubkey} - - {/if} - {/if} -
-
- - {#if event.pubkey === $currentUser?.pubkey && $incomingPullRequests.length > 0} -
-
- {$incomingPullRequests.length} incoming pull requests -
- - {#each $incomingPullRequests as pr} - - - - - {/each} -
- {/if} - -
- -
-
- -{#if $currentUser && $currentUser.pubkey !== event.pubkey} - -{/if} \ No newline at end of file diff --git a/src/lib/components/EntryCardSupportFooter.svelte b/src/lib/components/EntryCardSupportFooter.svelte deleted file mode 100644 index fe79c63..0000000 --- a/src/lib/components/EntryCardSupportFooter.svelte +++ /dev/null @@ -1,92 +0,0 @@ - - -
- -
-
- {#if $currentUserEntry && !userDefersToEntry} -
- -
- Do you consider this version to be better than yours for {event.dTag}? - - You can remove your entry and defer to this one as the correct one - -
-
- {:else if userDefersToEntry} -
- -
- You have deferred to this entry for {event.dTag} - - This helps your network to find the correct information - -
-
- {:else} -
- -
- Is this the right entry for {event.dTag}? - - This helps your network to find the correct information - - -
-
- {/if} -
-
\ No newline at end of file diff --git a/src/lib/components/EventContent.svelte b/src/lib/components/EventContent.svelte deleted file mode 100644 index 33cdd40..0000000 --- a/src/lib/components/EventContent.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - -
- {@html md.render(event.content)} -
diff --git a/src/lib/components/Filters.svelte b/src/lib/components/Filters.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/src/lib/components/LoginButton.svelte b/src/lib/components/LoginButton.svelte index f00e5f3..c65d00a 100644 --- a/src/lib/components/LoginButton.svelte +++ b/src/lib/components/LoginButton.svelte @@ -1,9 +1,10 @@ - \ No newline at end of file diff --git a/src/lib/components/TopicEntriesList.svelte b/src/lib/components/TopicEntriesList.svelte deleted file mode 100644 index 8978df4..0000000 --- a/src/lib/components/TopicEntriesList.svelte +++ /dev/null @@ -1,48 +0,0 @@ - - -
-{#each $entriesToRender as entry, i (entry.id)} -
- -
-{/each} -
\ No newline at end of file diff --git a/src/lib/components/TopicEntriesListItem.svelte b/src/lib/components/TopicEntriesListItem.svelte deleted file mode 100644 index 09a5fdc..0000000 --- a/src/lib/components/TopicEntriesListItem.svelte +++ /dev/null @@ -1,36 +0,0 @@ - - - \ No newline at end of file