Can toggle dark theme
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { ThemeProvider, createTheme } from "@mui/material/styles";
|
||||
import React from "react";
|
||||
import { Route, Routes } from "react-router-dom";
|
||||
import "./App.css";
|
||||
@ -24,12 +23,6 @@ interface AuthContext {
|
||||
|
||||
const AuthContextK = React.createContext<AuthContext | null>(null);
|
||||
|
||||
const darkTheme = createTheme({
|
||||
palette: {
|
||||
mode: "dark", // TODO : switch back to light
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Core app
|
||||
*/
|
||||
@ -42,37 +35,35 @@ export function App(): React.ReactElement {
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={darkTheme}>
|
||||
<AuthContextK.Provider value={context}>
|
||||
<Routes>
|
||||
<Route path="delete_account" element={<DeleteAccountRoute />} />
|
||||
<AuthContextK.Provider value={context}>
|
||||
<Routes>
|
||||
<Route path="delete_account" element={<DeleteAccountRoute />} />
|
||||
|
||||
{signedIn ? (
|
||||
<Route path="*" element={<BaseAuthenticatedPage />}>
|
||||
<Route path="" element={<FamiliesListRoute />} />
|
||||
<Route path="profile" element={<ProfileRoute />} />
|
||||
<Route path="family/:familyId/*" element={<BaseFamilyRoute />}>
|
||||
<Route path="" element={<FamilyHomeRoute />} />
|
||||
<Route path="*" element={<NotFoundRoute />} />
|
||||
</Route>
|
||||
{signedIn ? (
|
||||
<Route path="*" element={<BaseAuthenticatedPage />}>
|
||||
<Route path="" element={<FamiliesListRoute />} />
|
||||
<Route path="profile" element={<ProfileRoute />} />
|
||||
<Route path="family/:familyId/*" element={<BaseFamilyRoute />}>
|
||||
<Route path="" element={<FamilyHomeRoute />} />
|
||||
<Route path="*" element={<NotFoundRoute />} />
|
||||
</Route>
|
||||
) : (
|
||||
<Route path="*" element={<BaseLoginPage />}>
|
||||
<Route path="" element={<LoginRoute />} />
|
||||
<Route path="oidc_cb" element={<OIDCCbRoute />} />
|
||||
<Route path="new-account" element={<NewAccountRoute />} />
|
||||
<Route
|
||||
path="password_forgotten"
|
||||
element={<PasswordForgottenRoute />}
|
||||
/>
|
||||
<Route path="reset_password" element={<ResetPasswordRoute />} />
|
||||
<Route path="*" element={<NotFoundRoute />} />
|
||||
</Route>
|
||||
)}
|
||||
</Routes>
|
||||
</AuthContextK.Provider>
|
||||
</ThemeProvider>
|
||||
<Route path="*" element={<NotFoundRoute />} />
|
||||
</Route>
|
||||
) : (
|
||||
<Route path="*" element={<BaseLoginPage />}>
|
||||
<Route path="" element={<LoginRoute />} />
|
||||
<Route path="oidc_cb" element={<OIDCCbRoute />} />
|
||||
<Route path="new-account" element={<NewAccountRoute />} />
|
||||
<Route
|
||||
path="password_forgotten"
|
||||
element={<PasswordForgottenRoute />}
|
||||
/>
|
||||
<Route path="reset_password" element={<ResetPasswordRoute />} />
|
||||
<Route path="*" element={<NotFoundRoute />} />
|
||||
</Route>
|
||||
)}
|
||||
</Routes>
|
||||
</AuthContextK.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user