Masahiko AMANO 7770960cbf feat(frontend): add root layout with auth guard and bottom navbar
Adds +layout.ts auth guard (redirects to /login when no token).
Adds bottom navbar with inline SVGs for Categories/Tags/Files/Pools/
Settings, active-route highlight (#343249), muted-to-bright color
transition. Adds theme store (dark/light, persisted to localStorage,
applies data-theme attribute). Hides navbar on /login route.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 03:21:00 +03:00

17 lines
404 B
TypeScript

import { get } from 'svelte/store';
import { redirect } from '@sveltejs/kit';
import { browser } from '$app/environment';
import { authStore } from '$lib/stores/auth';
export const ssr = false;
export const load = ({ url }: { url: URL }) => {
if (!browser) return;
if (url.pathname === '/login') return;
const { accessToken } = get(authStore);
if (!accessToken) {
redirect(307, '/login');
}
};