design dark mode add-doctor & change field time to date-picker

This commit is contained in:
Ehsan
2024-10-02 13:55:54 +03:30
parent c29c787f09
commit dd61240ed7
8 changed files with 120 additions and 29 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import { DatePicker } from "jalaali-react-date-picker";
function Date() {
return (
<div className="flex justify-center">
<div className="flex justify-center sm-datepicker">
<DatePicker
nextIcon={<></>}
prevIcon={<></>}
@@ -7,6 +7,7 @@ import FieldIcon from "@/app/component/FieldIcon";
import { Button } from "@mui/material";
import PlusBlueP from "@/components/icons/PlusBlueP";
import ClockP from "@/components/icons/ClockP";
import TimePickerInput from "@/app/component/TimePickerInput";
function Form() {
const [data, setData] = useState({
@@ -38,7 +39,7 @@ function Form() {
list={turnsPerDay}
/>
</ContentText>
<ContentText text="تعداد نوبت در هر روز">
<ContentText text="زمان هر نوبت">
<AutoCompleteSelect
updateData={updateSelect}
label="انتخاب کنید..."
@@ -50,7 +51,7 @@ function Form() {
<div className="hidden lg:flex min-w-[152px]"></div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:flex items-end justify-center gap-[16px] mt-[32px]">
<ContentText text="تعداد نوبت در هر روز">
<ContentText text="روز هفته">
<AutoCompleteSelect
updateData={updateSelect}
label="انتخاب کنید..."
@@ -59,7 +60,7 @@ function Form() {
/>
</ContentText>
<ContentText text="زمان شروع">
<FieldIcon
<TimePickerInput
placeholder="انتخاب کنید..."
changeData={changeData}
icon={<ClockP />}
@@ -67,7 +68,7 @@ function Form() {
/>
</ContentText>
<ContentText text="زمان پایان">
<FieldIcon
<TimePickerInput
placeholder="انتخاب کنید..."
changeData={changeData}
icon={<ClockP />}
@@ -14,8 +14,13 @@ function ContentModal({
handleClose,
}) {
const [value, setValue] = useState(0);
const [isVacation, setIsVacation] = useState(false);
const handleChange = (event) => setValue(+event.target.value);
const handleChange = (event) => {
const valueRadio = +event.target.value;
setIsVacation(valueRadio);
setValue(valueRadio);
};
return (
<Modal open={open} onClose={handleClose}>
@@ -36,6 +41,7 @@ function ContentModal({
<Radios value={value} handleChange={handleChange} />
<Form
handleClose={handleClose}
isVacation={isVacation}
dataChange={dataChange}
setData={setData}
value={value}
@@ -2,27 +2,38 @@ import { Button } from "@mui/material";
import ContentText from "@/components/panel/ContentText";
import TimePickerField from "@/app/component/TimePickerField";
function Form({ handleClose, setData, dataChange, data, value }) {
function Form({ handleClose, isVacation, setData, dataChange, data, value }) {
// console.log(isVacation);
return (
<div className="flex flex-col gap-[32px] md:gap-[36px] lg:gap-[40px] min-w-fit md:min-w-[420px]">
<ContentText text="زمان شروع">
<TimePickerField
dataChange={dataChange}
disable={value === 1}
setData={setData}
timeStart={true}
data={data}
/>
</ContentText>
<ContentText text="زمان پایان">
<TimePickerField
dataChange={dataChange}
disable={value === 1}
setData={setData}
timeStart={false}
data={data}
/>
</ContentText>
<div className="flex relative flex-col gap-[32px] md:gap-[36px] lg:gap-[40px]">
<ContentText text="زمان شروع">
<TimePickerField
dataChange={dataChange}
isDisable={isVacation}
disable={value === 1}
setData={setData}
timeStart={true}
data={data}
/>
</ContentText>
<ContentText text="زمان پایان">
<TimePickerField
dataChange={dataChange}
isDisable={isVacation}
disable={value === 1}
setData={setData}
timeStart={false}
data={data}
/>
</ContentText>
<div
className={`
absolute transition-all duration-500 right-0 top-0 w-full h-full bg-[rgba(255,255,255,.85)] dark:bg-[rgba(34,36,51,.85)]
${isVacation ? "max-w-full" : "max-w-0"}`}
></div>
</div>
<div className="flex flex-wrap items-center justify-center gap-[16px]">
<Button
variant="outlined"