Making the application have a theme.

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
2025-08-28 09:55:21 -04:00
parent aa056d4dfc
commit 5684b7af4e
2 changed files with 38 additions and 1 deletions

View File

@@ -2,6 +2,9 @@ import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import { ThemeProvider } from "@mui/material/styles";
import CssBaseline from "@mui/material/CssBaseline";
import theme from "./theme";
import reportWebVitals from "./reportWebVitals";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import axios from "axios";
@@ -16,7 +19,10 @@ const root = ReactDOM.createRoot(
root.render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<App />
<ThemeProvider theme={theme}>
<CssBaseline />
<App />
</ThemeProvider>
</QueryClientProvider>
</React.StrictMode>
);

31
frontend/src/theme.ts Normal file
View File

@@ -0,0 +1,31 @@
import { createTheme } from "@mui/material/styles";
const theme = createTheme({
palette: {
mode: "light",
primary: {
main: "#1976d2",
},
secondary: {
main: "#9c27b0",
},
background: {
default: "#f4f6fa",
paper: "#fff",
},
},
components: {
MuiListItemButton: {
styleOverrides: {
root: {
"&.Mui-selected, &.Mui-selected:hover": {
backgroundColor: "#e3f2fd",
color: "#1976d2",
},
},
},
},
},
});
export default theme;