Merge pull request #938 from rishavd3v/fix/theme-toggle-position
Fix/theme toggle position - issue#934
This commit is contained in:
2 files changed
+24
-3
No files matched your search
@@ -632,7 +632,7 @@ function Sidebar() {
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
{collapsed && <Divider />}
|
{collapsed && <Divider />}
|
||||||
<MenuItem
|
{/* <MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch(setMode("light"));
|
dispatch(setMode("light"));
|
||||||
closePopup();
|
closePopup();
|
||||||
@@ -647,7 +647,7 @@ function Sidebar() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Dark
|
Dark
|
||||||
</MenuItem>
|
</MenuItem> */}
|
||||||
<Divider />
|
<Divider />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={logout}
|
onClick={logout}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
import { update } from "../../Features/Auth/authSlice";
|
import { update } from "../../Features/Auth/authSlice";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import LoadingButton from "@mui/lab/LoadingButton";
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import { setTimezone } from "../../Features/UI/uiSlice";
|
import { setTimezone, setMode } from "../../Features/UI/uiSlice";
|
||||||
import timezones from "../../Utils/timezones.json";
|
import timezones from "../../Utils/timezones.json";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { ConfigBox } from "./styled";
|
import { ConfigBox } from "./styled";
|
||||||
@@ -32,6 +32,7 @@ const Settings = ({ isAdmin }) => {
|
|||||||
const { isLoading } = useSelector((state) => state.uptimeMonitors);
|
const { isLoading } = useSelector((state) => state.uptimeMonitors);
|
||||||
const { isLoading: authIsLoading } = useSelector((state) => state.auth);
|
const { isLoading: authIsLoading } = useSelector((state) => state.auth);
|
||||||
const { timezone } = useSelector((state) => state.ui);
|
const { timezone } = useSelector((state) => state.ui);
|
||||||
|
const {mode} = useSelector((state) => state.ui);
|
||||||
const [checksIsLoading, setChecksIsLoading] = useState(false);
|
const [checksIsLoading, setChecksIsLoading] = useState(false);
|
||||||
const [form, setForm] = useState({
|
const [form, setForm] = useState({
|
||||||
ttl: checkTTL ? (checkTTL / SECONDS_PER_DAY).toString() : 0,
|
ttl: checkTTL ? (checkTTL / SECONDS_PER_DAY).toString() : 0,
|
||||||
@@ -182,6 +183,26 @@ const Settings = ({ isAdmin }) => {
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
|
<ConfigBox>
|
||||||
|
<Box>
|
||||||
|
<Typography component="h1">Appearance</Typography>
|
||||||
|
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(2) }}>
|
||||||
|
Switch between light and dark mode.
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
<Stack gap={theme.spacing(20)}>
|
||||||
|
<Select
|
||||||
|
id="theme-mode"
|
||||||
|
label="Theme Mode"
|
||||||
|
value={mode}
|
||||||
|
onChange={(e) => {
|
||||||
|
dispatch(setMode(e.target.value));
|
||||||
|
}}
|
||||||
|
items={[{_id:'light', name:'Light'},{_id:'dark', name:'Dark'}]}
|
||||||
|
>
|
||||||
|
</Select>
|
||||||
|
</Stack>
|
||||||
|
</ConfigBox>
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<ConfigBox>
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
|
|||||||
Reference in new issue
Block a user