diff --git a/client/src/components/layout/Sidebar.tsx b/client/src/components/layout/Sidebar.tsx
index 9b16c3c..5fab2cb 100644
--- a/client/src/components/layout/Sidebar.tsx
+++ b/client/src/components/layout/Sidebar.tsx
@@ -2,13 +2,17 @@
* Sidebar with navigation tree and entity tables.
*/
-import { Box, Typography, Divider } from "@mui/material";
+import { Box, Typography, Divider, IconButton } from "@mui/material";
+import LightModeIcon from "@mui/icons-material/LightMode";
+import DarkModeIcon from "@mui/icons-material/DarkMode";
import { useConfig } from "@/api/hooks";
+import { useThemeMode } from "@/contexts/ThemeContext";
import { RunTree } from "@/components/navigation/RunTree";
import { EntityTabs } from "@/components/entities/EntityTabs";
export function Sidebar() {
const { data: config } = useConfig();
+ const { mode, toggleMode } = useThemeMode();
return (
@@ -21,9 +25,12 @@ export function Sidebar() {
alt="Copick"
sx={{ width: 32, height: 32, flexShrink: 0 }}
/>
-
+
{config?.name ?? "Copick Web"}
+
+ {mode === "dark" ? : }
+
{config?.description && (
diff --git a/client/src/main.tsx b/client/src/main.tsx
index 1c0126d..29512ff 100644
--- a/client/src/main.tsx
+++ b/client/src/main.tsx
@@ -1,7 +1,7 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { ThemeProvider, createTheme, CssBaseline } from "@mui/material";
+import { ThemeContextProvider } from "./contexts/ThemeContext";
import App from "./App";
import "./index.css";
@@ -14,19 +14,12 @@ const queryClient = new QueryClient({
},
});
-const darkTheme = createTheme({
- palette: {
- mode: "dark",
- },
-});
-
ReactDOM.createRoot(document.getElementById("root")!).render(
-
-
+
-
+
);