@@ -36,9 +39,11 @@ function ClinicsPage({ matchedCity, matchedState }) {
detail="در قسمت زیر می توانید کلینیک مورد نظر خود را جستجو نمایید"
>
diff --git a/components/doctors/index.js b/components/doctors/index.js
index 5dd3f99..252e669 100644
--- a/components/doctors/index.js
+++ b/components/doctors/index.js
@@ -18,9 +18,9 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
const [data, setData] = useState({
expertise: "",
+ turn: true,
gender: 0,
degree: 0,
- turn: true,
});
useEffect(() => {
diff --git a/components/doctors/modal/Content.js b/components/doctors/modal/Content.js
index 566f731..894ea4a 100644
--- a/components/doctors/modal/Content.js
+++ b/components/doctors/modal/Content.js
@@ -2,6 +2,7 @@ import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect";
import RadioContent from "./RadioContent";
import { Switch } from "@mui/material";
import { category, expertise } from "./listSelector";
+import specialties from "@/data/specialties.json";
const group1 = ["خانم", "آقا", "هر دو"];
const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"];
@@ -11,6 +12,8 @@ function Content({ data, setData }) {
const changeData = (value, name) => {
setData({ ...data, [name]: value });
};
+ const parentList = specialties.map(item => !item.parent);
+ const childrenList = specialties.map(item => item.parent);
return (
diff --git a/components/doctors/sortlist/SelectSort.js b/components/doctors/sortlist/SelectSort.js
index 4a0fea6..d1280a5 100644
--- a/components/doctors/sortlist/SelectSort.js
+++ b/components/doctors/sortlist/SelectSort.js
@@ -11,16 +11,14 @@ const listSort = [
];
function SelectSort() {
- const [sort, setSort] = useState(3);
+ const [sort, setSort] = useState("");
const handleChange = (event) => setSort(event.target.value);
- console.log(sort);
-
return (
{
@@ -29,14 +27,15 @@ function SelectSort() {
-
- {Array(sort).fill({}).map((_, idx) => (
-
-
-
- ))}
-
- {/* {value || "مرتب سازی"} */}
+ {value ? (
+
+ {Array(sort).fill({}).map((_, idx) => (
+
+
+
+ ))}
+
+ ) : "مرتب سازی"}
);
}}
@@ -62,14 +61,10 @@ function SelectSort() {
className="!flex !flex-col !items-start !w-full hover:!bg-transparent"
>
- {/* {item.label} */}
{Array(item.label).fill({}).map((_, idx) => (
))}
- {/* {listSort.length > idx + 1 && (
-
- )} */}
))}
diff --git a/components/searchHead/SmSearch.js b/components/searchHead/SmSearch.js
index 6cb5753..2c60b16 100644
--- a/components/searchHead/SmSearch.js
+++ b/components/searchHead/SmSearch.js
@@ -1,7 +1,7 @@
import SearchD from "@/components/icons/SearchD";
import { Button, ButtonGroup, TextField } from "@mui/material";
-function SmSearch({ placeholder, searchHandler }) {
+function SmSearch({ placeholder, changeSearch, handleSearch, search }) {
return (
changeSearch(e.target.value)}
InputProps={{
disableUnderline: true,
}}
@@ -26,17 +28,17 @@ function SmSearch({ placeholder, searchHandler }) {
}}
placeholder={placeholder}
dir="rtl"
- onChange={e => searchHandler(e)}
className={`!shadow-none !w-full !px-5 !h-full bg-[#FAFAFA] !text-[14px] md:!text-[16px] !min-w-[50%] !rounded-0 !font-normal !text-[#6C757D]`}
/>
diff --git a/components/specialties/index.js b/components/specialties/index.js
index a2718c6..4602fbb 100644
--- a/components/specialties/index.js
+++ b/components/specialties/index.js
@@ -8,13 +8,13 @@ import specialtiesData from "@/data/specialties.json";
import { searchOnList } from "@/helper";
function SpecialtiesPage() {
+ const [search, setSearch] = useState("");
const [filteredSpecialties, setFilteredSpecialties] = useState(specialtiesData);
- const searchHandler = (e) => {
- setFilteredSpecialties(
- searchOnList(specialtiesData, e.target.value, 'name')
- );
- };
+ const changeSearch = text => setSearch(text);
+
+ const handleSearch = () =>
+ setFilteredSpecialties(searchOnList(specialtiesData, search, 'name'));
return (
@@ -22,7 +22,12 @@ function SpecialtiesPage() {
title="تخصص مورد نظر شما چیست؟"
detail="تخصص مورد نظرتان را جستجو کرده و یا از لیست زیر انتخاب نمایید:"
>
-
+
diff --git a/data/clinics.json b/data/clinics.json
index 4404b53..63b21f8 100644
--- a/data/clinics.json
+++ b/data/clinics.json
@@ -61,7 +61,8 @@
"اطفال"
],
"doctors": "۵۰",
+ "city": "اهواز",
"location": "اهواز، کیان آباد، خیابان ۱۶ غربی، پلاک ۱۰",
"hours_of_work": "شنبه تا سه شنبه ساعت ۱۶ تا ۲۲"
}
-]
+]
\ No newline at end of file