Skip to content

armgit / ente

Public Imported from GitHub
0

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

refractor(CollectionMapDialog):code-refractored

Aswin Asokdc3c5399c051
diff --git a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
index a5141bbbb1..b49c8258f5 100644
--- a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
@@ -14,8 +14,6 @@ import {
Tooltip,
Typography,
type IconButtonProps,
- type SxProps,
- type Theme,
} from "@mui/material";
import { ensureLocalUser } from "ente-accounts/services/user";
import { ActivityIndicator } from "ente-base/components/mui/ActivityIndicator";
@@ -71,23 +69,22 @@ interface MapControlsProps {
onClose: () => void;
}
-const floatingIconButtonSx: SxProps<Theme> = {
- bgcolor: (theme) => theme.vars.palette.background.paper,
- boxShadow: (theme) => theme.shadows[4],
- width: 48,
- height: 48,
- borderRadius: "16px",
- transition: "transform 0.2s ease-out",
- "&:hover": {
- bgcolor: (theme) => theme.vars.palette.background.paper,
- transform: "scale(1.05)",
- },
-};
-
const FloatingIconButton: React.FC<IconButtonProps> = ({ sx, ...props }) => (
<IconButton
{...props}
- sx={[floatingIconButtonSx, ...(sx ? [sx] : [])]}
+ sx={{
+ bgcolor: (theme) => theme.vars.palette.background.paper,
+ boxShadow: (theme) => theme.shadows[4],
+ width: 48,
+ height: 48,
+ borderRadius: "16px",
+ transition: "transform 0.2s ease-out",
+ "&:hover": {
+ bgcolor: (theme) => theme.vars.palette.background.paper,
+ transform: "scale(1.05)",
+ },
+ ...sx,
+ }}
/>
);