Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

st

Manav Rathi4a0c93373db3
diff --git a/web/apps/auth/src/pages/_app.tsx b/web/apps/auth/src/pages/_app.tsx
index 0eddf2d7cf..355b76e083 100644
--- a/web/apps/auth/src/pages/_app.tsx
+++ b/web/apps/auth/src/pages/_app.tsx
@@ -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;
diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx
index 300d06ed62..a59c36b146 100644
--- a/web/apps/photos/src/components/Sidebar/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/index.tsx
@@ -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,
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index fddf8624c4..d9df703b7a 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -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;
diff --git a/web/packages/shared/components/ThemeSwitcher.tsx b/web/packages/shared/components/ThemeSwitcher.tsx
index 121d2e2330..bde2fdafb2 100644
--- a/web/packages/shared/components/ThemeSwitcher.tsx
+++ b/web/packages/shared/components/ThemeSwitcher.tsx
@@ -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) {
diff --git a/web/packages/shared/themes/types.ts b/web/packages/shared/themes/types.ts
deleted file mode 100644
index 7b89964292..0000000000
--- a/web/packages/shared/themes/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { THEME_COLOR } from "./constants";
-
-export type SetTheme = React.Dispatch<React.SetStateAction<THEME_COLOR>>;