From fddde9424be48175f3f3891849fb4a79549ca157 Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Thu, 23 Mar 2023 16:49:57 +0100 Subject: [PATCH] Better routing with conditions --- src/App.svelte | 36 ++++++++++++++++++++++++++++++------ src/routes.ts | 12 ------------ 2 files changed, 30 insertions(+), 18 deletions(-) delete mode 100644 src/routes.ts diff --git a/src/App.svelte b/src/App.svelte index ed314c9..192ac00 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,18 +1,42 @@ @@ -25,7 +49,7 @@
{#key $location} - + replace('/')}/> {/key}
diff --git a/src/routes.ts b/src/routes.ts deleted file mode 100644 index 7aec907..0000000 --- a/src/routes.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Home from './lib/Home.svelte' -import Chat from './lib/Chat.svelte' -import NewChat from './lib/NewChat.svelte' - -export default { - '/': Home, - - '/chat/new': NewChat, - '/chat/:chatId': Chat, - - '*': Home -}