set icon for timepicker field and set deafult step to 0

This commit is contained in:
Ehsan
2024-10-21 00:39:16 +03:30
parent 97939fb101
commit df0a08dcdc
3 changed files with 10 additions and 12 deletions
+7 -9
View File
@@ -1,7 +1,8 @@
import { useEffect, useRef, useState } from "react"; import { useRef, useState } from "react";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { LocalizationProvider, TimePicker } from "@mui/x-date-pickers"; import { LocalizationProvider, TimePicker } from "@mui/x-date-pickers";
import { handleTwoLength } from "@/helper"; import { handleTwoLength } from "@/helper";
import ClockP from "@/components/icons/ClockP";
function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) { function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) {
const input = useRef(); const input = useRef();
@@ -88,15 +89,12 @@ function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) {
{value} {value}
</p> </p>
</LocalizationProvider> </LocalizationProvider>
{/* <button <div
onClick={() => { className="absolute left-[12px] top-1/2 -translate-y-1/2 cursor-pointer"
console.log(input); onClick={openTimePicker}
input.current.open = true;
}}
> >
test <ClockP />
</button> */} </div>
</div> </div>
); );
} }
+1 -1
View File
@@ -9,7 +9,7 @@ import GeneralInformation from "./listMenu/generalInformation";
import Step from "./Step"; import Step from "./Step";
function AddDoctorPage() { function AddDoctorPage() {
const [value, setValue] = useState(1); const [value, setValue] = useState(0);
const [data, setData] = useState({ const [data, setData] = useState({
general: { general: {
name: { value: "", placeholder: "احسان احمدی", isEdit: true }, name: { value: "", placeholder: "احسان احمدی", isEdit: true },
@@ -74,7 +74,7 @@ function Form({
disable={value === 1} disable={value === 1}
setData={setData} setData={setData}
timeStart={true} timeStart={true}
data={data} data={data[parent]}
/> />
</ContentText> </ContentText>
<ContentText text="زمان پایان"> <ContentText text="زمان پایان">
@@ -84,7 +84,7 @@ function Form({
disable={value === 1} disable={value === 1}
setData={setData} setData={setData}
timeStart={false} timeStart={false}
data={data} data={data[parent]}
/> />
</ContentText> </ContentText>
<div <div