add new sveltekit frontend
This commit is contained in:
commit
fc4334932a
40 changed files with 3802 additions and 0 deletions
14
frontend/src/lib/store.ts
Normal file
14
frontend/src/lib/store.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { writable } from "svelte/store";
|
||||
import { browser } from "$app/environment";
|
||||
|
||||
import type { MeUser } from "./api/entities";
|
||||
|
||||
export const userStore = writable<MeUser | null>(null);
|
||||
export const tokenStore = writable<string | null>(null);
|
||||
|
||||
let defaultThemeValue = "dark";
|
||||
const initialThemeValue = browser
|
||||
? window.localStorage.getItem("pronouns-theme") ?? defaultThemeValue
|
||||
: defaultThemeValue;
|
||||
|
||||
export const themeStore = writable<string>(initialThemeValue);
|
||||
Loading…
Add table
Add a link
Reference in a new issue