diff --git a/src/App.tsx b/src/App.tsx index 5570b46..5ee1618 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -75,6 +75,9 @@ export default function App() { const [viewingVersion, setViewingVersion] = useState(null); const [selectedHistoryId, setSelectedHistoryId] = useState(null); const [confirmState, setConfirmState] = useState(null); + const [settingsOpen, setSettingsOpen] = useState(false); + const [theme, setTheme] = useState<"default" | "light">("default"); + const [textSize, setTextSize] = useState(16); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); const bodyRef = useRef(body); @@ -86,6 +89,14 @@ export default function App() { bodyRef.current = body; }, [body]); + useEffect(() => { + document.body.dataset.theme = theme; + }, [theme]); + + useEffect(() => { + document.documentElement.style.setProperty("--base-font-size", `${textSize}px`); + }, [textSize]); + const isViewingHistory = viewingVersion !== null; const isDirty = !isViewingHistory && body !== lastPersistedBody; const hasText = body.trim().length > 0; @@ -619,21 +630,32 @@ export default function App() { }, [handleSaveVersion]); return ( -
+
{!sidebarCollapsed ? (