From feba3c4a6488ef1b83cb85b132eb3edc42c4ccf5 Mon Sep 17 00:00:00 2001
From: Ehsan
Date: Wed, 14 May 2025 15:57:40 +0330
Subject: [PATCH] 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
---
app/component/modalSearchCity/ButtonFilter.js | 2 --
app/globals.css | 4 +--
components/doctors/index.js | 26 ++---------------
components/doctors/sortlist/SelectSort.js | 29 ++++++++++++++-----
components/home/search/modal/index.js | 4 +--
components/register/LogInPage.js | 1 -
components/searchHead/SmSearch.js | 10 ++-----
components/specialties/index.js | 26 ++++++-----------
components/specialties/list/index.js | 19 +-----------
helper/index.js | 3 +-
10 files changed, 42 insertions(+), 82 deletions(-)
diff --git a/app/component/modalSearchCity/ButtonFilter.js b/app/component/modalSearchCity/ButtonFilter.js
index 57160c0..4cda88c 100644
--- a/app/component/modalSearchCity/ButtonFilter.js
+++ b/app/component/modalSearchCity/ButtonFilter.js
@@ -21,8 +21,6 @@ function ButtonFilter({ selected, setOpen }) {
className='text-[#616161] text-[11px] md:text-[14px] leading-[17px] sm:leading-[19px]
md:leading-[22px] lg:leading-[24px] font-medium ml-1 md:mx-1'
>
- {selected.province || 'استان'}
- {' | '}
{selected.city || 'شهر'}
diff --git a/app/globals.css b/app/globals.css
index 864a2f4..1caaab4 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -235,7 +235,7 @@ html {
}
.MuiFormControl-root .MuiInputBase-root .MuiInputBase-input {
- font-size: 10px !important;
+ font-size: 16px !important;
}
@keyframes openx {
@@ -384,7 +384,7 @@ html {
}
.MuiFormControl-root .MuiInputBase-root .MuiInputBase-input {
- font-size: 13px !important;
+ font-size: 16px !important;
}
.MuiModal-root .MuiBox-root {
diff --git a/components/doctors/index.js b/components/doctors/index.js
index 8e81805..5dd3f99 100644
--- a/components/doctors/index.js
+++ b/components/doctors/index.js
@@ -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: "",
diff --git a/components/doctors/sortlist/SelectSort.js b/components/doctors/sortlist/SelectSort.js
index 1dc9f5a..4a0fea6 100644
--- a/components/doctors/sortlist/SelectSort.js
+++ b/components/doctors/sortlist/SelectSort.js
@@ -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 (
);
}}
@@ -51,8 +61,11 @@ function SelectSort() {
name={item.label}
className="!flex !flex-col !items-start !w-full hover:!bg-transparent"
>
-
- {item.label}
+
+ {/* {item.label} */}
+ {Array(item.label).fill({}).map((_, idx) => (
+
+ ))}
{/* {listSort.length > idx + 1 && (
diff --git a/components/home/search/modal/index.js b/components/home/search/modal/index.js
index d4c4894..ed5120c 100644
--- a/components/home/search/modal/index.js
+++ b/components/home/search/modal/index.js
@@ -86,8 +86,8 @@ function ModalSearchCity() {
{selected.first && selected.second
? `${selected.first} | ${selected.second}`
diff --git a/components/register/LogInPage.js b/components/register/LogInPage.js
index d095cbe..c7844cb 100644
--- a/components/register/LogInPage.js
+++ b/components/register/LogInPage.js
@@ -8,7 +8,6 @@ function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
const [num, setNum] = useState("");
const [error, setError] = useState({ valid: true, text: '' });
-
const handleChange = (val) => {
const formatted = formatPhoneNumber(val);
const checkedNum = validatePhoneNumber(formatted);
diff --git a/components/searchHead/SmSearch.js b/components/searchHead/SmSearch.js
index fd5048e..6cb5753 100644
--- a/components/searchHead/SmSearch.js
+++ b/components/searchHead/SmSearch.js
@@ -1,13 +1,7 @@
import SearchD from "@/components/icons/SearchD";
import { Button, ButtonGroup, TextField } from "@mui/material";
-function SmSearch({ placeholder, onSearch }) {
- const handleSearchChange = (event) => {
- if (onSearch) {
- onSearch(event.target.value);
- }
- };
-
+function SmSearch({ placeholder, searchHandler }) {
return (
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]`}
/>