Clean up components

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2023-01-31 09:45:55 +01:00
parent 9fae5ebb33
commit e04c792caf
18 changed files with 43 additions and 220 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import Icon from "@app/components/Icon.svelte";
import Toggle from "@app/components/Toggle.svelte";
import ToggleSwitch from "@app/components/ToggleSwitch.svelte";
import { theme, storeTheme } from "@app/lib/appearance";
$: document.documentElement.setAttribute("data-theme", $theme);
@@ -19,7 +19,7 @@
<div class="theme">
<Icon name="sun" on:click={() => theme.set("light")} />
<Toggle
<ToggleSwitch
checked={$theme === "dark"}
on:change={() => {
theme.set($theme === "dark" ? "light" : "dark");