Private
Public Access
26 lines
584 B
Svelte
26 lines
584 B
Svelte
<script lang="ts">
|
|
import './layout.css';
|
|
import 'carbon-components-svelte/css/all.css';
|
|
import favicon from '$lib/assets/favicon.svg';
|
|
import { getToken } from '$lib/api';
|
|
import { goto } from '$app/navigation';
|
|
|
|
let { children } = $props();
|
|
let theme = 'g100'; // "white" | "g10" | "g80" | "g90" | "g100"
|
|
let token = $state(getToken());
|
|
|
|
$effect(() => {
|
|
if (!token) {
|
|
goto('/login');
|
|
}
|
|
});
|
|
|
|
$effect(() => {
|
|
document.documentElement.setAttribute('theme', theme);
|
|
});
|
|
</script>
|
|
|
|
<svelte:head><link rel="icon" href={favicon} /></svelte:head>
|
|
|
|
{@render children()}
|