From 8d104ee30a95cf41bd09f2635b0e77ac10accf87 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 20 Feb 2026 17:59:08 +0000 Subject: [PATCH] remove v1 theme provider --- client/src/App.tsx | 11 +- client/src/Components/v2/layout/AppLayout.tsx | 12 +- .../src/Components/v2/layout/RootLayout.tsx | 11 +- client/src/Routes/index.tsx | 278 +++--------------- 4 files changed, 45 insertions(+), 267 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index a8a25669e..cbf8ecb3d 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -3,26 +3,23 @@ import { useSelector } from "react-redux"; import "react-toastify/dist/ReactToastify.css"; import { ToastContainer } from "react-toastify"; import { ThemeProvider } from "@emotion/react"; -import lightTheme from "./Utils/Theme/lightTheme"; -import darkTheme from "./Utils/Theme/darkTheme"; import { CssBaseline, GlobalStyles } from "@mui/material"; import { Routes } from "./Routes"; import AppLayout from "@/Components/v2/layout/AppLayout"; import type { RootState } from "@/Types/state"; +import { lightTheme, darkTheme } from "@/Utils/Theme/v2Theme"; function App() { const mode = useSelector((state: RootState) => state.ui.mode); - - const theme = mode === "light" ? lightTheme : darkTheme; + const v2theme = mode === "light" ? lightTheme : darkTheme; return ( - + diff --git a/client/src/Components/v2/layout/AppLayout.tsx b/client/src/Components/v2/layout/AppLayout.tsx index 7c9c3c903..437e73260 100644 --- a/client/src/Components/v2/layout/AppLayout.tsx +++ b/client/src/Components/v2/layout/AppLayout.tsx @@ -1,10 +1,9 @@ import Box from "@mui/material/Box"; import { useState, useEffect, useRef } from "react"; -import { ThemeProvider, useTheme } from "@mui/material/styles"; +import { useTheme } from "@mui/material/styles"; import { useSelector } from "react-redux"; import BackgroundSVG from "@/assets/Images/background.svg"; import type { RootState } from "@/Types/state"; -import { lightTheme, darkTheme } from "@/Utils/Theme/v2Theme"; import { OfflineBanner } from "@/Components/v2/design-elements"; import { setServerUnreachableCallback, get } from "@/Utils/ApiClient"; @@ -15,8 +14,6 @@ interface AppLayoutProps { const AppLayout = ({ children }: AppLayoutProps) => { const theme = useTheme(); const mode = useSelector((state: RootState) => state.ui.mode); - const v2theme = mode === "dark" ? darkTheme : lightTheme; - const [serverUnreachable, setServerUnreachable] = useState(false); const retryIntervalRef = useRef(null); @@ -49,8 +46,7 @@ const AppLayout = ({ children }: AppLayoutProps) => { { color: theme.palette.primary.contrastText, }} > - - - + {children} ); diff --git a/client/src/Components/v2/layout/RootLayout.tsx b/client/src/Components/v2/layout/RootLayout.tsx index 0b6defb91..117c08255 100644 --- a/client/src/Components/v2/layout/RootLayout.tsx +++ b/client/src/Components/v2/layout/RootLayout.tsx @@ -4,23 +4,16 @@ import Stack from "@mui/material/Stack"; import { useMediaQuery } from "@mui/material"; import { useSidebar } from "@/Hooks/useSidebar"; -import { useSelector } from "react-redux"; -import type { RootState } from "@/Types/state"; -import { lightTheme, darkTheme } from "@/Utils/Theme/v2Theme"; -import { ThemeProvider, useTheme } from "@mui/material"; +import { useTheme } from "@mui/material"; const RootLayout = () => { - const mode = useSelector((state: RootState) => state.ui.mode); - const v2theme = mode === "dark" ? darkTheme : lightTheme; const theme = useTheme(); const isSmall = useMediaQuery(theme.breakpoints.down("md")); const { collapsedWidth } = useSidebar(); return ( - - - + { - const mode = useSelector((state: RootState) => state.ui.mode); - const v2theme = mode === "light" ? lightTheme : darkTheme; return ( { /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - } + element={} /> - - - } + element={} /> - - - } + element={} /> - - - + } /> @@ -367,9 +201,7 @@ const Routes = () => { path="logs" element={ - - - + } /> @@ -379,75 +211,37 @@ const Routes = () => { path="/login" element={ <> - - - + } /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> - - - - - } + element={} /> );