add frontend skeleton
This commit is contained in:
parent
0c52ebb7bc
commit
a80f89d038
23 changed files with 2110 additions and 3 deletions
12
frontend/src/routes/+layout.server.ts
Normal file
12
frontend/src/routes/+layout.server.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
import request from "$lib/request";
|
||||
|
||||
export async function load({ fetch, cookies }) {
|
||||
const meta = await request("GET", "/meta", { fetchFn: fetch });
|
||||
|
||||
let user;
|
||||
if (cookies.get("pronounscc-token")) {
|
||||
user = await request("GET", "/users/@me", { fetchFn: fetch });
|
||||
}
|
||||
|
||||
return { meta, user };
|
||||
}
|
11
frontend/src/routes/+layout.svelte
Normal file
11
frontend/src/routes/+layout.svelte
Normal file
|
@ -0,0 +1,11 @@
|
|||
<script lang="ts">
|
||||
import "bootstrap/scss/bootstrap.scss";
|
||||
import "bootstrap-icons/font/bootstrap-icons.scss";
|
||||
import type { LayoutData } from "./$types";
|
||||
|
||||
export let data: LayoutData
|
||||
</script>
|
||||
|
||||
{JSON.stringify(data.meta)}
|
||||
|
||||
<slot />
|
2
frontend/src/routes/+page.svelte
Normal file
2
frontend/src/routes/+page.svelte
Normal file
|
@ -0,0 +1,2 @@
|
|||
<h1>Welcome to SvelteKit</h1>
|
||||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
|
Loading…
Add table
Add a link
Reference in a new issue