diff --git a/web/apps/photos/src/components/FixCreationTime.tsx b/web/apps/photos/src/components/FixCreationTime.tsx index 2fb99a336..141ad1802 100644 --- a/web/apps/photos/src/components/FixCreationTime.tsx +++ b/web/apps/photos/src/components/FixCreationTime.tsx @@ -1,7 +1,15 @@ import DialogBox from "@ente/shared/components/DialogBox/"; -import { Button, LinearProgress, styled } from "@mui/material"; +import { + Button, + FormControl, + FormControlLabel, + FormLabel, + LinearProgress, + Radio, + RadioGroup, +} from "@mui/material"; import { ComfySpan } from "components/ExportInProgress"; -import { Field, Form, Formik, type FormikHelpers } from "formik"; +import { useFormik } from "formik"; import { t } from "i18next"; import { GalleryContext } from "pages/gallery"; import React, { useContext, useEffect, useState } from "react"; @@ -103,7 +111,7 @@ export default FixCreationTime; const messageForStep = (step?: Step) => { switch (step) { case undefined: - return t("UPDATE_CREATION_TIME_NOT_STARTED"); + return undefined; case "running": return undefined; case "completed": @@ -115,97 +123,67 @@ const messageForStep = (step?: Step) => { interface OptionsFormProps { step?: Step; - onSubmit: ( - values: FormValues, - formikHelpers: FormikHelpers, - ) => void | Promise; + onSubmit: (values: FormValues) => void | Promise; hide: () => void; } const OptionsForm: React.FC = ({ step, onSubmit, hide }) => { + const { values, handleChange, handleSubmit } = useFormik({ + initialValues: { + option: "date-time-original", + customTime: new Date(), + }, + validateOnBlur: false, + onSubmit, + }); + return ( - - initialValues={{ - option: "date-time-original", - customTime: new Date(), - }} - validateOnBlur={false} - onSubmit={onSubmit} - > - {({ values, handleChange, handleSubmit }) => ( - <> - {(step === undefined || - step === "completed-with-errors") && ( -
-
-
- )} -