change format all file
This commit is contained in:
@@ -5,10 +5,9 @@ import specialties from "@/data/specialties.json";
|
||||
import Link from "next/link";
|
||||
|
||||
function FrequentSearches() {
|
||||
const childrenList = specialties.filter(item => item.parent);
|
||||
const childrenList = specialties.filter((item) => item.parent);
|
||||
console.log(childrenList);
|
||||
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-center gap-[8px] sm:gap-[10px] md:gap-[13px] lg:gap-[16px] w-full">
|
||||
<p className="text-[#3B3B3B] text-[14px] md:text-[16px] font-normal text-nowrap">
|
||||
@@ -17,13 +16,15 @@ function FrequentSearches() {
|
||||
<div className="overflow-auto hidden-scroll flex justify-start max-w-[620px]">
|
||||
<ul className="flex items-center justify-start gap-[14px] pl-[14px]">
|
||||
{childrenList.map((item, idx) => (
|
||||
<Link href={{
|
||||
pathname: "/doctors",
|
||||
query: {
|
||||
category: item.parent,
|
||||
specialties: item.id,
|
||||
},
|
||||
}}>
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/doctors",
|
||||
query: {
|
||||
category: item.parent,
|
||||
specialties: item.id,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<li key={idx}>
|
||||
<Button
|
||||
variant="contained"
|
||||
|
||||
@@ -3,27 +3,27 @@ import AText from "../icons/AText";
|
||||
import BText from "../icons/BText";
|
||||
|
||||
function TextHeader() {
|
||||
const { matchedCity } = getStateInfo();
|
||||
const { matchedCity } = getStateInfo();
|
||||
|
||||
return (
|
||||
<div className="z-[50]">
|
||||
<h1 className="text-[#F17732] text-center font-kalame text-[20px] sm:text-[24px] md:text-[28px] lg:text-[32px] font-bold">
|
||||
با {matchedCity?.site_name}
|
||||
</h1>
|
||||
<h2
|
||||
className="text-[#525252] text-center mt-2.5 font-kalame text-[16px] sm:text-[25px] md:text-[31px] lg:text-[36px]
|
||||
return (
|
||||
<div className="z-[50]">
|
||||
<h1 className="text-[#F17732] text-center font-kalame text-[20px] sm:text-[24px] md:text-[28px] lg:text-[32px] font-bold">
|
||||
با {matchedCity?.site_name}
|
||||
</h1>
|
||||
<h2
|
||||
className="text-[#525252] text-center mt-2.5 font-kalame text-[16px] sm:text-[25px] md:text-[31px] lg:text-[36px]
|
||||
font-bold flex items-center gap-0.5 sm:gap-1 md:gap-2"
|
||||
>
|
||||
<div className="max-w-[18px] sm:max-w-[22px]">
|
||||
<BText />
|
||||
</div>
|
||||
{matchedCity?.slogan}
|
||||
<div className="max-w-[18px] sm:max-w-[22px]">
|
||||
<AText />
|
||||
</div>
|
||||
</h2>
|
||||
>
|
||||
<div className="max-w-[18px] sm:max-w-[22px]">
|
||||
<BText />
|
||||
</div>
|
||||
)
|
||||
{matchedCity?.slogan}
|
||||
<div className="max-w-[18px] sm:max-w-[22px]">
|
||||
<AText />
|
||||
</div>
|
||||
</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default TextHeader
|
||||
export default TextHeader;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"use client"
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -10,86 +10,86 @@ import Link from "next/link";
|
||||
import SearchD from "@/components/icons/SearchD";
|
||||
|
||||
function Fields({ city, state }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [data, setData] = useState({
|
||||
province: state?.name || '',
|
||||
city: city?.name || '',
|
||||
});
|
||||
const [open, setOpen] = useState(false);
|
||||
const [data, setData] = useState({
|
||||
province: state?.name || "",
|
||||
city: city?.name || "",
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<ModalSearchCity
|
||||
open={open}
|
||||
state={state}
|
||||
selected={data}
|
||||
setOpen={setOpen}
|
||||
setSelected={setData}
|
||||
>
|
||||
<ButtonFilter setOpen={setOpen} selected={data} />
|
||||
</ModalSearchCity>
|
||||
<span className="black w-px bg-[#EFEFEF]"></span>
|
||||
<TextField
|
||||
variant="standard"
|
||||
onChange={e => setData({ ...data, search: e.target.value })}
|
||||
InputProps={{
|
||||
disableUnderline: true,
|
||||
}}
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "center",
|
||||
"& .MuiInput-root": {
|
||||
padding: "0",
|
||||
borderBottom: "none",
|
||||
},
|
||||
"& .MuiInputBase-input": {
|
||||
color: "#6C757D",
|
||||
},
|
||||
"& .MuiInputBase-input": {
|
||||
color: "#6C757D",
|
||||
fontSize: {
|
||||
xs: "10px !important",
|
||||
sm: "12px !important",
|
||||
md: "14px !important",
|
||||
lg: "16px !important",
|
||||
},
|
||||
}
|
||||
}}
|
||||
placeholder="جستجوی نام پزشک، تخصص، بیماری ..."
|
||||
dir="rtl"
|
||||
className={`!shadow-none !w-full lg:!w-[524px] bg-[#FAFAFA] !text-[14px] md:!text-[16px] !rounded-0 !font-normal !text-[#6C757D]`}
|
||||
/>
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/doctors",
|
||||
query: {
|
||||
province: data.province,
|
||||
city: data.city,
|
||||
search: data.search
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Button className="!hidden lg:!flex !rounded-[4px] !h-[40px] sm:!h-[42px] md:!h-[45px] lg:!h-[48px] !gap-2.5 !min-w-[114px]">
|
||||
<div className="min-w-[20px] min-h-[20px]">
|
||||
<Search />
|
||||
</div>
|
||||
<p>جستجو</p>
|
||||
</Button>
|
||||
<Button
|
||||
className="!flex lg:!hidden !rounded-[4px]
|
||||
return (
|
||||
<>
|
||||
<ModalSearchCity
|
||||
open={open}
|
||||
state={state}
|
||||
selected={data}
|
||||
setOpen={setOpen}
|
||||
setSelected={setData}
|
||||
>
|
||||
<ButtonFilter setOpen={setOpen} selected={data} />
|
||||
</ModalSearchCity>
|
||||
<span className="black w-px bg-[#EFEFEF]"></span>
|
||||
<TextField
|
||||
variant="standard"
|
||||
onChange={(e) => setData({ ...data, search: e.target.value })}
|
||||
InputProps={{
|
||||
disableUnderline: true,
|
||||
}}
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "center",
|
||||
"& .MuiInput-root": {
|
||||
padding: "0",
|
||||
borderBottom: "none",
|
||||
},
|
||||
"& .MuiInputBase-input": {
|
||||
color: "#6C757D",
|
||||
},
|
||||
"& .MuiInputBase-input": {
|
||||
color: "#6C757D",
|
||||
fontSize: {
|
||||
xs: "10px !important",
|
||||
sm: "12px !important",
|
||||
md: "14px !important",
|
||||
lg: "16px !important",
|
||||
},
|
||||
},
|
||||
}}
|
||||
placeholder="جستجوی نام پزشک، تخصص، بیماری ..."
|
||||
dir="rtl"
|
||||
className={`!shadow-none !w-full lg:!w-[524px] bg-[#FAFAFA] !text-[14px] md:!text-[16px] !rounded-0 !font-normal !text-[#6C757D]`}
|
||||
/>
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/doctors",
|
||||
query: {
|
||||
province: data.province,
|
||||
city: data.city,
|
||||
search: data.search,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Button className="!hidden lg:!flex !rounded-[4px] !h-[40px] sm:!h-[42px] md:!h-[45px] lg:!h-[48px] !gap-2.5 !min-w-[114px]">
|
||||
<div className="min-w-[20px] min-h-[20px]">
|
||||
<Search />
|
||||
</div>
|
||||
<p>جستجو</p>
|
||||
</Button>
|
||||
<Button
|
||||
className="!flex lg:!hidden !rounded-[4px]
|
||||
!w-[40px] sm:!w-[42px] md:!w-[45px] lg:!w-[48px]
|
||||
!h-[40px] sm:!h-[42px] md:!h-[45px] lg:!h-[48px]
|
||||
!min-w-[40px] sm:!min-w-[42px] md:!min-w-[45px] lg:!min-w-[48px]
|
||||
!min-h-[40px] sm:!min-h-[42px] md:!min-h-[45px] lg:!min-h-[48px]
|
||||
!gap-2.5 !p-2.5"
|
||||
>
|
||||
<div className="w-[24px] h-[24px] min-w-[24px] min-h-[24px]">
|
||||
<SearchD />
|
||||
</div>
|
||||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
)
|
||||
>
|
||||
<div className="w-[24px] h-[24px] min-w-[24px] min-h-[24px]">
|
||||
<SearchD />
|
||||
</div>
|
||||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Fields
|
||||
export default Fields;
|
||||
|
||||
@@ -3,7 +3,7 @@ import Fields from "./Fields";
|
||||
import { getStateInfo } from "@/lib/getStateInfo";
|
||||
|
||||
function SearchBar() {
|
||||
const { matchedCity, matchedState } = getStateInfo()
|
||||
const { matchedCity, matchedState } = getStateInfo();
|
||||
|
||||
return (
|
||||
<ButtonGroup
|
||||
|
||||
@@ -32,16 +32,16 @@ function ModalSearchCity() {
|
||||
// Load states and cities from JSON files
|
||||
useEffect(() => {
|
||||
// Format states data to match the structure expected by AutoCompleteSelect
|
||||
const formattedStates = statesData.map(state => ({
|
||||
const formattedStates = statesData.map((state) => ({
|
||||
label: state.name,
|
||||
id: state.id
|
||||
id: state.id,
|
||||
}));
|
||||
|
||||
// Format cities data
|
||||
const formattedCities = citiesData.map(city => ({
|
||||
const formattedCities = citiesData.map((city) => ({
|
||||
label: city.name,
|
||||
id: city.id,
|
||||
province_id: city.province_id
|
||||
province_id: city.province_id,
|
||||
}));
|
||||
|
||||
setStates(formattedStates);
|
||||
@@ -51,10 +51,14 @@ function ModalSearchCity() {
|
||||
// Filter cities when state is selected
|
||||
useEffect(() => {
|
||||
if (selected.first) {
|
||||
const selectedState = states.find(state => state.label === selected.first);
|
||||
const selectedState = states.find(
|
||||
(state) => state.label === selected.first,
|
||||
);
|
||||
if (selectedState) {
|
||||
const stateId = selectedState.id;
|
||||
const filteredCities = cities.filter(city => city.province_id === stateId);
|
||||
const filteredCities = cities.filter(
|
||||
(city) => city.province_id === stateId,
|
||||
);
|
||||
setFilteredCities(filteredCities);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user