From 03c2e5c5dba80d8191d0550a503e767f384515db Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 8 Jun 2024 15:56:23 +0300 Subject: [PATCH] idk tweaks --- src/routes/+layout.svelte | 3 --- src/routes/+layout.ts | 16 +++++++++++----- src/routes/device/+page.svelte | 9 +++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ea152e2..c3bace0 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,8 +1,5 @@ diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 9cde7a6..98d9ef4 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -1,11 +1,17 @@ +import { browser } from '$app/environment'; import { loadTranslations } from '$lib/i18n'; +import { themeMode } from '$lib/theme-mode'; export const load = async ({ url }) => { - const { pathname } = url; + const { pathname } = url; - const initLocale = 'en'; // get from cookie, user session, ... + const initLocale = 'en'; // get from cookie, user session, ... - await loadTranslations(initLocale, pathname); + if (browser) { + themeMode.subscribe((value) => document.documentElement.setAttribute('theme-base', value)); + } - return {}; -} + await loadTranslations(initLocale, pathname); + + return {}; +}; diff --git a/src/routes/device/+page.svelte b/src/routes/device/+page.svelte index 88b860e..89bf1e9 100644 --- a/src/routes/device/+page.svelte +++ b/src/routes/device/+page.svelte @@ -2,6 +2,7 @@ import type { ActionData, PageData } from './$types'; import { env } from '$env/dynamic/public'; import { t } from '$lib/i18n'; + import { enhance } from '$app/forms'; import Alert from '$lib/components/Alert.svelte'; import Button from '$lib/components/Button.svelte'; import MainContainer from '$lib/components/container/MainContainer.svelte'; @@ -36,13 +37,13 @@
-
+
-
+ @@ -54,9 +55,9 @@

{$t('oauth2.device.title')}

{$t('oauth2.device.description')}

- + - +