Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move

Manav Rathi80ed1e47b0b9
diff --git a/web/apps/photos/src/components/Collections/AllCollections/index.tsx b/web/apps/photos/src/components/Collections/AllCollections/index.tsx
index 1ceb79ac56..903694f3ba 100644
--- a/web/apps/photos/src/components/Collections/AllCollections/index.tsx
+++ b/web/apps/photos/src/components/Collections/AllCollections/index.tsx
@@ -1,11 +1,8 @@
import { CollectionsSortOptions } from "@/new/photos/components/CollectionsSortOptions";
+import { FilledIconButton } from "@/new/photos/components/mui-custom";
import type { CollectionSummary } from "@/new/photos/types/collection";
import { CollectionsSortBy } from "@/new/photos/types/collection";
-import {
- FlexWrapper,
- FluidContainer,
- IconButtonWithBG,
-} from "@ente/shared/components/Container";
+import { FlexWrapper, FluidContainer } from "@ente/shared/components/Container";
import Close from "@mui/icons-material/Close";
import {
Box,
@@ -105,9 +102,9 @@ const AllCollectionsHeader = ({
onChangeSortBy={onChangeCollectionsSortBy}
nestedInDialog
/>
- <IconButtonWithBG onClick={onClose}>
+ <FilledIconButton onClick={onClose}>
<Close />
- </IconButtonWithBG>
+ </FilledIconButton>
</Stack>
</FlexWrapper>
</DialogTitle>
diff --git a/web/apps/photos/src/components/Collections/CollectionListBar.tsx b/web/apps/photos/src/components/Collections/CollectionListBar.tsx
index 742881a36d..3c298e1e6c 100644
--- a/web/apps/photos/src/components/Collections/CollectionListBar.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionListBar.tsx
@@ -1,6 +1,7 @@
import { useIsMobileWidth } from "@/base/hooks";
import { CollectionsSortOptions } from "@/new/photos/components/CollectionsSortOptions";
import { BarItemTile, ItemCard } from "@/new/photos/components/ItemCards";
+import { FilledIconButton } from "@/new/photos/components/mui-custom";
import type { Person } from "@/new/photos/services/ml/cgroups";
import type {
CollectionSummary,
@@ -8,7 +9,7 @@ import type {
CollectionsSortBy,
} from "@/new/photos/types/collection";
import { ensure } from "@/utils/ensure";
-import { IconButtonWithBG, Overlay } from "@ente/shared/components/Container";
+import { Overlay } from "@ente/shared/components/Container";
import ArchiveIcon from "@mui/icons-material/Archive";
import ExpandMore from "@mui/icons-material/ExpandMore";
import Favorite from "@mui/icons-material/FavoriteRounded";
@@ -216,9 +217,9 @@ export const CollectionListBar: React.FC<CollectionListBarProps> = ({
activeSortBy={collectionsSortBy}
onChangeSortBy={onChangeCollectionsSortBy}
/>
- <IconButtonWithBG onClick={onShowAllCollections}>
+ <FilledIconButton onClick={onShowAllCollections}>
<ExpandMore />
- </IconButtonWithBG>
+ </FilledIconButton>
</Box>
);
diff --git a/web/apps/photos/src/components/Notification.tsx b/web/apps/photos/src/components/Notification.tsx
index 76adb95a12..a9b49f9c4e 100644
--- a/web/apps/photos/src/components/Notification.tsx
+++ b/web/apps/photos/src/components/Notification.tsx
@@ -1,5 +1,5 @@
import { EllipsizedTypography } from "@/base/components/Typography";
-import { IconButtonWithBG } from "@ente/shared/components/Container";
+import { FilledIconButton } from "@/new/photos/components/mui-custom";
import CloseIcon from "@mui/icons-material/Close";
import InfoIcon from "@mui/icons-material/InfoOutlined";
import {
@@ -109,16 +109,16 @@ export default function Notification({
</Stack>
{attributes.endIcon ? (
- <IconButtonWithBG
+ <FilledIconButton
onClick={attributes.onClick}
sx={{ fontSize: "36px" }}
>
{attributes?.endIcon}
- </IconButtonWithBG>
+ </FilledIconButton>
) : (
- <IconButtonWithBG onClick={handleClose}>
+ <FilledIconButton onClick={handleClose}>
<CloseIcon />
- </IconButtonWithBG>
+ </FilledIconButton>
)}
</Stack>
</Button>
diff --git a/web/apps/photos/src/components/Upload/UploadProgress/title.tsx b/web/apps/photos/src/components/Upload/UploadProgress/title.tsx
index 81966a1583..7195bee438 100644
--- a/web/apps/photos/src/components/Upload/UploadProgress/title.tsx
+++ b/web/apps/photos/src/components/Upload/UploadProgress/title.tsx
@@ -1,15 +1,12 @@
+import { FilledIconButton } from "@/new/photos/components/mui-custom";
import { UPLOAD_STAGES } from "@/new/photos/services/upload/types";
-import {
- IconButtonWithBG,
- SpaceBetweenFlex,
-} from "@ente/shared/components/Container";
+import { SpaceBetweenFlex } from "@ente/shared/components/Container";
import Close from "@mui/icons-material/Close";
+import UnfoldLessIcon from "@mui/icons-material/UnfoldLess";
+import UnfoldMoreIcon from "@mui/icons-material/UnfoldMore";
import { Box, DialogTitle, Stack, Typography } from "@mui/material";
import { t } from "i18next";
import { useContext } from "react";
-
-import UnfoldLessIcon from "@mui/icons-material/UnfoldLess";
-import UnfoldMoreIcon from "@mui/icons-material/UnfoldMore";
import UploadProgressContext from "./context";
const UploadProgressTitleText = ({ expanded }) => {
@@ -49,12 +46,12 @@ export function UploadProgressTitle() {
</Box>
<Box>
<Stack direction={"row"} spacing={1}>
- <IconButtonWithBG onClick={toggleExpanded}>
+ <FilledIconButton onClick={toggleExpanded}>
{expanded ? <UnfoldLessIcon /> : <UnfoldMoreIcon />}
- </IconButtonWithBG>
- <IconButtonWithBG onClick={onClose}>
+ </FilledIconButton>
+ <FilledIconButton onClick={onClose}>
<Close />
- </IconButtonWithBG>
+ </FilledIconButton>
</Stack>
</Box>
</SpaceBetweenFlex>
diff --git a/web/packages/new/photos/components/mui-custom.tsx b/web/packages/new/photos/components/mui-custom.tsx
new file mode 100644
index 0000000000..e5bb46dc2a
--- /dev/null
+++ b/web/packages/new/photos/components/mui-custom.tsx
@@ -0,0 +1,8 @@
+import { IconButton, styled } from "@mui/material";
+
+/**
+ * A MUI {@link IconButton} filled in with at faint background.
+ */
+export const FilledIconButton = styled(IconButton)(({ theme }) => ({
+ backgroundColor: theme.colors.fill.faint,
+}));
diff --git a/web/packages/shared/components/Container.tsx b/web/packages/shared/components/Container.tsx
index d275837db8..4ba62233e7 100644
--- a/web/packages/shared/components/Container.tsx
+++ b/web/packages/shared/components/Container.tsx
@@ -1,4 +1,4 @@
-import { Box, IconButton, styled } from "@mui/material";
+import { Box, styled } from "@mui/material";
export const VerticallyCentered = styled(Box)`
flex: 1;
@@ -36,10 +36,6 @@ export const Overlay = styled(Box)`
left: 0;
`;
-export const IconButtonWithBG = styled(IconButton)(({ theme }) => ({
- backgroundColor: theme.colors.fill.faint,
-}));
-
export const HorizontalFlex = styled(Box)({
display: "flex",
});