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 { LocalizationProvider, TimePicker } from "@mui/x-date-pickers";
import { handleTwoLength } from "@/helper";
import ClockP from "@/components/icons/ClockP";
function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) {
const input = useRef();
@@ -88,15 +89,12 @@ function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) {
{value}
</p>
</LocalizationProvider>
{/* <button
onClick={() => {
console.log(input);
input.current.open = true;
}}
<div
className="absolute left-[12px] top-1/2 -translate-y-1/2 cursor-pointer"
onClick={openTimePicker}
>
test
</button> */}
<ClockP />
</div>
</div>
);
}
+1 -1
View File
@@ -9,7 +9,7 @@ import GeneralInformation from "./listMenu/generalInformation";
import Step from "./Step";
function AddDoctorPage() {
const [value, setValue] = useState(1);
const [value, setValue] = useState(0);
const [data, setData] = useState({
general: {
name: { value: "", placeholder: "احسان احمدی", isEdit: true },
@@ -74,7 +74,7 @@ function Form({
disable={value === 1}
setData={setData}
timeStart={true}
data={data}
data={data[parent]}
/>
</ContentText>
<ContentText text="زمان پایان">
@@ -84,7 +84,7 @@ function Form({
disable={value === 1}
setData={setData}
timeStart={false}
data={data}
data={data[parent]}
/>
</ContentText>
<div