add field number in step 3

This commit is contained in:
Ehsan
2024-10-20 01:00:34 +03:30
parent 2b64cb3601
commit 46c33c6eb9
6 changed files with 45 additions and 21 deletions
+14 -9
View File
@@ -12,16 +12,19 @@ function EditField({
iconGray, iconGray,
isTransparent, isTransparent,
noDisable, noDisable,
type,
props,
}) { }) {
return ( return (
<div className="relative w-full"> <div className="relative w-full">
<TextField <TextField
{...props}
value={data?.value} value={data?.value}
rows={multiline} rows={multiline}
multiline={multiline} multiline={multiline}
disabled={noDisable ? false : !data?.isEdit} disabled={noDisable ? false : !data?.isEdit}
placeholder={placeholder || ""} placeholder={placeholder || ""}
type="text" type={type || "text"}
className={`!w-full res-field-account dark:!bg-transparent ${ className={`!w-full res-field-account dark:!bg-transparent ${
isTransparent ? "!bg-transparent lg:!bg-[#FFF]" : "!bg-[#FFF]" isTransparent ? "!bg-transparent lg:!bg-[#FFF]" : "!bg-[#FFF]"
}`} }`}
@@ -48,15 +51,17 @@ function EditField({
}, },
}} }}
/> />
<Button {!type && (
className={`!absolute !left-[8px] !-translate-y-1/2 !min-w-fit !p-1 <Button
className={`!absolute !left-[8px] !-translate-y-1/2 !min-w-fit !p-1
${multiline ? "!top-[24px]" : "!top-1/2"}`} ${multiline ? "!top-[24px]" : "!top-1/2"}`}
onClick={() => { onClick={() => {
changeData(!data.isEdit, "isEdit", name); changeData(!data.isEdit, "isEdit", name);
}} }}
> >
{icon ? icon : iconGray ? <EditGrayA /> : <EditOrangeA />} {icon ? icon : iconGray ? <EditGrayA /> : <EditOrangeA />}
</Button> </Button>
)}
</div> </div>
); );
} }
+1 -1
View File
@@ -647,7 +647,7 @@ html {
} }
.dark .panel-jalaali .days-body .day.hovered:not(.weekend-day) span { .dark .panel-jalaali .days-body .day.hovered:not(.weekend-day) span {
color: #A1A1A1 !important; color: #a1a1a1 !important;
} }
.dark .panel-jalaali .days-body .day.hovered.today:not(.weekend-day) span { .dark .panel-jalaali .days-body .day.hovered.today:not(.weekend-day) span {
+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 },
@@ -27,8 +27,8 @@ function Form({ setValue, parent, data, setData }) {
}); });
return ( return (
<div> <>
<div className="mt-[24px] md:mt-[26px] lg:mt-[28px] grid grid-cols-1 md:grid-cols-2 gap-x-[48px] gap-y-[24px]"> <div className="mt-[24px] scroll-mui md:mt-[26px] lg:mt-[28px] grid grid-cols-1 md:grid-cols-2 gap-x-[48px] gap-y-[24px]">
<ContentText text="نام و نام خانوادگی"> <ContentText text="نام و نام خانوادگی">
<EditField <EditField
isTransparent={true} isTransparent={true}
@@ -105,7 +105,7 @@ function Form({ setValue, parent, data, setData }) {
</div> </div>
</Button> </Button>
</div> </div>
</div> </>
); );
} }
@@ -3,6 +3,7 @@ import ContentText from "@/app/component/ContentText";
import TimePickerField from "@/app/component/TimePickerField"; import TimePickerField from "@/app/component/TimePickerField";
import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect"; import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect";
import { numberTurns, turnTime, workplace } from "./listSelector"; import { numberTurns, turnTime, workplace } from "./listSelector";
import EditField from "@/app/component/EditField";
function Form({ function Form({
handleClose, handleClose,
@@ -24,11 +25,21 @@ function Form({
<div className="flex flex-col gap-[32px] md:gap-[36px] lg:gap-[40px] min-w-fit md:min-w-[420px]"> <div className="flex flex-col gap-[32px] md:gap-[36px] lg:gap-[40px] min-w-fit md:min-w-[420px]">
<div className="flex relative flex-col gap-[16px]"> <div className="flex relative flex-col gap-[16px]">
<ContentText text="تعداد نوبت"> <ContentText text="تعداد نوبت">
<AutoCompleteSelect <EditField
updateData={updateData} isTransparent={true}
label="تعداد نوبت" iconGray={true}
changeData={updateData}
data={data?.number_turns}
noDisable={true}
type="number"
placeholder="انتخاب کنید..."
name="number_turns" name="number_turns"
list={numberTurns} props={{
inputProps: {
min: 0,
max: 10,
},
}}
/> />
</ContentText> </ContentText>
<ContentText text="زمان نوبت"> <ContentText text="زمان نوبت">
@@ -5,9 +5,17 @@ const numberTurns = [
]; ];
const turnTime = [ const turnTime = [
{ id: "1", label: "10:00" }, { id: 1, label: "00:05" },
{ id: "2", label: "11:00" }, { id: 2, label: "00:10" },
{ id: "3", label: "12:00" }, { id: 3, label: "00:15" },
{ id: 4, label: "00:20" },
{ id: 5, label: "00:25" },
{ id: 6, label: "00:30" },
{ id: 7, label: "00:40" },
{ id: 8, label: "00:50" },
{ id: 9, label: "01:00" },
{ id: 10, label: "01:15" },
{ id: 11, label: "01:30" },
]; ];
const workplace = [ const workplace = [