theme fixes

This commit is contained in:
2026-04-04 16:00:33 +05:30
parent 3771eb7dca
commit 86e5bc6429
5 changed files with 168 additions and 34 deletions

View File

@@ -16,8 +16,11 @@ import {
} from "@mui/material";
import MenuIcon from "@mui/icons-material/Menu";
import LogoutIcon from "@mui/icons-material/Logout";
import DarkModeIcon from "@mui/icons-material/DarkMode";
import LightModeIcon from "@mui/icons-material/LightMode";
import { useNavigate } from "react-router-dom";
import { useAuth } from "../react-auth";
import { ColorModeContext } from "./AppTheme";
interface HeaderProps {
routerMapping: {
@@ -39,6 +42,7 @@ export default function Header({
const navigate = useNavigate();
const { currentUser, logout } = useAuth();
const { mode, toggleColorMode } = React.useContext(ColorModeContext);
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
@@ -70,6 +74,11 @@ export default function Header({
</IconButton>
)}
{/* THEME TOGGLE */}
<IconButton onClick={toggleColorMode} color="inherit" sx={{ mr: 2 }}>
{mode === 'dark' ? <LightModeIcon /> : <DarkModeIcon />}
</IconButton>
{/* TITLE */}
<Typography
variant="h6"