Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web][photos] Reuse shared dialog styles for Fix time

AswinAsoke7391e96f2e3
diff --git a/web/apps/photos/src/components/FixCreationTime.tsx b/web/apps/photos/src/components/FixCreationTime.tsx
index cc8b792185..b266dee87f 100644
--- a/web/apps/photos/src/components/FixCreationTime.tsx
+++ b/web/apps/photos/src/components/FixCreationTime.tsx
@@ -13,6 +13,12 @@ import {
Typography,
} from "@mui/material";
import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";
+import {
+ v2CloseButtonSx,
+ v2HeaderRowSx,
+ v2PaperSx,
+ v2SubmitButtonSx,
+} from "ente-base/components/SingleInput.styles";
import type { ModalVisibilityProps } from "ente-base/components/utils/modal";
import log from "ente-base/log";
import { downloadManager } from "ente-gallery/services/download";
@@ -30,7 +36,6 @@ import { updateFilePublicMagicMetadata } from "ente-new/photos/services/file";
import { useFormik } from "formik";
import { t } from "i18next";
import React, { useEffect, useState } from "react";
-import { collectionDialogIconButtonSx } from "./CollectionDialog/styles";
type FixCreationTimeProps = ModalVisibilityProps & {
files: EnteFile[];
@@ -77,33 +82,21 @@ export const FixCreationTime: React.FC<FixCreationTimeProps> = ({
aria-busy={step == "running"}
slotProps={{
paper: {
- sx: (theme) => ({
- width: 560,
- maxWidth: "calc(100% - 32px)",
- m: "16px",
- p: "19px",
- border: "1px solid #e0e0e0",
- borderRadius: "20px",
- backgroundColor: "#f4f4f4",
- backgroundImage: "none",
- boxShadow: "none",
- ...theme.applyStyles("dark", {
- borderColor: "stroke.faint",
- backgroundColor: "#1b1b1b",
- }),
- }),
+ sx: [
+ v2PaperSx,
+ {
+ width: 560,
+ maxWidth: "calc(100% - 32px)",
+ boxSizing: "border-box",
+ m: "16px",
+ p: "19px",
+ },
+ ],
},
}}
>
<Stack sx={{ gap: "18px" }}>
- <Stack
- direction="row"
- sx={{
- alignItems: "center",
- justifyContent: "space-between",
- gap: 2,
- }}
- >
+ <Stack direction="row" sx={v2HeaderRowSx}>
<Typography
id="fix-date-time-title"
component="h2"
@@ -121,7 +114,7 @@ export const FixCreationTime: React.FC<FixCreationTimeProps> = ({
aria-label={t("close")}
onClick={onClose}
disabled={step == "running"}
- sx={collectionDialogIconButtonSx}
+ sx={v2CloseButtonSx}
>
<HugeiconsIcon icon={Cancel01Icon} size={18} />
</IconButton>
@@ -381,15 +374,14 @@ const OptionsForm: React.FC<OptionsFormProps> = ({
};
const submitButtonSx = {
+ ...v2SubmitButtonSx,
+ flex: "none",
minHeight: 52,
- borderRadius: "20px",
- fontSize: 14,
- lineHeight: "20px",
- fontWeight: 500,
- color: "#fff",
- backgroundColor: "#08c225",
- "&:hover": { backgroundColor: "#07ad21" },
- "&.Mui-disabled": { color: "text.faint", backgroundColor: "fill.faint" },
+ "&.Mui-disabled": {
+ color: "text.faint",
+ backgroundColor: "fill.faint",
+ opacity: 1,
+ },
};
const updateFiles = async (
diff --git a/web/packages/base/components/SingleInput.styles.ts b/web/packages/base/components/SingleInput.styles.ts
index f0fd6b1f08..4ca890452f 100644
--- a/web/packages/base/components/SingleInput.styles.ts
+++ b/web/packages/base/components/SingleInput.styles.ts
@@ -3,7 +3,7 @@ import type { SxProps, Theme } from "@mui/material";
const surfaceStroke = "#e0e0e0";
const surfaceStrokeDark = "rgba(255 255 255 / 0.12)";
-export const v2PaperSx: SxProps<Theme> = (theme) => ({
+export const v2PaperSx = ((theme: Theme) => ({
width: "min(444px, calc(100svw - 32px))",
maxWidth: "444px",
boxSizing: "content-box",
@@ -18,7 +18,7 @@ export const v2PaperSx: SxProps<Theme> = (theme) => ({
borderColor: surfaceStrokeDark,
backgroundColor: "#1b1b1b",
}),
-});
+})) satisfies SxProps<Theme>;
export const v2HeaderRowSx = {
alignItems: "center",
justifyContent: "space-between",