Skip to content

armgit / ente

Public Imported from GitHub
0

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

Inline

Manav Rathi03f5b7887250
diff --git a/web/apps/photos/src/components/Sidebar/index.tsx b/web/apps/photos/src/components/Sidebar/index.tsx
index 285b727528..6a2694e826 100644
--- a/web/apps/photos/src/components/Sidebar/index.tsx
+++ b/web/apps/photos/src/components/Sidebar/index.tsx
@@ -45,14 +45,15 @@ import {
VerticallyCentered,
} from "@ente/shared/components/Container";
import { EnteMenuItem } from "@ente/shared/components/Menu/EnteMenuItem";
-import ThemeSwitcher from "@ente/shared/components/ThemeSwitcher";
import DialogTitleWithCloseButton from "@ente/shared/components/TitleWithCloseButton";
import { PHOTOS_PAGES as PAGES } from "@ente/shared/constants/pages";
import { THEME_COLOR } from "@ente/shared/themes/constants";
import ArchiveOutlined from "@mui/icons-material/ArchiveOutlined";
import CategoryIcon from "@mui/icons-material/Category";
import CloseIcon from "@mui/icons-material/Close";
+import DarkModeIcon from "@mui/icons-material/DarkMode";
import DeleteOutline from "@mui/icons-material/DeleteOutline";
+import LightModeIcon from "@mui/icons-material/LightMode";
import LockOutlined from "@mui/icons-material/LockOutlined";
import VisibilityOff from "@mui/icons-material/VisibilityOff";
import {
@@ -65,6 +66,8 @@ import {
Skeleton,
Stack,
styled,
+ ToggleButton,
+ ToggleButtonGroup,
} from "@mui/material";
import Typography from "@mui/material/Typography";
import DeleteAccountModal from "components/DeleteAccountModal";
@@ -595,6 +598,38 @@ const UtilitySection: React.FC<UtilitySectionProps> = ({ closeSidebar }) => {
);
};
+interface ThemeSwitcherProps {
+ themeColor: THEME_COLOR;
+ setThemeColor: (themeColor: THEME_COLOR) => void;
+}
+
+const ThemeSwitcher: React.FC<ThemeSwitcherProps> = ({
+ themeColor,
+ setThemeColor,
+}) => {
+ const handleChange = (event, themeColor: THEME_COLOR) => {
+ if (themeColor !== null) {
+ setThemeColor(themeColor);
+ }
+ };
+
+ return (
+ <ToggleButtonGroup
+ size="small"
+ value={themeColor}
+ exclusive
+ onChange={handleChange}
+ >
+ <ToggleButton value={THEME_COLOR.LIGHT}>
+ <LightModeIcon />
+ </ToggleButton>
+ <ToggleButton value={THEME_COLOR.DARK}>
+ <DarkModeIcon />
+ </ToggleButton>
+ </ToggleButtonGroup>
+ );
+};
+
const HelpSection: React.FC = () => {
const { showMiniDialog } = useContext(AppContext);
const { openExportModal } = useContext(GalleryContext);
diff --git a/web/packages/shared/components/ThemeSwitcher.tsx b/web/packages/shared/components/ThemeSwitcher.tsx
deleted file mode 100644
index bde2fdafb2..0000000000
--- a/web/packages/shared/components/ThemeSwitcher.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-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: (themeColor: THEME_COLOR) => void;
-}
-
-export default function ThemeSwitcher({ themeColor, setThemeColor }: Iprops) {
- const handleChange = (event, themeColor: THEME_COLOR) => {
- if (themeColor !== null) {
- setThemeColor(themeColor);
- }
- };
-
- return (
- <ToggleButtonGroup
- size="small"
- value={themeColor}
- exclusive
- onChange={handleChange}
- >
- <ToggleButton value={THEME_COLOR.LIGHT}>
- <LightModeIcon />
- </ToggleButton>
- <ToggleButton value={THEME_COLOR.DARK}>
- <DarkModeIcon />
- </ToggleButton>
- </ToggleButtonGroup>
- );
-}