diff options
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/(app)/settings/nostr/+page.svelte | 3 | ||||
| -rw-r--r-- | src/routes/+layout.svelte | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/routes/(app)/settings/nostr/+page.svelte b/src/routes/(app)/settings/nostr/+page.svelte index 9129e8f3..7168f4f7 100644 --- a/src/routes/(app)/settings/nostr/+page.svelte +++ b/src/routes/(app)/settings/nostr/+page.svelte @@ -172,7 +172,7 @@ onclick={() => copy(npub)} aria-label="Copy" ><iconify-icon noobserver icon="ph:copy-bold" width="32" - ></iconify-icon></button + ></iconify-icon> {$t("accounts.copy")}</button > <a @@ -181,6 +181,7 @@ aria-label="QR" > <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon> +{$t("accounts.qr")} </a> </div> </div> diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 8ae31608..7653e05a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -7,13 +7,21 @@ import { onMount } from "svelte"; import { installPrompt, theme as themeStore } from "$lib/store"; + +const map = { light: 'lofi', dark: 'black', system: 'system' }; + let { data, children } = $props(); let { pathname, theme } = $state(data); $effect(() => ($themeStore = data.theme)); $effect(() => (theme = $themeStore)); - $effect(() => { - document.documentElement.setAttribute("data-theme", theme); - }); +$effect(() => { + const v = map[theme] ?? theme; + if (!v || v === 'system') { + document.documentElement.removeAttribute('data-theme'); + } else { + document.documentElement.setAttribute('data-theme', v); + } +}); let host = PUBLIC_DOMAIN.includes("localhost") ? `http://${PUBLIC_DOMAIN}` |
