change component file & set data in url & handle remove all variable
This commit is contained in:
@@ -8,6 +8,14 @@ import ListDoctors from "./listDoctors";
|
||||
import LocationD from "../icons/LocationD";
|
||||
import ModalSearchCity from "@/app/component/modalSearchCity";
|
||||
|
||||
const defaultData = {
|
||||
category: "",
|
||||
expertise: "",
|
||||
turn: true,
|
||||
gender: "هر دو",
|
||||
degree: "متخصص",
|
||||
}
|
||||
|
||||
function DoctorsPage({ params, matchedCity, matchedState }) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -16,13 +24,7 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
|
||||
city: matchedCity?.name || params?.city,
|
||||
});
|
||||
|
||||
const [data, setData] = useState({
|
||||
category: "",
|
||||
expertise: "",
|
||||
turn: true,
|
||||
gender: "خانم",
|
||||
degree: "فوق تخصص",
|
||||
});
|
||||
const [data, setData] = useState(defaultData);
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => {
|
||||
@@ -53,7 +55,7 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
|
||||
</Button>
|
||||
</ModalSearchCity>
|
||||
<div className="flex flex-col lg:flex-row items-start lg:items-center justify-center gap-[24px] lg:gap-[32px] w-full">
|
||||
<SearchBar data={data} setData={setData} params={params} />
|
||||
<SearchBar data={data} setData={setData} params={params} defaultData={defaultData} />
|
||||
<SortList data={data} setData={setData} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user