diff --git a/app/component/TimePickerField.js b/app/component/TimePickerField.js index 4f898fd..81147f9 100644 --- a/app/component/TimePickerField.js +++ b/app/component/TimePickerField.js @@ -1,18 +1,26 @@ -import { useState } from "react"; +import { useEffect, useRef, useState } from "react"; import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; import { LocalizationProvider, TimePicker } from "@mui/x-date-pickers"; import { handleTwoLength } from "@/helper"; function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) { + const input = useRef(); const [value, setValue] = useState("00:00"); + const [isOpen, setIsOpen] = useState(false); + + const openTimePicker = () => setIsOpen(true); + const closeTimePicker = () => setIsOpen(false); return (
{ if (clockType === "hours") { @@ -28,6 +36,9 @@ function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) { : !(24 > timeValue.$H && timeValue.$H > 11 && !disableMinHour); } }} + renderInput={(params) => { + return setOpen(true)} />; + }} views={["hours", "minutes"]} placeholder="انتخاب کنید..." onChange={(e) => { @@ -69,13 +80,23 @@ function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) { }} />

{value}

+ {/* */}
); } diff --git a/app/layout.js b/app/layout.js index a027397..88d8126 100644 --- a/app/layout.js +++ b/app/layout.js @@ -15,6 +15,10 @@ export const metadata = { export default function RootLayout({ children }) { return ( + {children} diff --git a/components/panel/addDoctor/index.js b/components/panel/addDoctor/index.js index cdc34dc..3c4391c 100644 --- a/components/panel/addDoctor/index.js +++ b/components/panel/addDoctor/index.js @@ -9,7 +9,7 @@ import GeneralInformation from "./listMenu/generalInformation"; import Step from "./Step"; function AddDoctorPage() { - const [value, setValue] = useState(0); + const [value, setValue] = useState(2); const [data, setData] = useState({ general: { name: { value: "", placeholder: "احسان احمدی", isEdit: true }, @@ -35,7 +35,7 @@ function AddDoctorPage() { work_day: [ { name: "شنبه", - number_turns: "", + number_turns: 1, turn_time: "", workplace: "", morning_time: ["", ""], @@ -43,7 +43,7 @@ function AddDoctorPage() { }, { name: "یکشنبه", - number_turns: "", + number_turns: 1, turn_time: "", workplace: "", morning_time: ["", ""], @@ -51,7 +51,7 @@ function AddDoctorPage() { }, { name: "دوشنبه", - number_turns: "", + number_turns: 1, turn_time: "", workplace: "", morning_time: ["", ""], @@ -59,7 +59,7 @@ function AddDoctorPage() { }, { name: "سه شنبه", - number_turns: "", + number_turns: 1, turn_time: "", workplace: "", morning_time: ["", ""], @@ -67,7 +67,7 @@ function AddDoctorPage() { }, { name: "چهار شنبه", - number_turns: "", + number_turns: 1, turn_time: "", workplace: "", morning_time: ["", ""], @@ -75,7 +75,7 @@ function AddDoctorPage() { }, { name: "پنج شنبه", - number_turns: "", + number_turns: 1, turn_time: "", workplace: "", morning_time: ["", ""], @@ -83,6 +83,8 @@ function AddDoctorPage() { }, ], }); + console.log(data); + const components = [