2021-09-06 15:43:30 +02:00
|
|
|
<svelte:head>
|
|
|
|
|
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
|
|
|
|
|
</svelte:head>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-09-06 18:08:52 +02:00
|
|
|
import PackageLists from "./routes/PackageLists.svelte";
|
2021-09-06 18:11:51 +02:00
|
|
|
import Home from "./routes/Home.svelte";
|
2021-09-06 15:43:30 +02:00
|
|
|
|
2021-09-06 18:08:52 +02:00
|
|
|
$: {
|
|
|
|
|
const path = window.location.pathname;
|
|
|
|
|
console.log(`Routing ${path}`);
|
|
|
|
|
|
|
|
|
|
let component;
|
|
|
|
|
|
|
|
|
|
if (path == "/") {
|
2021-09-06 18:11:51 +02:00
|
|
|
compontent = Home;
|
2021-09-06 18:08:52 +02:00
|
|
|
} else if (path == "/lists/") {
|
|
|
|
|
console.log("Routing to package lists");
|
|
|
|
|
component = PackageLists;
|
|
|
|
|
} else if (path.startswith("/lists/")) {
|
|
|
|
|
console.log("hm");
|
|
|
|
|
} else {
|
|
|
|
|
console.log("No matching route found");
|
|
|
|
|
}
|
2021-09-06 15:43:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<main>
|
2021-09-06 18:08:52 +02:00
|
|
|
<svelte:component this={component} />
|
2021-09-06 15:43:30 +02:00
|
|
|
</main>
|