Temporarily enable dark theme

This commit is contained in:
Pierre HUBERT 2023-07-08 12:51:03 +02:00
parent ea5dd34302
commit 3a0f9c6e48

View File

@ -1,7 +1,10 @@
import { ThemeProvider, createTheme } from "@mui/material/styles";
import React from "react";
import { Route, Routes } from "react-router-dom";
import "./App.css";
import { AuthApi } from "./api/AuthApi";
import { DeleteAccountRoute } from "./routes/DeleteAccountRoute";
import { FamiliesListRoute } from "./routes/FamiliesListRoute";
import { NotFoundRoute } from "./routes/NotFound";
import { ProfileRoute } from "./routes/ProfileRoute";
import { LoginRoute } from "./routes/auth/LoginRoute";
@ -9,12 +12,10 @@ import { NewAccountRoute } from "./routes/auth/NewAccountRoute";
import { OIDCCbRoute } from "./routes/auth/OIDCCbRoute";
import { PasswordForgottenRoute } from "./routes/auth/PasswordForgottenRoute";
import { ResetPasswordRoute } from "./routes/auth/ResetPasswordRoute";
import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage";
import { BaseLoginPage } from "./widgets/BaseLoginpage";
import { DeleteAccountRoute } from "./routes/DeleteAccountRoute";
import { FamiliesListRoute } from "./routes/FamiliesListRoute";
import { BaseFamilyRoute } from "./widgets/BaseFamilyRoute";
import { FamilyHomeRoute } from "./routes/family/FamilyHomeRoute";
import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage";
import { BaseFamilyRoute } from "./widgets/BaseFamilyRoute";
import { BaseLoginPage } from "./widgets/BaseLoginpage";
interface AuthContext {
signedIn: boolean;
@ -23,6 +24,12 @@ interface AuthContext {
const AuthContextK = React.createContext<AuthContext | null>(null);
const darkTheme = createTheme({
palette: {
mode: "dark", // TODO : switch back to light
},
});
/**
* Core app
*/
@ -35,6 +42,7 @@ export function App(): React.ReactElement {
};
return (
<ThemeProvider theme={darkTheme}>
<AuthContextK.Provider value={context}>
<Routes>
<Route path="delete_account" element={<DeleteAccountRoute />} />
@ -64,6 +72,7 @@ export function App(): React.ReactElement {
)}
</Routes>
</AuthContextK.Provider>
</ThemeProvider>
);
}