diff --git a/src/App.tsx b/src/App.tsx
index 5ee1618..b91794f 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -6,6 +6,7 @@ import { appDataDir } from "@tauri-apps/api/path";
import { listen } from "@tauri-apps/api/event";
import { invoke } from "@tauri-apps/api/core";
import historyIcon from "./assets/history.png";
+import historyIconBright from "./assets/history_b.png";
import {
createText,
deleteText,
@@ -89,12 +90,25 @@ export default function App() {
bodyRef.current = body;
}, [body]);
+ useEffect(() => {
+ const storedTheme = localStorage.getItem("textdb.theme");
+ if (storedTheme === "light") {
+ setTheme("light");
+ }
+ const storedSize = Number(localStorage.getItem("textdb.textSize"));
+ if (!Number.isNaN(storedSize) && storedSize >= 12 && storedSize <= 18) {
+ setTextSize(storedSize);
+ }
+ }, []);
+
useEffect(() => {
document.body.dataset.theme = theme;
+ localStorage.setItem("textdb.theme", theme);
}, [theme]);
useEffect(() => {
document.documentElement.style.setProperty("--base-font-size", `${textSize}px`);
+ localStorage.setItem("textdb.textSize", String(textSize));
}, [textSize]);
const isViewingHistory = viewingVersion !== null;
@@ -123,6 +137,9 @@ export default function App() {
}
}, [statusKey]);
+ const historyIconSrc = theme === "light" ? historyIconBright : historyIcon;
+
+
const refreshTexts = useCallback(async () => {
setLoadingTexts(true);
try {
@@ -644,7 +661,7 @@ export default function App() {
title="Settings"
type="button"
>
- ⚙
+ ⚙