add prettier formatter to all file
This commit is contained in:
@@ -2,59 +2,68 @@ import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect";
|
||||
import RadioContent from "./RadioContent";
|
||||
import { Switch } from "@mui/material";
|
||||
|
||||
const specialties = ['چشم پزشکی1', 'چشم پزشکی2', 'چشم پزشکی3', 'چشم پزشکی4', 'چشم پزشکی5'];
|
||||
const group1 = ['خانم', 'آقا', 'هر دو'];
|
||||
const group2 = ['فوق تخصص', 'دکترای تخصصی', 'متخصص', 'دکتری'];
|
||||
const specialties = [
|
||||
"چشم پزشکی1",
|
||||
"چشم پزشکی2",
|
||||
"چشم پزشکی3",
|
||||
"چشم پزشکی4",
|
||||
"چشم پزشکی5",
|
||||
];
|
||||
const group1 = ["خانم", "آقا", "هر دو"];
|
||||
const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"];
|
||||
|
||||
const label = { inputProps: { 'aria-label': 'Switch demo' } };
|
||||
const label = { inputProps: { "aria-label": "Switch demo" } };
|
||||
|
||||
function Content({ data, setData }) {
|
||||
const changeData = (value, name) => {
|
||||
setData({ ...data, [name]: value });
|
||||
};
|
||||
|
||||
const changeData = (value, name) => {
|
||||
setData({ ...data, [name]: value })
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="mt-[50px] px-[0px] md:px-[19px] lg:px-[38px] mb-[32px]">
|
||||
<AutoCompleteSelect
|
||||
updateData={(event) => changeData(event.target.innerText, 'expertise')}
|
||||
list={specialties}
|
||||
name='expertise'
|
||||
label='دسته بندی'
|
||||
/>
|
||||
<div className="mt-[24px]">
|
||||
<AutoCompleteSelect
|
||||
updateData={(event) => changeData(event.target.innerText, 'expertise')}
|
||||
list={specialties}
|
||||
name='expertise'
|
||||
label='تخصص'
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-[40px] mb-[32px]">
|
||||
<RadioContent
|
||||
changeData={(value) => changeData(+value, 'gender')}
|
||||
value={data.gender}
|
||||
text='جنسیت پزشک'
|
||||
group={group1}
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<RadioContent
|
||||
changeData={(value) => changeData(+value, 'degree')}
|
||||
value={data.degree}
|
||||
text='درجه علمی'
|
||||
group={group2}
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<div className="flex items-center justify-start gap-[12px]">
|
||||
<p className="text-[#3B3B3B] text-[16px] font-medium">فقط پزشکان دارای نوبت</p>
|
||||
<Switch
|
||||
{...label}
|
||||
onChange={event => changeData(event.target.checked, 'turn')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
return (
|
||||
<div className="mt-[50px] px-[0px] md:px-[19px] lg:px-[38px] mb-[32px]">
|
||||
<AutoCompleteSelect
|
||||
updateData={(event) => changeData(event.target.innerText, "expertise")}
|
||||
list={specialties}
|
||||
name="expertise"
|
||||
label="دسته بندی"
|
||||
/>
|
||||
<div className="mt-[24px]">
|
||||
<AutoCompleteSelect
|
||||
updateData={(event) =>
|
||||
changeData(event.target.innerText, "expertise")
|
||||
}
|
||||
list={specialties}
|
||||
name="expertise"
|
||||
label="تخصص"
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-[40px] mb-[32px]">
|
||||
<RadioContent
|
||||
changeData={(value) => changeData(+value, "gender")}
|
||||
value={data.gender}
|
||||
text="جنسیت پزشک"
|
||||
group={group1}
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<RadioContent
|
||||
changeData={(value) => changeData(+value, "degree")}
|
||||
value={data.degree}
|
||||
text="درجه علمی"
|
||||
group={group2}
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<div className="flex items-center justify-start gap-[12px]">
|
||||
<p className="text-[#3B3B3B] text-[16px] font-medium">
|
||||
فقط پزشکان دارای نوبت
|
||||
</p>
|
||||
<Switch
|
||||
{...label}
|
||||
onChange={(event) => changeData(event.target.checked, "turn")}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Content
|
||||
export default Content;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'use client';
|
||||
"use client";
|
||||
|
||||
import CloseOrangeModal from "@/components/icons/CloseOrangeModal";
|
||||
import { styleDefault } from "@/mui";
|
||||
@@ -7,58 +7,55 @@ import { useState } from "react";
|
||||
import Content from "./Content";
|
||||
|
||||
function FilterModal({ data, setData, children }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const handleOpen = () => setOpen(true);
|
||||
const handleClose = () => setOpen(false);
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
const handleOpen = () => setOpen(true);
|
||||
const handleClose = () => setOpen(false);
|
||||
return (
|
||||
<>
|
||||
{/* Button Modal */}
|
||||
<div onClick={handleOpen}>{children}</div>
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Button Modal */}
|
||||
<div onClick={handleOpen}>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
{/* Content Modal */}
|
||||
<Modal
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
className=" !overflow-hidden !max-h-[calc(100vh-16px)]"
|
||||
>
|
||||
<div
|
||||
style={styleDefault}
|
||||
className="!px-[16px] !my-[12px] overflow-auto md:!min-w-[580px] md:!px-[24px] lg:!px-[32px] !py-[24px] !bg-[#FFF] !rounded-[8px] !shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
|
||||
{/* Content Modal */}
|
||||
<Modal
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
className=" !overflow-hidden !max-h-[calc(100vh-16px)]"
|
||||
>
|
||||
<div
|
||||
style={styleDefault}
|
||||
className="!px-[16px] !my-[12px] overflow-auto md:!min-w-[580px] md:!px-[24px] lg:!px-[32px] !py-[24px] !bg-[#FFF] !rounded-[8px] !shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
|
||||
!w-full md:!w-fit !h-full md:!h-fit !flex !flex-col !justify-between"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
className="flex justify-between w-full"
|
||||
>
|
||||
<p className="text-[#3B3B3B] text-[20px] font-bold">فیلترها</p>
|
||||
<Button
|
||||
className="cursor-pointer !p-0 flex items-center justify-center gap-1"
|
||||
onClick={handleClose}
|
||||
variant="text"
|
||||
>
|
||||
<CloseOrangeModal />
|
||||
<p className="text-[#F17732] text-[14px] font-normal">حذف همه</p>
|
||||
</Button>
|
||||
</div>
|
||||
<Content data={data} setData={setData} />
|
||||
</div>
|
||||
<div className="flex justify-end w-full">
|
||||
<Button
|
||||
className="!px-3 !py-2 !text-[16px] !font-medium"
|
||||
onClick={handleClose}
|
||||
variant="contained"
|
||||
>
|
||||
اعمال تغییرات
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
>
|
||||
<div>
|
||||
<div className="flex justify-between w-full">
|
||||
<p className="text-[#3B3B3B] text-[20px] font-bold">فیلترها</p>
|
||||
<Button
|
||||
className="cursor-pointer !p-0 flex items-center justify-center gap-1"
|
||||
onClick={handleClose}
|
||||
variant="text"
|
||||
>
|
||||
<CloseOrangeModal />
|
||||
<p className="text-[#F17732] text-[14px] font-normal">
|
||||
حذف همه
|
||||
</p>
|
||||
</Button>
|
||||
</div>
|
||||
<Content data={data} setData={setData} />
|
||||
</div>
|
||||
<div className="flex justify-end w-full">
|
||||
<Button
|
||||
className="!px-3 !py-2 !text-[16px] !font-medium"
|
||||
onClick={handleClose}
|
||||
variant="contained"
|
||||
>
|
||||
اعمال تغییرات
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default FilterModal
|
||||
export default FilterModal;
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import Radios from "./Radios"
|
||||
import Radios from "./Radios";
|
||||
|
||||
function RadioContent({ group, text, value, changeData }) {
|
||||
return (
|
||||
<div>
|
||||
<p className="text-[16px] font-medium text-[#3B3B3B]">{text}</p>
|
||||
<div className="mt-[16px]">
|
||||
<Radios
|
||||
changeData={changeData}
|
||||
group={group}
|
||||
value={value}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div>
|
||||
<p className="text-[16px] font-medium text-[#3B3B3B]">{text}</p>
|
||||
<div className="mt-[16px]">
|
||||
<Radios changeData={changeData} group={group} value={value} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default RadioContent
|
||||
export default RadioContent;
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
import { FormControlLabel, Radio, RadioGroup } from "@mui/material"
|
||||
import { FormControlLabel, Radio, RadioGroup } from "@mui/material";
|
||||
|
||||
function Radios({ group, value, changeData }) {
|
||||
return (
|
||||
<RadioGroup
|
||||
value={value}
|
||||
onChange={e => changeData(e.target.value)}
|
||||
sx={{
|
||||
'& .MuiFormControlLabel-root': {
|
||||
marginRight: '0 !important',
|
||||
transform: 'translateX(9px)'
|
||||
}
|
||||
}}
|
||||
>
|
||||
{group.map((item, idx) => (
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Radio
|
||||
className="!ml-2" />
|
||||
}
|
||||
label={item}
|
||||
value={idx}
|
||||
key={idx}
|
||||
/>
|
||||
))}
|
||||
</RadioGroup>
|
||||
)
|
||||
return (
|
||||
<RadioGroup
|
||||
value={value}
|
||||
onChange={(e) => changeData(e.target.value)}
|
||||
sx={{
|
||||
"& .MuiFormControlLabel-root": {
|
||||
marginRight: "0 !important",
|
||||
transform: "translateX(9px)",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{group.map((item, idx) => (
|
||||
<FormControlLabel
|
||||
control={<Radio className="!ml-2" />}
|
||||
label={item}
|
||||
value={idx}
|
||||
key={idx}
|
||||
/>
|
||||
))}
|
||||
</RadioGroup>
|
||||
);
|
||||
}
|
||||
|
||||
export default Radios
|
||||
export default Radios;
|
||||
|
||||
Reference in New Issue
Block a user