st
This commit is contained in:
parent
b42759d473
commit
4a0c93373d
5 changed files with 6 additions and 9 deletions
|
@ -25,7 +25,6 @@ import HTTPService from "@ente/shared/network/HTTPService";
|
|||
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
|
||||
import { getTheme } from "@ente/shared/themes";
|
||||
import { THEME_COLOR } from "@ente/shared/themes/constants";
|
||||
import type { SetTheme } from "@ente/shared/themes/types";
|
||||
import type { User } from "@ente/shared/user/types";
|
||||
import { CssBaseline, useMediaQuery } from "@mui/material";
|
||||
import { ThemeProvider } from "@mui/material/styles";
|
||||
|
@ -42,7 +41,7 @@ type AppContextType = {
|
|||
finishLoading: () => void;
|
||||
isMobile: boolean;
|
||||
themeColor: THEME_COLOR;
|
||||
setThemeColor: SetTheme;
|
||||
setThemeColor: (themeColor: THEME_COLOR) => void;
|
||||
somethingWentWrong: () => void;
|
||||
setDialogBoxAttributesV2: SetDialogBoxAttributesV2;
|
||||
logout: () => void;
|
||||
|
|
|
@ -529,7 +529,7 @@ const UtilitySection: React.FC<UtilitySectionProps> = ({ closeSidebar }) => {
|
|||
});
|
||||
|
||||
const toggleTheme = () => {
|
||||
setThemeColor((themeColor) =>
|
||||
setThemeColor(
|
||||
themeColor === THEME_COLOR.DARK
|
||||
? THEME_COLOR.LIGHT
|
||||
: THEME_COLOR.DARK,
|
||||
|
|
|
@ -36,7 +36,6 @@ import {
|
|||
} from "@ente/shared/storage/localStorage/helpers";
|
||||
import { getTheme } from "@ente/shared/themes";
|
||||
import { THEME_COLOR } from "@ente/shared/themes/constants";
|
||||
import type { SetTheme } from "@ente/shared/themes/types";
|
||||
import type { User } from "@ente/shared/user/types";
|
||||
import ArrowForward from "@mui/icons-material/ArrowForward";
|
||||
import { CssBaseline, useMediaQuery } from "@mui/material";
|
||||
|
@ -95,7 +94,7 @@ type AppContextType = {
|
|||
setWatchFolderFiles: (files: FileList) => void;
|
||||
isMobile: boolean;
|
||||
themeColor: THEME_COLOR;
|
||||
setThemeColor: SetTheme;
|
||||
setThemeColor: (themeColor: THEME_COLOR) => void;
|
||||
somethingWentWrong: () => void;
|
||||
setDialogBoxAttributesV2: SetDialogBoxAttributesV2;
|
||||
isCFProxyDisabled: boolean;
|
||||
|
|
|
@ -2,10 +2,12 @@ import { THEME_COLOR } from "@ente/shared/themes/constants";
|
|||
import DarkModeIcon from "@mui/icons-material/DarkMode";
|
||||
import LightModeIcon from "@mui/icons-material/LightMode";
|
||||
import { ToggleButton, ToggleButtonGroup } from "@mui/material";
|
||||
|
||||
interface Iprops {
|
||||
themeColor: THEME_COLOR;
|
||||
setThemeColor: (theme: THEME_COLOR) => void;
|
||||
setThemeColor: (themeColor: THEME_COLOR) => void;
|
||||
}
|
||||
|
||||
export default function ThemeSwitcher({ themeColor, setThemeColor }: Iprops) {
|
||||
const handleChange = (event, themeColor: THEME_COLOR) => {
|
||||
if (themeColor !== null) {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
import { THEME_COLOR } from "./constants";
|
||||
|
||||
export type SetTheme = React.Dispatch<React.SetStateAction<THEME_COLOR>>;
|
Loading…
Reference in a new issue