change function and design page doctors & signin & signup & home & specialties & helper
This commit is contained in:
@@ -18,19 +18,18 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
|
||||
province: matchedState?.name || params?.province,
|
||||
city: matchedCity?.name || params?.city,
|
||||
});
|
||||
const findItem = (name, value) =>
|
||||
specialties.find((item) => item[name] === value);
|
||||
const itemCategory = findItem("id", params.category);
|
||||
const itemSpecialties = findItem("id", params.specialties);
|
||||
const findSpecial = (id) => specialties.find((item) => item.id === id);
|
||||
|
||||
const [data, setData] = useState({
|
||||
category: itemCategory || "",
|
||||
specialties: itemSpecialties
|
||||
? { ...itemSpecialties, label: itemSpecialties.name }
|
||||
category: findSpecial(params.specialties)?.parent
|
||||
? findSpecial(findSpecial(params.specialties)?.parent)
|
||||
: findSpecial(params.specialties) || "",
|
||||
specialties: findSpecial(params.specialties)?.parent
|
||||
? findSpecial(params.specialties)
|
||||
: "",
|
||||
turn: params && params.hasOwnProperty("turn") ? JSON.parse(params.turn) : 1,
|
||||
gender: params.gender || "هر دو",
|
||||
degree: params.degree || "متخصص",
|
||||
degree: params.degree || "همه موارد",
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user