Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web][photos] Use shared storage limit dialog styles

AswinAsokcb99ca253541
diff --git a/web/apps/photos/public/images/storage-limit/close.svg b/web/apps/photos/public/images/storage-limit/close.svg
deleted file mode 100644
index 784fa6713e..0000000000
--- a/web/apps/photos/public/images/storage-limit/close.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g id="elements">
-<path id="Vector" d="M11.25 0.75L6 6M6 6L0.75 11.25M6 6L0.75 0.75M6 6L11.25 11.25" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke="black" style="stroke:black;stroke-opacity:1;"/>
-</g>
-</svg>
diff --git a/web/apps/photos/public/images/storage-limit/selected.svg b/web/apps/photos/public/images/storage-limit/selected.svg
deleted file mode 100644
index c94116fcce..0000000000
--- a/web/apps/photos/public/images/storage-limit/selected.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g id="Radio Button">
-<g clip-path="url(#clip0_0_137)">
-<path id="Container" d="M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1Z" fill="#08C225" style="fill:#08C225;fill:color(display-p3 0.0314 0.7608 0.1451);fill-opacity:1;"/>
-<circle id="On" cx="8" cy="8" r="4" fill="#08C225" style="fill:#08C225;fill:color(display-p3 0.0314 0.7608 0.1451);fill-opacity:1;"/>
-</g>
-</g>
-<defs>
-<clipPath id="clip0_0_137">
-<path d="M0 5C0 2.23858 2.23858 0 5 0H11C13.7614 0 16 2.23858 16 5V11C16 13.7614 13.7614 16 11 16H5C2.23858 16 0 13.7614 0 11V5Z" fill="white" style="fill:white;fill-opacity:1;"/>
-</clipPath>
-</defs>
-</svg>
diff --git a/web/apps/photos/public/images/storage-limit/unselected.svg b/web/apps/photos/public/images/storage-limit/unselected.svg
deleted file mode 100644
index f5abaf679d..0000000000
--- a/web/apps/photos/public/images/storage-limit/unselected.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g id="Radio Button">
-<g clip-path="url(#clip0_0_128)">
-<path id="Container" d="M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1Z" fill="#969696" style="fill:#969696;fill:color(display-p3 0.5882 0.5882 0.5882);fill-opacity:1;"/>
-</g>
-</g>
-<defs>
-<clipPath id="clip0_0_128">
-<path d="M0 5C0 2.23858 2.23858 0 5 0H11C13.7614 0 16 2.23858 16 5V11C16 13.7614 13.7614 16 11 16H5C2.23858 16 0 13.7614 0 11V5Z" fill="white" style="fill:white;fill-opacity:1;"/>
-</clipPath>
-</defs>
-</svg>
diff --git a/web/apps/photos/src/components/FamilyManagement.tsx b/web/apps/photos/src/components/FamilyManagement.tsx
index 281fef23f7..bebd070230 100644
--- a/web/apps/photos/src/components/FamilyManagement.tsx
+++ b/web/apps/photos/src/components/FamilyManagement.tsx
@@ -23,6 +23,7 @@ import {
Radio,
RadioGroup,
Stack,
+ styled,
TextField,
Typography,
} from "@mui/material";
@@ -699,22 +700,20 @@ const StorageLimitDialog: React.FC<{
fullWidth
slotProps={{
paper: {
- sx: {
- width: 420,
- maxWidth: "calc(100% - 32px)",
- m: 2,
- p: "20px",
- gap: 2,
- borderRadius: "20px",
- border: "1px solid",
- borderColor: "stroke.faint",
- backgroundImage:
- "linear-gradient(var(--mui-palette-fill-faint), var(--mui-palette-fill-faint))",
- },
+ sx: [
+ ...(isSxArray(v2PaperSx) ? v2PaperSx : [v2PaperSx]),
+ {
+ width: 420,
+ maxWidth: "calc(100% - 32px)",
+ boxSizing: "border-box",
+ p: "20px",
+ gap: 2,
+ },
+ ],
},
}}
>
- <Stack direction="row" sx={{ alignItems: "center", gap: 1 }}>
+ <Stack direction="row" sx={v2HeaderRowSx}>
<DialogTitle
id="storage-limit-title"
sx={{
@@ -731,18 +730,9 @@ const StorageLimitDialog: React.FC<{
aria-label={t("close")}
onClick={onClose}
disabled={loading}
- sx={{ width: 38, height: 38, bgcolor: "background.paper" }}
+ sx={v2CloseButtonSx}
>
- <Box
- component="img"
- alt=""
- src="/images/storage-limit/close.svg"
- sx={(theme) => ({
- ...theme.applyStyles("dark", {
- filter: "invert(1)",
- }),
- })}
- />
+ <HugeiconsIcon icon={Cancel01Icon} size={18} />
</IconButton>
</Stack>
<Stack
@@ -845,18 +835,8 @@ const StorageLimitDialog: React.FC<{
disabled={loading}
control={
<Radio
- icon={
- <img
- alt=""
- src="/images/storage-limit/unselected.svg"
- />
- }
- checkedIcon={
- <img
- alt=""
- src="/images/storage-limit/selected.svg"
- />
- }
+ icon={<StorageLimitRadioIcon />}
+ checkedIcon={<StorageLimitRadioIcon />}
/>
}
label={t("no_limit")}
@@ -888,18 +868,8 @@ const StorageLimitDialog: React.FC<{
disabled={loading}
control={
<Radio
- icon={
- <img
- alt=""
- src="/images/storage-limit/unselected.svg"
- />
- }
- checkedIcon={
- <img
- alt=""
- src="/images/storage-limit/selected.svg"
- />
- }
+ icon={<StorageLimitRadioIcon />}
+ checkedIcon={<StorageLimitRadioIcon />}
/>
}
label={t("storage_limit_up_to")}
@@ -976,35 +946,27 @@ const StorageLimitDialog: React.FC<{
>
{t("storage_limit_explanation")}
</Typography>
- <Stack
- sx={{
- gap: 1.5,
- "& .MuiButton-root": {
- height: 52,
- px: 3,
- borderRadius: "20px",
- fontSize: 14,
- lineHeight: "20px",
- },
- }}
- >
+ <Stack sx={{ gap: 1.5 }}>
<LoadingButton
fullWidth
type="submit"
- color="accent"
loading={loading}
+ sx={{
+ ...v2SubmitButtonSx,
+ flex: "none",
+ fontWeight: 600,
+ }}
>
{t("save")}
</LoadingButton>
<FocusVisibleButton
fullWidth
- color="secondary"
disabled={loading}
onClick={onClose}
- sx={{
- bgcolor: "secondary.dark",
- "&:hover": { bgcolor: "fill.muted" },
- }}
+ sx={[
+ v2CancelButtonSx,
+ { flex: "none", fontWeight: 600 },
+ ]}
>
{t("cancel")}
</FocusVisibleButton>
@@ -1013,3 +975,25 @@ const StorageLimitDialog: React.FC<{
</Dialog>
);
};
+
+const StorageLimitRadioIcon = styled("span")(({ theme }) => ({
+ width: 16,
+ height: 16,
+ boxSizing: "border-box",
+ border: "1px solid",
+ borderColor: theme.vars.palette.text.faint,
+ borderRadius: "50%",
+ display: "grid",
+ placeItems: "center",
+ ".Mui-checked &": {
+ borderColor: theme.vars.palette.accent.main,
+ "&::after": {
+ content: '""',
+ width: 8,
+ height: 8,
+ borderRadius: "50%",
+ backgroundColor: theme.vars.palette.accent.main,
+ },
+ },
+ ".Mui-disabled &": { opacity: 0.5 },
+}));