change format all file
This commit is contained in:
@@ -6,7 +6,6 @@ import { filterList } from "@/helper";
|
||||
const group1 = ["خانم", "آقا", "هر دو"];
|
||||
const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"];
|
||||
|
||||
|
||||
function Content({ data, setData }) {
|
||||
const router = useRouter();
|
||||
const { parentList, childrenList } = filterList(data);
|
||||
@@ -15,21 +14,21 @@ function Content({ data, setData }) {
|
||||
const current = new URLSearchParams(window.location.search);
|
||||
current.set(name, value.id || value);
|
||||
if (removeSpecialties) {
|
||||
current.delete('specialties')
|
||||
};
|
||||
current.delete("specialties");
|
||||
}
|
||||
const queryString = current.toString();
|
||||
router.push(`/doctors?${queryString}`)
|
||||
}
|
||||
router.push(`/doctors?${queryString}`);
|
||||
};
|
||||
|
||||
const changeData = (value, name, removeSpecialties) => {
|
||||
changeUrl(value, name, removeSpecialties);
|
||||
const newData = data;
|
||||
newData[name] = value;
|
||||
if (removeSpecialties) {
|
||||
newData.specialties = ''
|
||||
};
|
||||
newData.specialties = "";
|
||||
}
|
||||
setData(newData);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="mt-[50px] px-[0px] md:px-[19px] lg:px-[38px] mb-[32px]">
|
||||
@@ -59,7 +58,7 @@ function Content({ data, setData }) {
|
||||
value={data.gender}
|
||||
text="جنسیت پزشک"
|
||||
group={group1}
|
||||
name='gender'
|
||||
name="gender"
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<RadioContent
|
||||
@@ -67,7 +66,7 @@ function Content({ data, setData }) {
|
||||
value={data.degree}
|
||||
text="درجه علمی"
|
||||
group={group2}
|
||||
name='degree'
|
||||
name="degree"
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<div className="flex items-center justify-start gap-[12px]">
|
||||
@@ -76,7 +75,7 @@ function Content({ data, setData }) {
|
||||
<Switch
|
||||
checked={data.turn}
|
||||
onChange={(event) => {
|
||||
changeData(event.target.checked ? 1 : 0, "turn")
|
||||
changeData(event.target.checked ? 1 : 0, "turn");
|
||||
}}
|
||||
/>
|
||||
}
|
||||
@@ -86,7 +85,7 @@ function Content({ data, setData }) {
|
||||
fontSize: "16px",
|
||||
fontWeight: 500,
|
||||
},
|
||||
marginLeft: '0 !important',
|
||||
marginLeft: "0 !important",
|
||||
}}
|
||||
label="فقط پزشکان دارای نوبت"
|
||||
labelPlacement="start"
|
||||
|
||||
@@ -16,7 +16,13 @@ function FilterModal({ data, setData, children }) {
|
||||
const handleClose = () => setOpen(false);
|
||||
|
||||
const deleteData = () => {
|
||||
clearFilterParams(router, ['turn', 'specialties', 'degree', 'category', 'gender'])
|
||||
clearFilterParams(router, [
|
||||
"turn",
|
||||
"specialties",
|
||||
"degree",
|
||||
"category",
|
||||
"gender",
|
||||
]);
|
||||
setData({
|
||||
category: "",
|
||||
specialties: "",
|
||||
@@ -25,7 +31,7 @@ function FilterModal({ data, setData, children }) {
|
||||
degree: "متخصص",
|
||||
});
|
||||
handleClose();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user