From 209cd0e2083a2430c92ef8a0739c6ac4876815e8 Mon Sep 17 00:00:00 2001 From: 0nepeop1e Date: Fri, 14 Jun 2024 13:30:40 +0800 Subject: [PATCH] add top layout --- src/App.svelte | 24 ++++++++++++++++++++---- src/{ => lib}/chats.ts | 0 src/lib/url.ts | 3 +++ src/main.ts | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) rename src/{ => lib}/chats.ts (100%) create mode 100644 src/lib/url.ts diff --git a/src/App.svelte b/src/App.svelte index 88aac34..ff972b9 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,13 +1,16 @@
{#each [...$chats].reverse() as chat (`${chat.service}/${chat.data.id}`)} @@ -49,7 +54,8 @@
diff --git a/src/chats.ts b/src/lib/chats.ts similarity index 100% rename from src/chats.ts rename to src/lib/chats.ts diff --git a/src/lib/url.ts b/src/lib/url.ts new file mode 100644 index 0000000..1104ba3 --- /dev/null +++ b/src/lib/url.ts @@ -0,0 +1,3 @@ +import { readable } from 'svelte/store'; + +export const url = readable(new URL(window.location.href)); diff --git a/src/main.ts b/src/main.ts index a658236..d5c58e3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import './app.pcss'; import App from './App.svelte'; import type { Comment } from '@onecomme.com/onesdk/types/Comment'; -import { chats } from './chats'; +import { chats } from './lib/chats'; if (import.meta.env.DEV) { globalThis.OneSDK = (await import('@onecomme.com/onesdk')).default;