feat: add theme switch in sidebar

This commit is contained in:
Peter Carl Pardo committed 2024-12-16 14:16:58 +08:00
1 parent 3ab8b1241e
commit cdcefb1106
1 file changed
+28 -20
+28 -20
View File
@@ -21,6 +21,7 @@ import { useDispatch, useSelector } from "react-redux";
import { clearAuthState } from "../../Features/Auth/authSlice"; import { clearAuthState } from "../../Features/Auth/authSlice";
import { toggleSidebar } from "../../Features/UI/uiSlice"; import { toggleSidebar } from "../../Features/UI/uiSlice";
import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice"; import { clearUptimeMonitorState } from "../../Features/UptimeMonitors/uptimeMonitorsSlice";
import ThemeSwitch from "../ThemeSwitch";
import Avatar from "../Avatar"; import Avatar from "../Avatar";
import LockSvg from "../../assets/icons/lock.svg?react"; import LockSvg from "../../assets/icons/lock.svg?react";
import UserSvg from "../../assets/icons/user.svg?react"; import UserSvg from "../../assets/icons/user.svg?react";
@@ -551,28 +552,35 @@ function Sidebar() {
{authState.user?.role} {authState.user?.role}
</Typography> </Typography>
</Box> </Box>
<Tooltip <Stack
title="Controls" flexDirection={"row"}
disableInteractive marginLeft={"auto"}
columnGap={theme.spacing(2)}
> >
<IconButton <ThemeSwitch />
sx={{ <Tooltip
ml: "auto", title="Controls"
mr: "-8px", disableInteractive
"&:focus": { outline: "none" },
"& svg": {
width: "20px",
height: "20px",
},
"& svg path": {
stroke: theme.palette.other.icon,
},
}}
onClick={(event) => openPopup(event, "logout")}
> >
<DotsVertical /> <IconButton
</IconButton> sx={{
</Tooltip> ml: "auto",
mr: "-8px",
"&:focus": { outline: "none" },
"& svg": {
width: "20px",
height: "20px",
},
"& svg path": {
stroke: theme.palette.other.icon,
},
}}
onClick={(event) => openPopup(event, "logout")}
>
<DotsVertical />
</IconButton>
</Tooltip>
</Stack>
</> </>
)} )}
<Menu <Menu