change list sort doctors page & change function search list specialties & remove pagination from page specialties & fix zoom page & change design all fields & change regex validation phone number for nobat724 and clinic-pro
This commit is contained in:
@@ -3,38 +3,18 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import SearchBar from "./search";
|
||||
import SortList from "./sortlist";
|
||||
import { Button } from "@mui/material";
|
||||
import ListDoctors from "./listDoctors";
|
||||
import LocationD from "../icons/LocationD";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import ModalSearchCity from "@/app/component/modalSearchCity";
|
||||
import { useProvince } from "@/context/ProvinceProvider";
|
||||
import { Button } from "@mui/material";
|
||||
|
||||
// Data
|
||||
import citiesData from "@/data/city.json";
|
||||
import statesData from "@/data/state.json";
|
||||
|
||||
function DoctorsPage({ params, matchedCity, matchedState }) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [open, setOpen] = useState(false);
|
||||
const { isProvinceInclude } = useProvince();
|
||||
const [selected, setSelected] = useState({
|
||||
province: matchedState?.name,
|
||||
city: matchedCity?.name,
|
||||
province: matchedState?.name || params?.province,
|
||||
city: matchedCity?.name || params?.city,
|
||||
});
|
||||
const searchParams = useSearchParams();
|
||||
const locationSelected = {
|
||||
province: searchParams.get("province"),
|
||||
city: searchParams.get("city"),
|
||||
};
|
||||
const provinceId = statesData.find(
|
||||
(state) => state.name === locationSelected?.province
|
||||
);
|
||||
|
||||
const newCity =
|
||||
locationSelected.city ||
|
||||
(provinceId &&
|
||||
citiesData.find((city) => city.province_id === provinceId.id)?.name);
|
||||
|
||||
const [data, setData] = useState({
|
||||
expertise: "",
|
||||
|
||||
@@ -2,17 +2,20 @@ import { MenuItem, Select, SvgIcon } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import ArrowBottomD from "../../icons/ArrowBottomD";
|
||||
import SortD from "../../icons/SortD";
|
||||
import StarDI from "@/components/icons/StarDI";
|
||||
|
||||
const listSort = [
|
||||
{ label: "براساس امتیاز 1", id: 10 },
|
||||
{ label: "براساس امتیاز 2", id: 20 },
|
||||
{ label: "براساس امتیاز 3", id: 30 },
|
||||
{ label: 3, id: 30 },
|
||||
{ label: 4, id: 40 },
|
||||
{ label: 5, id: 50 },
|
||||
];
|
||||
|
||||
function SelectSort() {
|
||||
const [sort, setSort] = useState("");
|
||||
const [sort, setSort] = useState(3);
|
||||
|
||||
const handleChange = (event) => setSort(event.target.value);
|
||||
console.log(sort);
|
||||
|
||||
const handleChange = (event) => setSort(event.target.name);
|
||||
|
||||
return (
|
||||
<Select
|
||||
@@ -26,7 +29,14 @@ function SelectSort() {
|
||||
<SvgIcon color="primary">
|
||||
<SortD />
|
||||
</SvgIcon>
|
||||
{value || "مرتب سازی"}
|
||||
<ul className="flex items-center justify-start gap-1">
|
||||
{Array(sort).fill({}).map((_, idx) => (
|
||||
<li key={idx}>
|
||||
<StarDI />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{/* {value || "مرتب سازی"} */}
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
@@ -51,8 +61,11 @@ function SelectSort() {
|
||||
name={item.label}
|
||||
className="!flex !flex-col !items-start !w-full hover:!bg-transparent"
|
||||
>
|
||||
<div value={item.id} className="!p-2 !mr-2 !w-[calc(100%_-_16px)]">
|
||||
{item.label}
|
||||
<div value={item.id} className="!p-2 !mr-2 !w-[calc(100%_-_16px)] flex items-center justify-start">
|
||||
{/* {item.label} */}
|
||||
{Array(item.label).fill({}).map((_, idx) => (
|
||||
<StarDI key={idx} />
|
||||
))}
|
||||
</div>
|
||||
{/* {listSort.length > idx + 1 && (
|
||||
<span className="block mr-2 w-[calc(100%_-_16px)] h-px bg-[#EFEFEF]"></span>
|
||||
|
||||
Reference in New Issue
Block a user