diff --git a/understand-anything-plugin/packages/dashboard/src/App.tsx b/understand-anything-plugin/packages/dashboard/src/App.tsx index 634461d..78ded8f 100644 --- a/understand-anything-plugin/packages/dashboard/src/App.tsx +++ b/understand-anything-plugin/packages/dashboard/src/App.tsx @@ -15,6 +15,9 @@ import KeyboardShortcutsHelp from "./components/KeyboardShortcutsHelp"; import WarningBanner from "./components/WarningBanner"; import { useKeyboardShortcuts } from "./hooks/useKeyboardShortcuts"; import type { KeyboardShortcut } from "./hooks/useKeyboardShortcuts"; +import { ThemeProvider } from "./themes/index.ts"; +import { ThemePicker } from "./components/ThemePicker.tsx"; +import type { ThemeConfig } from "./themes/index.ts"; function App() { const graph = useDashboardStore((s) => s.graph); @@ -28,6 +31,16 @@ function App() { const [loadError, setLoadError] = useState(null); const [graphIssues, setGraphIssues] = useState([]); const [showKeyboardHelp, setShowKeyboardHelp] = useState(false); + const [metaTheme, setMetaTheme] = useState(null); + + useEffect(() => { + fetch("/meta.json") + .then((r) => (r.ok ? r.json() : null)) + .then((meta) => { + if (meta?.theme) setMetaTheme(meta.theme); + }) + .catch(() => {}); + }, []); // Define keyboard shortcuts const shortcuts = useMemo( @@ -185,6 +198,7 @@ function App() { ); return ( +
{/* Header */}
@@ -198,6 +212,7 @@ function App() {
+
+ ); } diff --git a/understand-anything-plugin/packages/dashboard/src/themes/ThemeContext.tsx b/understand-anything-plugin/packages/dashboard/src/themes/ThemeContext.tsx index d166e55..dc12fcc 100644 --- a/understand-anything-plugin/packages/dashboard/src/themes/ThemeContext.tsx +++ b/understand-anything-plugin/packages/dashboard/src/themes/ThemeContext.tsx @@ -75,7 +75,7 @@ export function ThemeProvider({ metaTheme, children }: ThemeProviderProps) { }, [metaTheme]); const setPreset = useCallback((presetId: PresetId) => { - setConfig((prev) => { + setConfig((_prev) => { const newPreset = getPreset(presetId); return { presetId, accentId: newPreset.defaultAccentId }; });