Files
packager/ui/src/App.svelte

31 lines
762 B
Svelte
Raw Normal View History

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 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 == "/") {
window.location.replace("/lists/");
} 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>