aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/thread
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-20 00:05:30 -0800
committerAdam Soltys <[email protected]>2025-01-20 00:05:33 -0800
commit494fa791c93297917cf3247b561d736934de805c (patch)
treeb92bbbabe7eed8cde7b9d251cfcb08221689cc83 /src/routes/(app)/thread
parent684d5fe5643d481c4904a1323ae0a257c267b87b (diff)
downloadcoinos-ui-494fa791c93297917cf3247b561d736934de805c.tar.gz
coinos-ui-494fa791c93297917cf3247b561d736934de805c.zip
nostr routes
Diffstat (limited to 'src/routes/(app)/thread')
-rw-r--r--src/routes/(app)/thread/[id]/+page.server.ts12
-rw-r--r--src/routes/(app)/thread/[id]/+page.svelte16
2 files changed, 28 insertions, 0 deletions
diff --git a/src/routes/(app)/thread/[id]/+page.server.ts b/src/routes/(app)/thread/[id]/+page.server.ts
new file mode 100644
index 00000000..931e9cb8
--- /dev/null
+++ b/src/routes/(app)/thread/[id]/+page.server.ts
@@ -0,0 +1,12 @@
+import { get } from "$lib/utils";
+import { error } from "@sveltejs/kit";
+
+export async function load({ params }) {
+ try {
+ const thread = await get(`/thread/${params.id}`);
+ return { thread };
+ } catch (e) {
+ console.log(e);
+ error(500, { message: "Failed to get thread" });
+ }
+}
diff --git a/src/routes/(app)/thread/[id]/+page.svelte b/src/routes/(app)/thread/[id]/+page.svelte
new file mode 100644
index 00000000..25c911fc
--- /dev/null
+++ b/src/routes/(app)/thread/[id]/+page.svelte
@@ -0,0 +1,16 @@
+<script>
+ import Event from "$comp/Event.svelte";
+
+ let { data } = $props();
+ let { thread } = $derived(data);
+</script>
+
+<div class="container px-4 max-w-xl mx-auto space-y-5">
+ <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold">
+ Thread
+ </h1>
+
+ {#each thread as event}
+ <Event {event} />
+ {/each}
+</div>