change format all file

This commit is contained in:
Ehsan
2025-05-18 01:18:35 +03:30
parent 4a57468e26
commit 254d5d4ebd
84 changed files with 721 additions and 651 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout";
function AboutUs() { function AboutUs() {
return ( return (
<Layout name='/about-us'> <Layout name="/about-us">
<AboutUsPage /> <AboutUsPage />
</Layout> </Layout>
); );
+1 -1
View File
@@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout";
function Blogs() { function Blogs() {
return ( return (
<Layout name='/blogs'> <Layout name="/blogs">
<BlogsPage /> <BlogsPage />
</Layout> </Layout>
); );
+1 -3
View File
@@ -4,9 +4,7 @@ import { getStateInfo } from "@/lib/getStateInfo";
function Booking({ params: { slug } }) { function Booking({ params: { slug } }) {
const { matchedCity } = getStateInfo(); const { matchedCity } = getStateInfo();
return ( return <BookingPage slug={slug} matchedCity={matchedCity} />;
<BookingPage slug={slug} matchedCity={matchedCity} />
);
} }
export default Booking; export default Booking;
+1 -1
View File
@@ -6,7 +6,7 @@ function Clinics() {
const { matchedCity, matchedState } = getStateInfo(); const { matchedCity, matchedState } = getStateInfo();
return ( return (
<Layout name='/clinics'> <Layout name="/clinics">
<ClinicsPage matchedCity={matchedCity} matchedState={matchedState} /> <ClinicsPage matchedCity={matchedCity} matchedState={matchedState} />
</Layout> </Layout>
); );
+1 -3
View File
@@ -2,9 +2,7 @@ function AnimationTextHead({ text, children }) {
return ( return (
<div className="flex justify-center items-start relative w-fit"> <div className="flex justify-center items-start relative w-fit">
<div className="overflow-hidden mb-[4px] md:mb-[5px] lg:mb-[6px]"> <div className="overflow-hidden mb-[4px] md:mb-[5px] lg:mb-[6px]">
<p <p className="text-[#3B3B3B] text-nowrap overflow-hidden text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">
className="text-[#3B3B3B] text-nowrap overflow-hidden text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold"
>
{text} {text}
</p> </p>
</div> </div>
+1 -1
View File
@@ -14,7 +14,7 @@ function Logo({ isAbsolute, matchedCity }) {
alt="logo" alt="logo"
/> />
<p className="text-[#526CAC] text-[14px] lg:text-[16px] font-bold font-kalame"> <p className="text-[#526CAC] text-[14px] lg:text-[16px] font-bold font-kalame">
{matchedCity?.site_name || 'نوبت ۷۲۴'} {matchedCity?.site_name || "نوبت ۷۲۴"}
</p> </p>
</div> </div>
</Link> </Link>
+5 -4
View File
@@ -5,10 +5,11 @@ function Pageguide({ list }) {
<li key={idx} className="flex items-center justify-start gap-1"> <li key={idx} className="flex items-center justify-start gap-1">
<h2 <h2
className={`text-[16px] font-normal className={`text-[16px] font-normal
${list.length > idx + 1 ${
? "text-[#9B9B9B]" list.length > idx + 1
: "text-[#525252]" ? "text-[#9B9B9B]"
} : "text-[#525252]"
}
`} `}
> >
{item} {item}
+6 -5
View File
@@ -2,7 +2,8 @@ import { Pagination as PaginationMUI } from "@mui/material";
function Pagination({ page, setPage, list, itemsPerPage }) { function Pagination({ page, setPage, list, itemsPerPage }) {
const handleChange = (_, value) => setPage(value); const handleChange = (_, value) => setPage(value);
const count = list && itemsPerPage ? Math.ceil(list.length / itemsPerPage) : 20; const count =
list && itemsPerPage ? Math.ceil(list.length / itemsPerPage) : 20;
return ( return (
<PaginationMUI <PaginationMUI
@@ -10,7 +11,7 @@ function Pagination({ page, setPage, list, itemsPerPage }) {
page={page || 1} page={page || 1}
onChange={setPage && handleChange} onChange={setPage && handleChange}
color="primary" color="primary"
className={count < 2 && '!hidden'} className={count < 2 && "!hidden"}
sx={{ sx={{
"& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root": { "& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root": {
color: "#616161", color: "#616161",
@@ -18,9 +19,9 @@ function Pagination({ page, setPage, list, itemsPerPage }) {
fontWeight: "500", fontWeight: "500",
}, },
"& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root.Mui-selected": "& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root.Mui-selected":
{ {
color: "#F8F8FF", color: "#F8F8FF",
}, },
"& .MuiSvgIcon-root": { "& .MuiSvgIcon-root": {
rotate: "180deg !important", rotate: "180deg !important",
}, },
+1 -1
View File
@@ -47,7 +47,7 @@ function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) {
const hours = e.$H; const hours = e.$H;
const minute = e.$m; const minute = e.$m;
const newValue = `${handleTwoLength(hours)}:${handleTwoLength( const newValue = `${handleTwoLength(hours)}:${handleTwoLength(
minute minute,
)}`; )}`;
const newData = data; const newData = data;
+1 -1
View File
@@ -18,7 +18,7 @@ function TimePickerInput({ changeData, handleDisableHours, name, data }) {
const hours = e.$H; const hours = e.$H;
const minute = e.$m; const minute = e.$m;
const newValue = `${handleTwoLength(hours)}:${handleTwoLength( const newValue = `${handleTwoLength(hours)}:${handleTwoLength(
minute minute,
)}`; )}`;
// setValue(newValue); // setValue(newValue);
changeData(newValue, name); changeData(newValue, name);
+2 -2
View File
@@ -83,7 +83,7 @@ function ItemUser({
data.is_like ? data.like - 1 : data.like + 1, data.is_like ? data.like - 1 : data.like + 1,
data, data,
"like", "like",
"is_like" "is_like",
) )
} }
> >
@@ -105,7 +105,7 @@ function ItemUser({
data.is_dislike ? data.dislike - 1 : data.dislike + 1, data.is_dislike ? data.dislike - 1 : data.dislike + 1,
data, data,
"dislike", "dislike",
"is_dislike" "is_dislike",
) )
} }
> >
+17 -11
View File
@@ -11,7 +11,7 @@ function AutoCompleteSelect({
label, label,
disabled = false, disabled = false,
listboxProps, listboxProps,
sendAll sendAll,
}) { }) {
return ( return (
<Autocomplete <Autocomplete
@@ -22,15 +22,21 @@ function AutoCompleteSelect({
value={value || null} value={value || null}
className="!w-full !rounded-lg auto-complete-selector" className="!w-full !rounded-lg auto-complete-selector"
onChange={(e, newValue) => { onChange={(e, newValue) => {
updateData && updateData((newValue && sendAll) ? newValue : (newValue && !sendAll) && newValue.label || "", name); updateData &&
updateData(
newValue && sendAll
? newValue
: (newValue && !sendAll && newValue.label) || "",
name,
);
}} }}
sx={{ sx={{
...styleTextSelectRight, ...styleTextSelectRight,
// Hide Icon Number // Hide Icon Number
"& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button": "& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":
{ {
display: "none", display: "none",
}, },
"& input[type=number]": { "& input[type=number]": {
MozAppearance: "textfield", MozAppearance: "textfield",
}, },
@@ -49,13 +55,13 @@ function AutoCompleteSelect({
border: "1px solid #D7D7D7", border: "1px solid #D7D7D7",
}, },
"& .MuiInput-underline:hover:not(.Mui-disabled):before, .MuiOutlinedInput-notchedOutline": "& .MuiInput-underline:hover:not(.Mui-disabled):before, .MuiOutlinedInput-notchedOutline":
{ {
borderColor: "#D7D7D7 !important", borderColor: "#D7D7D7 !important",
}, },
"& .muirtl-1kiro5a-MuiInputBase-root-MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline": "& .muirtl-1kiro5a-MuiInputBase-root-MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":
{ {
border: "1px solid #5559CE !important", border: "1px solid #5559CE !important",
}, },
"& .MuiOutlinedInput-notchedOutline": { "& .MuiOutlinedInput-notchedOutline": {
border: isError ? "1px solid red !important" : "", border: isError ? "1px solid red !important" : "",
}, },
+20 -8
View File
@@ -1,7 +1,16 @@
import { TextField } from "@mui/material"; import { TextField } from "@mui/material";
import { styleTextSelectRight } from "@/mui"; import { styleTextSelectRight } from "@/mui";
function Field({ title, error, spaceNull, inputProps, type, dir, value, updateState }) { function Field({
title,
error,
spaceNull,
inputProps,
type,
dir,
value,
updateState,
}) {
return ( return (
<TextField <TextField
label={title} label={title}
@@ -13,19 +22,22 @@ function Field({ title, error, spaceNull, inputProps, type, dir, value, updateSt
className="!w-full !mx-auto !bg-[#FFF]" className="!w-full !mx-auto !bg-[#FFF]"
InputProps={inputProps} InputProps={inputProps}
sx={{ sx={{
'.MuiOutlinedInput-notchedOutline.muirtl-1d3z3hw-MuiOutlinedInput-notchedOutline': { ".MuiOutlinedInput-notchedOutline.muirtl-1d3z3hw-MuiOutlinedInput-notchedOutline":
border: error && '1px solid red !important' {
}, border: error && "1px solid red !important",
},
...styleTextSelectRight, ...styleTextSelectRight,
// Hide Icon Number // Hide Icon Number
"& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button": "& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":
{ {
display: "none", display: "none",
}, },
"& input[type=number]": { "& input[type=number]": {
MozAppearance: "textfield", MozAppearance: "textfield",
}, },
"& .MuiInputBase-input": { padding: spaceNull ? "12.5px 0" : "12.5px 14px" }, "& .MuiInputBase-input": {
padding: spaceNull ? "12.5px 0" : "12.5px 14px",
},
"& .MuiInputBase-root": { borderRadius: "6px !important" }, "& .MuiInputBase-root": { borderRadius: "6px !important" },
"& .MuiOutlinedInput-notchedOutline": { "& .MuiOutlinedInput-notchedOutline": {
border: "1px solid #E9ECEF !important", border: "1px solid #E9ECEF !important",
+10 -10
View File
@@ -3,16 +3,16 @@ import { Skeleton } from "@mui/material";
function MultilineLoading({ loading, width, height, children, line }) { function MultilineLoading({ loading, width, height, children, line }) {
return loading return loading
? Array(line) ? Array(line)
.fill({}) .fill({})
.map((_, idx) => ( .map((_, idx) => (
<Skeleton <Skeleton
className={`${width === "full" ? "!w-full" : ""} !my-2`} className={`${width === "full" ? "!w-full" : ""} !my-2`}
variant="rounded" variant="rounded"
height={height} height={height}
width={width} width={width}
key={idx} key={idx}
/> />
)) ))
: children; : children;
} }
@@ -18,10 +18,10 @@ function ButtonFilter({ selected, setOpen }) {
<Location /> <Location />
</div> </div>
<p <p
className='text-[#616161] text-[11px] md:text-[14px] leading-[17px] sm:leading-[19px] 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' md:leading-[22px] lg:leading-[24px] font-medium ml-1 md:mx-1"
> >
{selected.city || 'شهر'} {selected.city || "شهر"}
</p> </p>
<div className="w-[16px] h-[16px] md:w-[18px] md:h-[18px] lg:w-[20px] lg:h-[20px] grid place-items-center"> <div className="w-[16px] h-[16px] md:w-[18px] md:h-[18px] lg:w-[20px] lg:h-[20px] grid place-items-center">
<ArrowBottomH /> <ArrowBottomH />
+2 -2
View File
@@ -23,9 +23,9 @@ function Content({
}; };
const handleFilter = () => { const handleFilter = () => {
handleSearch && handleSearch(''); handleSearch && handleSearch("");
handleClose(); handleClose();
} };
return ( return (
<div> <div>
+11 -3
View File
@@ -10,7 +10,15 @@ import statesData from "@/data/state.json";
import citiesData from "@/data/city.json"; import citiesData from "@/data/city.json";
import Content from "./Content"; import Content from "./Content";
function ModalSearchCity({ children, selected, handleSearch, state, setSelected, open, setOpen }) { function ModalSearchCity({
children,
selected,
handleSearch,
state,
setSelected,
open,
setOpen,
}) {
const provinceSelected = selected.province; const provinceSelected = selected.province;
const states = addLabelToList(statesData); const states = addLabelToList(statesData);
@@ -22,12 +30,12 @@ function ModalSearchCity({ children, selected, handleSearch, state, setSelected,
useEffect(() => { useEffect(() => {
if (provinceSelected) { if (provinceSelected) {
const selectedState = states.find( const selectedState = states.find(
(state) => state.label === provinceSelected (state) => state.label === provinceSelected,
); );
if (selectedState) { if (selectedState) {
const stateId = selectedState.id; const stateId = selectedState.id;
const filteredCities = cities.filter( const filteredCities = cities.filter(
(city) => city.province_id === stateId (city) => city.province_id === stateId,
); );
setFilteredCities(filteredCities); setFilteredCities(filteredCities);
} }
+2 -2
View File
@@ -21,7 +21,7 @@ async function getCroppedImg(imageSrc, pixelCrop) {
ctx.drawImage( ctx.drawImage(
image, image,
safeArea / 2 - image.width * 0.5, safeArea / 2 - image.width * 0.5,
safeArea / 2 - image.height * 0.5 safeArea / 2 - image.height * 0.5,
); );
const data = ctx.getImageData(0, 0, safeArea, safeArea); const data = ctx.getImageData(0, 0, safeArea, safeArea);
@@ -31,7 +31,7 @@ async function getCroppedImg(imageSrc, pixelCrop) {
ctx.putImageData( ctx.putImageData(
data, data,
Math.round(0 - safeArea / 2 + image.width * 0.5 - pixelCrop.x), Math.round(0 - safeArea / 2 + image.width * 0.5 - pixelCrop.x),
Math.round(0 - safeArea / 2 + image.height * 0.5 - pixelCrop.y) Math.round(0 - safeArea / 2 + image.height * 0.5 - pixelCrop.y),
); );
return canvas.toDataURL("image/jpeg"); return canvas.toDataURL("image/jpeg");
+1 -3
View File
@@ -4,9 +4,7 @@ import { getStateInfo } from "@/lib/getStateInfo";
function UserAccount() { function UserAccount() {
const { matchedCity } = getStateInfo(); const { matchedCity } = getStateInfo();
return ( return <Content matchedCity={matchedCity} />;
<Content matchedCity={matchedCity} />
);
} }
export default UserAccount; export default UserAccount;
+13 -10
View File
@@ -213,11 +213,13 @@ html {
} }
.cover-head-blogs { .cover-head-blogs {
background: linear-gradient(180deg, background: linear-gradient(
rgba(0, 0, 0, 0) 0%, 180deg,
rgba(0, 0, 0, 0.07) 31.47%, rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 0.31) 59.72%, rgba(0, 0, 0, 0.07) 31.47%,
rgba(0, 0, 0, 0.7) 89.39%); rgba(0, 0, 0, 0.31) 59.72%,
rgba(0, 0, 0, 0.7) 89.39%
);
border-radius: 16px; border-radius: 16px;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@@ -585,7 +587,6 @@ html {
} }
@media (max-width: 1024px) { @media (max-width: 1024px) {
.day-label-bar-inner-rtl, .day-label-bar-inner-rtl,
.panel-jalaali, .panel-jalaali,
.panel-header-rtl, .panel-header-rtl,
@@ -619,13 +620,15 @@ html {
border-color: #343645 !important; border-color: #343645 !important;
} }
.dark .MuiList-root.MuiList-padding.MuiMultiSectionDigitalClockSection-root::-webkit-scrollbar-track { .dark
.MuiList-root.MuiList-padding.MuiMultiSectionDigitalClockSection-root::-webkit-scrollbar-track {
background: #1f1d2b; background: #1f1d2b;
height: 50px; height: 50px;
border-radius: 10px; border-radius: 10px;
} }
.dark .MuiList-root.MuiList-padding.MuiMultiSectionDigitalClockSection-root::-webkit-scrollbar-thumb { .dark
.MuiList-root.MuiList-padding.MuiMultiSectionDigitalClockSection-root::-webkit-scrollbar-thumb {
background: #222433; background: #222433;
height: 50px; height: 50px;
border-radius: 20px; border-radius: 20px;
@@ -845,5 +848,5 @@ html {
/* End Of Toastify */ /* End Of Toastify */
.text-item-head-white:hover .item-head { .text-item-head-white:hover .item-head {
color: #D7D8ED; color: #d7d8ed;
} }
+1 -3
View File
@@ -1,9 +1,7 @@
import ContentVerify from "@/components/register/ContentVerify"; import ContentVerify from "@/components/register/ContentVerify";
function LoginVerify() { function LoginVerify() {
return ( return <ContentVerify />;
<ContentVerify />
);
} }
export default LoginVerify; export default LoginVerify;
+1 -3
View File
@@ -1,9 +1,7 @@
import ContentLogin from "@/components/register/ContentLogin"; import ContentLogin from "@/components/register/ContentLogin";
function LogIn() { function LogIn() {
return ( return <ContentLogin />;
<ContentLogin />
);
} }
export default LogIn; export default LogIn;
+1 -1
View File
@@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout";
export default function Home() { export default function Home() {
return ( return (
<Layout name='/'> <Layout name="/">
<HomePage /> <HomePage />
</Layout> </Layout>
); );
+1 -3
View File
@@ -1,9 +1,7 @@
import Content from "@/components/panel/Content"; import Content from "@/components/panel/Content";
function LayoutPanel({ children }) { function LayoutPanel({ children }) {
return ( return <Content children={children} />;
<Content children={children} />
);
} }
export default LayoutPanel; export default LayoutPanel;
+1 -1
View File
@@ -3,7 +3,7 @@ import Information from "@/data/information.json";
import Bank from "@/data/bank.json"; import Bank from "@/data/bank.json";
function UserAccount() { function UserAccount() {
return <UserAccountPage data={{information: Information, bank: Bank}} />; return <UserAccountPage data={{ information: Information, bank: Bank }} />;
} }
export default UserAccount; export default UserAccount;
+1 -3
View File
@@ -10,9 +10,7 @@ function SocialMedia({ loading }) {
<ul className="flex mt-0 sm:mt-[3px] md:mt-[6px] lg:mt-[8px] pb-[16px] sm:pb-[21px] md:pb-[27px] lg:pb-[32px] relative items-center justify-end gap-4"> <ul className="flex mt-0 sm:mt-[3px] md:mt-[6px] lg:mt-[8px] pb-[16px] sm:pb-[21px] md:pb-[27px] lg:pb-[32px] relative items-center justify-end gap-4">
{socials.map((item, idx) => ( {socials.map((item, idx) => (
<CircularLoading width={36} key={idx} height={36} loading={loading}> <CircularLoading width={36} key={idx} height={36} loading={loading}>
<li <li className="bg-[#EFEFEF] rounded-full hover-rotate-icon p-[9px]">
className="bg-[#EFEFEF] rounded-full hover-rotate-icon p-[9px]"
>
{item} {item}
</li> </li>
</CircularLoading> </CircularLoading>
+18 -25
View File
@@ -1,32 +1,25 @@
import Information from "./information"; import Information from "./information";
import Location from "./location"; import Location from "./location";
function Content({ function Content({ doctor, step, setStep, children, isFirst, disableSide }) {
doctor, return (
step, <div
setStep, className="flex flex-col lg:flex-row justify-center gap-[12px] sm:gap-[16px] md:gap-[20px] lg:gap-[24px] padding-responsive
children,
isFirst,
disableSide,
}) {
return (
<div
className="flex flex-col lg:flex-row justify-center gap-[12px] sm:gap-[16px] md:gap-[20px] lg:gap-[24px] padding-responsive
items-stretch pt-[calc(12px_+_75px_+_32px)] sm:pt-[calc(21px_+_75px_+_45px)] md:pt-[calc(30px_+_75px_+_58px)] lg:pt-[calc(40px_+_75px_+_78px)]" items-stretch pt-[calc(12px_+_75px_+_32px)] sm:pt-[calc(21px_+_75px_+_45px)] md:pt-[calc(30px_+_75px_+_58px)] lg:pt-[calc(40px_+_75px_+_78px)]"
> >
{isFirst ? ( {isFirst ? (
<Location disableSide={disableSide} doctor={doctor} /> <Location disableSide={disableSide} doctor={doctor} />
) : ( ) : (
<Information <Information
disableSide={disableSide} disableSide={disableSide}
doctor={doctor} doctor={doctor}
step={step} step={step}
setStep={setStep} setStep={setStep}
/> />
)} )}
{children} {children}
</div> </div>
); );
} }
export default Content; export default Content;
+3 -1
View File
@@ -19,7 +19,9 @@ function Information({ doctor, step, setStep, typePay, isPay, disableSide }) {
} }
`} `}
> >
<p className="text-[#3B3B3B] text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">جزئیات نوبت</p> <p className="text-[#3B3B3B] text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">
جزئیات نوبت
</p>
<Head doctor={doctor} /> <Head doctor={doctor} />
<Detail doctor={doctor} step={step} setStep={setStep} /> <Detail doctor={doctor} step={step} setStep={setStep} />
</div> </div>
@@ -16,7 +16,7 @@ function Slider({ data, loading }) {
className="min-w-[90px] min-h-[90px] object-cover rounded-[8px] overflow-hidden" className="min-w-[90px] min-h-[90px] object-cover rounded-[8px] overflow-hidden"
/> />
</CustomLoading> </CustomLoading>
) : undefined ) : undefined,
)} )}
</ul> </ul>
); );
+1 -2
View File
@@ -1,4 +1,3 @@
import { Button, ButtonGroup, TextField } from "@mui/material"; import { Button, ButtonGroup, TextField } from "@mui/material";
import SearchD from "@/components/icons/SearchD"; import SearchD from "@/components/icons/SearchD";
import ModalSearchCity from "@/app/component/modalSearchCity"; import ModalSearchCity from "@/app/component/modalSearchCity";
@@ -28,7 +27,7 @@ function SearchBar({ selected, setSelected, state, handleSearch }) {
</ModalSearchCity> </ModalSearchCity>
<TextField <TextField
variant="standard" variant="standard"
onChange={e => handleSearch(e.target.value)} onChange={(e) => handleSearch(e.target.value)}
InputProps={{ InputProps={{
disableUnderline: true, disableUnderline: true,
}} }}
+3 -4
View File
@@ -10,7 +10,7 @@ import HeadPageList from "@/app/component/head";
function ClinicsPage({ matchedCity, matchedState }) { function ClinicsPage({ matchedCity, matchedState }) {
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [filteredClinics, setFilteredClinics] = useState(clinics) const [filteredClinics, setFilteredClinics] = useState(clinics);
const [selected, setSelected] = useState({ const [selected, setSelected] = useState({
province: matchedState?.name || "", province: matchedState?.name || "",
@@ -23,10 +23,9 @@ function ClinicsPage({ matchedCity, matchedState }) {
}, 2000); }, 2000);
}, []); }, []);
const handleSearch = (value) => { const handleSearch = (value) => {
const searchOnName = searchOnList(clinics, value, 'title') const searchOnName = searchOnList(clinics, value, "title");
const searchOnLocation = searchOnList(searchOnName, selected.city, 'city') const searchOnLocation = searchOnList(searchOnName, selected.city, "city");
setFilteredClinics(searchOnLocation); setFilteredClinics(searchOnLocation);
}; };
+3 -1
View File
@@ -16,7 +16,9 @@ function ItemClinic({ data, loading }) {
</CircularLoading> </CircularLoading>
<div className="flex flex-col items-start justify-center gap-2"> <div className="flex flex-col items-start justify-center gap-2">
<TextLoading loading={loading} width={100} height={18}> <TextLoading loading={loading} width={100} height={18}>
<h3 className="text-[#3B3B3B] text-[14px] font-bold">{data.title}</h3> <h3 className="text-[#3B3B3B] text-[14px] font-bold">
{data.title}
</h3>
</TextLoading> </TextLoading>
<TextLoading loading={loading} width={60} height={18}> <TextLoading loading={loading} width={60} height={18}>
<p className="text-[#7E7E7E] text-[14px] font-normal"> <p className="text-[#7E7E7E] text-[14px] font-normal">
+2 -1
View File
@@ -10,7 +10,8 @@ function ContentContact({ text, children, url, label }) {
{children} {children}
</div> </div>
<p className="text-[#FFF] text-[14px] md:text-[18px] sm:text-[16px] lg:text-[20px] font-normal"> <p className="text-[#FFF] text-[14px] md:text-[18px] sm:text-[16px] lg:text-[20px] font-normal">
{label}<span dir="ltr">{text}</span> {label}
<span dir="ltr">{text}</span>
</p> </p>
</li> </li>
); );
+4 -2
View File
@@ -6,10 +6,12 @@ function Call({ matchedCity, isDefault }) {
className={`lg:min-w-[calc(50%_+_70px)] bg-banner-about !bg-center !bg-no-repeat !bg-cover h-fit pt-[16px] sm:pt-[29px] md:pt-[42px] lg:pt-[55px] className={`lg:min-w-[calc(50%_+_70px)] bg-banner-about !bg-center !bg-no-repeat !bg-cover h-fit pt-[16px] sm:pt-[29px] md:pt-[42px] lg:pt-[55px]
bg-contact rounded-[8px] pb-[30px] sm:pb-[42px] md:pb-[55px] bg-contact rounded-[8px] pb-[30px] sm:pb-[42px] md:pb-[55px]
overflow-hidden lg:pb-[171px] px-[16px] sm:px-[27px] md:px-[39px] lg:px-[48px] overflow-hidden lg:pb-[171px] px-[16px] sm:px-[27px] md:px-[39px] lg:px-[48px]
${isDefault ? 'lg:pl-[18%]' : 'w-full'}`} ${isDefault ? "lg:pl-[18%]" : "w-full"}`}
> >
<h1 className="text-[#FAFAFA] text-[20px] font-bold">تماس با ما</h1> <h1 className="text-[#FAFAFA] text-[20px] font-bold">تماس با ما</h1>
<h2 className="text-[#FAFAFA] leading-[26px] text-[14px] md:text-[16px] font-normal mt-6">{matchedCity.footerDescription}</h2> <h2 className="text-[#FAFAFA] leading-[26px] text-[14px] md:text-[16px] font-normal mt-6">
{matchedCity.footerDescription}
</h2>
<Links matchedCity={matchedCity} /> <Links matchedCity={matchedCity} />
</div> </div>
); );
+26 -22
View File
@@ -6,27 +6,31 @@ import WhatsappC from "../../icons/WhatsappC";
import ContentContact from "../ContentContact"; import ContentContact from "../ContentContact";
function Links({ matchedCity }) { function Links({ matchedCity }) {
return ( return (
<ul className="flex flex-col mt-[68px] justify-start items-start gap-[32px]"> <ul className="flex flex-col mt-[68px] justify-start items-start gap-[32px]">
<ContentContact url="tel:900300400" label='تلفن تماس: ' text={matchedCity.contactPhone}> <ContentContact
<CallC /> url="tel:900300400"
</ContentContact> label="تلفن تماس: "
<ContentContact text={matchedCity.contactPhone}
url="https://wa.me/09124568794" >
text={matchedCity.socialMedia.whatsapp} <CallC />
label='واتساپ: ' </ContentContact>
> <ContentContact
<WhatsappC /> url="https://wa.me/09124568794"
</ContentContact> text={matchedCity.socialMedia.whatsapp}
<ContentContact label="واتساپ: "
url="mailto:batome@gmail.com" >
text={matchedCity.email} <WhatsappC />
label='ایمیل: ' </ContentContact>
> <ContentContact
<EmailC /> url="mailto:batome@gmail.com"
</ContentContact> text={matchedCity.email}
</ul> label="ایمیل: "
) >
<EmailC />
</ContentContact>
</ul>
);
} }
export default Links export default Links;
+1 -3
View File
@@ -9,9 +9,7 @@ function ContactUsPage() {
return ( return (
<div className="w-full pt-[24px] sm:pt-[56px] md:pt-[88px] lg:pt-[120px] mt-[56px] padding-responsive flex flex-col lg:flex-row items-center justify-between h-fit"> <div className="w-full pt-[24px] sm:pt-[56px] md:pt-[88px] lg:pt-[120px] mt-[56px] padding-responsive flex flex-col lg:flex-row items-center justify-between h-fit">
<Call matchedCity={matchedCity} isDefault={isDefault} /> <Call matchedCity={matchedCity} isDefault={isDefault} />
{matchedCity?.id === "63" && ( {matchedCity?.id === "63" && <Connect />}
<Connect />
)}
</div> </div>
); );
} }
+25 -25
View File
@@ -7,32 +7,32 @@ import DashboardPage from "@/components/dashboard";
import UserAccountPage from "@/components/dashboard/userAccount/UserAccount"; import UserAccountPage from "@/components/dashboard/userAccount/UserAccount";
function Content({ matchedCity }) { function Content({ matchedCity }) {
const [value, setValue] = useState(0); const [value, setValue] = useState(0);
const [isOpenSide, setIsOpenSide] = useState(false); const [isOpenSide, setIsOpenSide] = useState(false);
const [isTurnsDetails, setIsTurnsDetails] = useState(false); const [isTurnsDetails, setIsTurnsDetails] = useState(false);
return ( return (
<DashboardPage <DashboardPage
value={value} value={value}
setValue={setValue} setValue={setValue}
user={userData.data} user={userData.data}
isOpenSide={isOpenSide} isOpenSide={isOpenSide}
matchedCity={matchedCity} matchedCity={matchedCity}
setIsOpenSide={setIsOpenSide} setIsOpenSide={setIsOpenSide}
isTurnsDetails={isTurnsDetails} isTurnsDetails={isTurnsDetails}
setIsTurnsDetails={setIsTurnsDetails} setIsTurnsDetails={setIsTurnsDetails}
> >
<UserAccountPage <UserAccountPage
value={value} value={value}
setValue={setValue} setValue={setValue}
user={userData.data} user={userData.data}
isOpenSide={isOpenSide} isOpenSide={isOpenSide}
setIsOpenSide={setIsOpenSide} setIsOpenSide={setIsOpenSide}
isTurnsDetails={isTurnsDetails} isTurnsDetails={isTurnsDetails}
setIsTurnsDetails={setIsTurnsDetails} setIsTurnsDetails={setIsTurnsDetails}
/> />
</DashboardPage> </DashboardPage>
); );
} }
export default Content; export default Content;
+1 -1
View File
@@ -9,7 +9,7 @@ function DashboardPage({
setValue, setValue,
isOpenSide, isOpenSide,
setIsOpenSide, setIsOpenSide,
matchedCity matchedCity,
}) { }) {
return ( return (
<Layout <Layout
@@ -24,8 +24,8 @@ function Card({ data, loading }) {
data.status === "success" data.status === "success"
? "bg-[#E8FADD] text-[#75E22E]" ? "bg-[#E8FADD] text-[#75E22E]"
: data.status === "pending" : data.status === "pending"
? "bg-[#FFF3DD] text-[#FDBA35]" ? "bg-[#FFF3DD] text-[#FDBA35]"
: "bg-[#FFE3E2] text-[#FF5450]" : "bg-[#FFE3E2] text-[#FF5450]"
} }
`} `}
variant="text" variant="text"
@@ -33,8 +33,8 @@ function Card({ data, loading }) {
{data.status === "success" {data.status === "success"
? "پرداخت شده" ? "پرداخت شده"
: data.status === "pending" : data.status === "pending"
? "در انتظار" ? "در انتظار"
: "پرداخت نشده"} : "پرداخت نشده"}
</div> </div>
</TextLoading> </TextLoading>
</div> </div>
@@ -92,8 +92,8 @@ function List({ user, loading }) {
row.status === "success" row.status === "success"
? "bg-[#E8FADD] text-[#75E22E]" ? "bg-[#E8FADD] text-[#75E22E]"
: row.status === "pending" : row.status === "pending"
? "bg-[#FFF3DD] text-[#FDBA35]" ? "bg-[#FFF3DD] text-[#FDBA35]"
: "bg-[#FFE3E2] text-[#FF5450]" : "bg-[#FFE3E2] text-[#FF5450]"
} }
`} `}
variant="text" variant="text"
@@ -101,8 +101,8 @@ function List({ user, loading }) {
{row.status === "success" {row.status === "success"
? "پرداخت شده" ? "پرداخت شده"
: row.status === "pending" : row.status === "pending"
? "در انتظار" ? "در انتظار"
: "پرداخت نشده"} : "پرداخت نشده"}
</div> </div>
</CustomLoading> </CustomLoading>
</TableCell> </TableCell>
@@ -21,10 +21,11 @@ function AboutDcotor({ doctor, loading }) {
text-[#616161] text-[14px] font-normal overflow-hidden relative text-[#616161] text-[14px] font-normal overflow-hidden relative
md:max-h-fit after:absolute after:right-0 after:bottom-0 leading-[28px] sm:leading-[30px] md:leading-[32px] lg:leading-[33px] after:h-[80px] md:max-h-fit after:absolute after:right-0 after:bottom-0 leading-[28px] sm:leading-[30px] md:leading-[32px] lg:leading-[33px] after:h-[80px]
after:shadow-xl after:w-full transition-all duration-500 md:after:!bg-[linear-gradient(transparent,transparent)] after:shadow-xl after:w-full transition-all duration-500 md:after:!bg-[linear-gradient(transparent,transparent)]
${isMore ${
? "after:bg-transparent max-h-screen" isMore
: "after:bg-[linear-gradient(transparent,#FAFAFA)] max-h-[200px]" ? "after:bg-transparent max-h-screen"
} : "after:bg-[linear-gradient(transparent,#FAFAFA)] max-h-[200px]"
}
`} `}
> >
{doctor.detail} {doctor.detail}
@@ -27,7 +27,9 @@ function ProgressAll({ doctor, loading }) {
<br /> <br />
رضایت کاربران رضایت کاربران
</p> </p>
<p className="text-[#3B3B3B]">{numberToArStyle(doctor.total_user_satisfaction)}%</p> <p className="text-[#3B3B3B]">
{numberToArStyle(doctor.total_user_satisfaction)}%
</p>
</div> </div>
</CircularLoading> </CircularLoading>
</div> </div>
@@ -54,8 +54,9 @@ function Chart({ doctor, loading }) {
</div> </div>
<div className="flex flex-wrap items-center justify-center gap-[50px]"> <div className="flex flex-wrap items-center justify-center gap-[50px]">
<ul <ul
className={`flex w-full flex-col items-start justify-start gap-1.5 ${loading ? "lg:w-full" : "lg:w-fit" className={`flex w-full flex-col items-start justify-start gap-1.5 ${
}`} loading ? "lg:w-full" : "lg:w-fit"
}`}
> >
{doctor.progress_detail.map((item, idx) => ( {doctor.progress_detail.map((item, idx) => (
<TextLoading width="full" key={idx} height={20} loading={loading}> <TextLoading width="full" key={idx} height={20} loading={loading}>
+8 -5
View File
@@ -18,14 +18,17 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
province: matchedState?.name || params?.province, province: matchedState?.name || params?.province,
city: matchedCity?.name || params?.city, city: matchedCity?.name || params?.city,
}); });
const findItem = (name, value) => specialties.find(item => item[name] === value) const findItem = (name, value) =>
const itemCategory = findItem('id', params.category); specialties.find((item) => item[name] === value);
const itemSpecialties = findItem('id', params.specialties); const itemCategory = findItem("id", params.category);
const itemSpecialties = findItem("id", params.specialties);
const [data, setData] = useState({ const [data, setData] = useState({
category: itemCategory || "", category: itemCategory || "",
specialties: itemSpecialties ? { ...itemSpecialties, label: itemSpecialties.name } : "", specialties: itemSpecialties
turn: params && params.hasOwnProperty('turn') ? JSON.parse(params.turn) : 1, ? { ...itemSpecialties, label: itemSpecialties.name }
: "",
turn: params && params.hasOwnProperty("turn") ? JSON.parse(params.turn) : 1,
gender: params.gender || "هر دو", gender: params.gender || "هر دو",
degree: params.degree || "متخصص", degree: params.degree || "متخصص",
}); });
+11 -12
View File
@@ -6,7 +6,6 @@ import { filterList } from "@/helper";
const group1 = ["خانم", "آقا", "هر دو"]; const group1 = ["خانم", "آقا", "هر دو"];
const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"]; const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"];
function Content({ data, setData }) { function Content({ data, setData }) {
const router = useRouter(); const router = useRouter();
const { parentList, childrenList } = filterList(data); const { parentList, childrenList } = filterList(data);
@@ -15,21 +14,21 @@ function Content({ data, setData }) {
const current = new URLSearchParams(window.location.search); const current = new URLSearchParams(window.location.search);
current.set(name, value.id || value); current.set(name, value.id || value);
if (removeSpecialties) { if (removeSpecialties) {
current.delete('specialties') current.delete("specialties");
}; }
const queryString = current.toString(); const queryString = current.toString();
router.push(`/doctors?${queryString}`) router.push(`/doctors?${queryString}`);
} };
const changeData = (value, name, removeSpecialties) => { const changeData = (value, name, removeSpecialties) => {
changeUrl(value, name, removeSpecialties); changeUrl(value, name, removeSpecialties);
const newData = data; const newData = data;
newData[name] = value; newData[name] = value;
if (removeSpecialties) { if (removeSpecialties) {
newData.specialties = '' newData.specialties = "";
}; }
setData(newData); setData(newData);
} };
return ( return (
<div className="mt-[50px] px-[0px] md:px-[19px] lg:px-[38px] mb-[32px]"> <div className="mt-[50px] px-[0px] md:px-[19px] lg:px-[38px] mb-[32px]">
@@ -59,7 +58,7 @@ function Content({ data, setData }) {
value={data.gender} value={data.gender}
text="جنسیت پزشک" text="جنسیت پزشک"
group={group1} group={group1}
name='gender' name="gender"
/> />
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span> <span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
<RadioContent <RadioContent
@@ -67,7 +66,7 @@ function Content({ data, setData }) {
value={data.degree} value={data.degree}
text="درجه علمی" text="درجه علمی"
group={group2} group={group2}
name='degree' name="degree"
/> />
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span> <span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
<div className="flex items-center justify-start gap-[12px]"> <div className="flex items-center justify-start gap-[12px]">
@@ -76,7 +75,7 @@ function Content({ data, setData }) {
<Switch <Switch
checked={data.turn} checked={data.turn}
onChange={(event) => { onChange={(event) => {
changeData(event.target.checked ? 1 : 0, "turn") changeData(event.target.checked ? 1 : 0, "turn");
}} }}
/> />
} }
@@ -86,7 +85,7 @@ function Content({ data, setData }) {
fontSize: "16px", fontSize: "16px",
fontWeight: 500, fontWeight: 500,
}, },
marginLeft: '0 !important', marginLeft: "0 !important",
}} }}
label="فقط پزشکان دارای نوبت" label="فقط پزشکان دارای نوبت"
labelPlacement="start" labelPlacement="start"
+8 -2
View File
@@ -16,7 +16,13 @@ function FilterModal({ data, setData, children }) {
const handleClose = () => setOpen(false); const handleClose = () => setOpen(false);
const deleteData = () => { const deleteData = () => {
clearFilterParams(router, ['turn', 'specialties', 'degree', 'category', 'gender']) clearFilterParams(router, [
"turn",
"specialties",
"degree",
"category",
"gender",
]);
setData({ setData({
category: "", category: "",
specialties: "", specialties: "",
@@ -25,7 +31,7 @@ function FilterModal({ data, setData, children }) {
degree: "متخصص", degree: "متخصص",
}); });
handleClose(); handleClose();
} };
return ( return (
<> <>
+1 -1
View File
@@ -31,7 +31,7 @@ function SearchBar({ data, setData, params }) {
</FilterModal> </FilterModal>
<TextField <TextField
variant="standard" variant="standard"
defaultValue={params.search || ''} defaultValue={params.search || ""}
InputProps={{ InputProps={{
disableUnderline: true, disableUnderline: true,
}} }}
+19 -10
View File
@@ -29,13 +29,17 @@ function SelectSort() {
</SvgIcon> </SvgIcon>
{value ? ( {value ? (
<ul className="flex items-center justify-start gap-1"> <ul className="flex items-center justify-start gap-1">
{Array(sort).fill({}).map((_, idx) => ( {Array(sort)
<li key={idx}> .fill({})
<StarDI /> .map((_, idx) => (
</li> <li key={idx}>
))} <StarDI />
</li>
))}
</ul> </ul>
) : "مرتب سازی"} ) : (
"مرتب سازی"
)}
</div> </div>
); );
}} }}
@@ -60,10 +64,15 @@ function SelectSort() {
name={item.label} name={item.label}
className="!flex !flex-col !items-start !w-full hover:!bg-transparent" className="!flex !flex-col !items-start !w-full hover:!bg-transparent"
> >
<div value={item.id} className="!p-2 !mr-2 !w-[calc(100%_-_16px)] flex items-center justify-start"> <div
{Array(item.label).fill({}).map((_, idx) => ( value={item.id}
<StarDI key={idx} /> className="!p-2 !mr-2 !w-[calc(100%_-_16px)] flex items-center justify-start"
))} >
{Array(item.label)
.fill({})
.map((_, idx) => (
<StarDI key={idx} />
))}
</div> </div>
</MenuItem> </MenuItem>
))} ))}
+10 -9
View File
@@ -5,10 +5,9 @@ import specialties from "@/data/specialties.json";
import Link from "next/link"; import Link from "next/link";
function FrequentSearches() { function FrequentSearches() {
const childrenList = specialties.filter(item => item.parent); const childrenList = specialties.filter((item) => item.parent);
console.log(childrenList); console.log(childrenList);
return ( return (
<div className="flex items-center justify-center gap-[8px] sm:gap-[10px] md:gap-[13px] lg:gap-[16px] w-full"> <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"> <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]"> <div className="overflow-auto hidden-scroll flex justify-start max-w-[620px]">
<ul className="flex items-center justify-start gap-[14px] pl-[14px]"> <ul className="flex items-center justify-start gap-[14px] pl-[14px]">
{childrenList.map((item, idx) => ( {childrenList.map((item, idx) => (
<Link href={{ <Link
pathname: "/doctors", href={{
query: { pathname: "/doctors",
category: item.parent, query: {
specialties: item.id, category: item.parent,
}, specialties: item.id,
}}> },
}}
>
<li key={idx}> <li key={idx}>
<Button <Button
variant="contained" variant="contained"
+19 -19
View File
@@ -3,27 +3,27 @@ import AText from "../icons/AText";
import BText from "../icons/BText"; import BText from "../icons/BText";
function TextHeader() { function TextHeader() {
const { matchedCity } = getStateInfo(); const { matchedCity } = getStateInfo();
return ( return (
<div className="z-[50]"> <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"> <h1 className="text-[#F17732] text-center font-kalame text-[20px] sm:text-[24px] md:text-[28px] lg:text-[32px] font-bold">
با {matchedCity?.site_name} با {matchedCity?.site_name}
</h1> </h1>
<h2 <h2
className="text-[#525252] text-center mt-2.5 font-kalame text-[16px] sm:text-[25px] md:text-[31px] lg:text-[36px] 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" font-bold flex items-center gap-0.5 sm:gap-1 md:gap-2"
> >
<div className="max-w-[18px] sm:max-w-[22px]"> <div className="max-w-[18px] sm:max-w-[22px]">
<BText /> <BText />
</div>
{matchedCity?.slogan}
<div className="max-w-[18px] sm:max-w-[22px]">
<AText />
</div>
</h2>
</div> </div>
) {matchedCity?.slogan}
<div className="max-w-[18px] sm:max-w-[22px]">
<AText />
</div>
</h2>
</div>
);
} }
export default TextHeader export default TextHeader;
+76 -76
View File
@@ -1,4 +1,4 @@
"use client" "use client";
import { useState } from "react"; import { useState } from "react";
@@ -10,86 +10,86 @@ import Link from "next/link";
import SearchD from "@/components/icons/SearchD"; import SearchD from "@/components/icons/SearchD";
function Fields({ city, state }) { function Fields({ city, state }) {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [data, setData] = useState({ const [data, setData] = useState({
province: state?.name || '', province: state?.name || "",
city: city?.name || '', city: city?.name || "",
}); });
return ( return (
<> <>
<ModalSearchCity <ModalSearchCity
open={open} open={open}
state={state} state={state}
selected={data} selected={data}
setOpen={setOpen} setOpen={setOpen}
setSelected={setData} setSelected={setData}
> >
<ButtonFilter setOpen={setOpen} selected={data} /> <ButtonFilter setOpen={setOpen} selected={data} />
</ModalSearchCity> </ModalSearchCity>
<span className="black w-px bg-[#EFEFEF]"></span> <span className="black w-px bg-[#EFEFEF]"></span>
<TextField <TextField
variant="standard" variant="standard"
onChange={e => setData({ ...data, search: e.target.value })} onChange={(e) => setData({ ...data, search: e.target.value })}
InputProps={{ InputProps={{
disableUnderline: true, disableUnderline: true,
}} }}
sx={{ sx={{
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
justifyContent: "center", justifyContent: "center",
"& .MuiInput-root": { "& .MuiInput-root": {
padding: "0", padding: "0",
borderBottom: "none", borderBottom: "none",
}, },
"& .MuiInputBase-input": { "& .MuiInputBase-input": {
color: "#6C757D", color: "#6C757D",
}, },
"& .MuiInputBase-input": { "& .MuiInputBase-input": {
color: "#6C757D", color: "#6C757D",
fontSize: { fontSize: {
xs: "10px !important", xs: "10px !important",
sm: "12px !important", sm: "12px !important",
md: "14px !important", md: "14px !important",
lg: "16px !important", lg: "16px !important",
}, },
} },
}} }}
placeholder="جستجوی نام پزشک، تخصص، بیماری ..." placeholder="جستجوی نام پزشک، تخصص، بیماری ..."
dir="rtl" dir="rtl"
className={`!shadow-none !w-full lg:!w-[524px] bg-[#FAFAFA] !text-[14px] md:!text-[16px] !rounded-0 !font-normal !text-[#6C757D]`} className={`!shadow-none !w-full lg:!w-[524px] bg-[#FAFAFA] !text-[14px] md:!text-[16px] !rounded-0 !font-normal !text-[#6C757D]`}
/> />
<Link <Link
href={{ href={{
pathname: "/doctors", pathname: "/doctors",
query: { query: {
province: data.province, province: data.province,
city: data.city, city: data.city,
search: data.search 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]"> <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]"> <div className="min-w-[20px] min-h-[20px]">
<Search /> <Search />
</div> </div>
<p>جستجو</p> <p>جستجو</p>
</Button> </Button>
<Button <Button
className="!flex lg:!hidden !rounded-[4px] className="!flex lg:!hidden !rounded-[4px]
!w-[40px] sm:!w-[42px] md:!w-[45px] lg:!w-[48px] !w-[40px] sm:!w-[42px] md:!w-[45px] lg:!w-[48px]
!h-[40px] sm:!h-[42px] md:!h-[45px] lg:!h-[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-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] !min-h-[40px] sm:!min-h-[42px] md:!min-h-[45px] lg:!min-h-[48px]
!gap-2.5 !p-2.5" !gap-2.5 !p-2.5"
> >
<div className="w-[24px] h-[24px] min-w-[24px] min-h-[24px]"> <div className="w-[24px] h-[24px] min-w-[24px] min-h-[24px]">
<SearchD /> <SearchD />
</div> </div>
</Button> </Button>
</Link> </Link>
</> </>
) );
} }
export default Fields export default Fields;
+1 -1
View File
@@ -3,7 +3,7 @@ import Fields from "./Fields";
import { getStateInfo } from "@/lib/getStateInfo"; import { getStateInfo } from "@/lib/getStateInfo";
function SearchBar() { function SearchBar() {
const { matchedCity, matchedState } = getStateInfo() const { matchedCity, matchedState } = getStateInfo();
return ( return (
<ButtonGroup <ButtonGroup
+10 -6
View File
@@ -32,16 +32,16 @@ function ModalSearchCity() {
// Load states and cities from JSON files // Load states and cities from JSON files
useEffect(() => { useEffect(() => {
// Format states data to match the structure expected by AutoCompleteSelect // Format states data to match the structure expected by AutoCompleteSelect
const formattedStates = statesData.map(state => ({ const formattedStates = statesData.map((state) => ({
label: state.name, label: state.name,
id: state.id id: state.id,
})); }));
// Format cities data // Format cities data
const formattedCities = citiesData.map(city => ({ const formattedCities = citiesData.map((city) => ({
label: city.name, label: city.name,
id: city.id, id: city.id,
province_id: city.province_id province_id: city.province_id,
})); }));
setStates(formattedStates); setStates(formattedStates);
@@ -51,10 +51,14 @@ function ModalSearchCity() {
// Filter cities when state is selected // Filter cities when state is selected
useEffect(() => { useEffect(() => {
if (selected.first) { if (selected.first) {
const selectedState = states.find(state => state.label === selected.first); const selectedState = states.find(
(state) => state.label === selected.first,
);
if (selectedState) { if (selectedState) {
const stateId = selectedState.id; const stateId = selectedState.id;
const filteredCities = cities.filter(city => city.province_id === stateId); const filteredCities = cities.filter(
(city) => city.province_id === stateId,
);
setFilteredCities(filteredCities); setFilteredCities(filteredCities);
} }
} else { } else {
+1 -3
View File
@@ -14,9 +14,7 @@ function UserEdit({ active }) {
strokeWidth="1.5" strokeWidth="1.5"
strokeLinecap="round" strokeLinecap="round"
strokeLinejoin="round" strokeLinejoin="round"
className={ className={active ? "stroke-[#FAFAFA] delay-500" : ""}
active ? "stroke-[#FAFAFA] delay-500" : ""
}
/> />
<path <path
d="M32.5166 26.2334L26.6165 32.1334C26.3832 32.3668 26.1666 32.8 26.1166 33.1167L25.7999 35.3667C25.6832 36.1833 26.2499 36.75 27.0666 36.6334L29.3165 36.3167C29.6332 36.2667 30.0832 36.05 30.2999 35.8167L36.1999 29.9167C37.2165 28.9001 37.6999 27.7167 36.1999 26.2167C34.7165 24.7333 33.5333 25.2167 32.5166 26.2334Z" d="M32.5166 26.2334L26.6165 32.1334C26.3832 32.3668 26.1666 32.8 26.1166 33.1167L25.7999 35.3667C25.6832 36.1833 26.2499 36.75 27.0666 36.6334L29.3165 36.3167C29.6332 36.2667 30.0832 36.05 30.2999 35.8167L36.1999 29.9167C37.2165 28.9001 37.6999 27.7167 36.1999 26.2167C34.7165 24.7333 33.5333 25.2167 32.5166 26.2334Z"
+21 -23
View File
@@ -3,31 +3,29 @@ import Footer from "./footer";
import Header from "./header"; import Header from "./header";
function StLayout({ children, name }) { function StLayout({ children, name }) {
const { matchedCity } = getStateInfo(); const { matchedCity } = getStateInfo();
return ( return (
<div> <div>
<main className="w-full min-h-screen"> <main className="w-full min-h-screen">
<header className="w-full sticky bg-[#FFF] !z-[70] shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)] mt-[12px] sm:mt-[21px] md:mt-[30px] lg:mt-[40px] top-0 right-1/2"> <header className="w-full sticky bg-[#FFF] !z-[70] shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)] mt-[12px] sm:mt-[21px] md:mt-[30px] lg:mt-[40px] top-0 right-1/2">
<div className="w-full padding-responsive"> <div className="w-full padding-responsive">
<Header matchedCity={matchedCity} name={name} /> <Header matchedCity={matchedCity} name={name} />
</div> </div>
</header> </header>
<section <section className="opacity-page -mt-[calc(48px_+_12px)] sm:-mt-[calc(56px_+_21px)] md:-mt-[calc(64px_+_30px)] lg:-mt-[calc(80px_+_40px)]">
className="opacity-page -mt-[calc(48px_+_12px)] sm:-mt-[calc(56px_+_21px)] md:-mt-[calc(64px_+_30px)] lg:-mt-[calc(80px_+_40px)]" {children}
> </section>
{children} </main>
</section> <footer className="bg-[#F5F5F5] mt-[100px] bg-banner-footer !bg-center !bg-no-repeat !bg-cover">
</main> <div className="pt-[44px] bg-[rgba(255,255,255,0.45)]">
<footer className="bg-[#F5F5F5] mt-[100px] bg-banner-footer !bg-center !bg-no-repeat !bg-cover"> <div className="padding-responsive">
<div className="pt-[44px] bg-[rgba(255,255,255,0.45)]"> <Footer matchedCity={matchedCity} />
<div className="padding-responsive"> </div>
<Footer matchedCity={matchedCity} />
</div>
</div>
</footer>
</div> </div>
); </footer>
</div>
);
} }
export default StLayout; export default StLayout;
+18 -11
View File
@@ -24,16 +24,20 @@ const head = [
]; ];
function Footer({ matchedCity }) { function Footer({ matchedCity }) {
const socialMedias = [{ const socialMedias = [
icon: <Instagram />, {
name: 'instagram' icon: <Instagram />,
}, { name: "instagram",
icon: <Telegram />, },
name: 'telegram' {
}, { icon: <Telegram />,
icon: <Whatsapp />, name: "telegram",
name: 'whatsapp' },
}]; {
icon: <Whatsapp />,
name: "whatsapp",
},
];
const [openMenu, setOpenMenu] = useState({ const [openMenu, setOpenMenu] = useState({
right: false, right: false,
left: false, left: false,
@@ -106,7 +110,10 @@ function Footer({ matchedCity }) {
key={idx} key={idx}
className="p-2.5 bg-[#EAECFA] hover-rotate-icon cursor-pointer rounded-full w-fit" className="p-2.5 bg-[#EAECFA] hover-rotate-icon cursor-pointer rounded-full w-fit"
> >
<Link href={matchedCity?.socialMedia[item.name] || '/'} className="min-h-fit"> <Link
href={matchedCity?.socialMedia[item.name] || "/"}
className="min-h-fit"
>
{item.icon} {item.icon}
</Link> </Link>
</li> </li>
+33 -37
View File
@@ -11,48 +11,44 @@ import UserLogin from "@/components/icons/UserLogin";
import { useState } from "react"; import { useState } from "react";
function Content({ matchedCity, name }) { function Content({ matchedCity, name }) {
const [isActive, setIsActive] = useState(false); const [isActive, setIsActive] = useState(false);
return ( return (
<div <div
className={` className={`
px-[8px] sm:px-[16px] md:px-[24px] lg:px-[32px] py-[4px] sm:py-[8px] md:py-[12px] lg:py-[16px] px-[8px] sm:px-[16px] md:px-[24px] lg:px-[32px] py-[4px] sm:py-[8px] md:py-[12px] lg:py-[16px]
flex transition-all duration-500 overflow-hidden justify-between items-center flex-nowrap flex transition-all duration-500 overflow-hidden justify-between items-center flex-nowrap
${isActive ? "!pr-0" : "!px-4"} ${isActive ? "!pr-0" : "!px-4"}
`} `}
> >
<div> <div>
<BgGray isActive={isActive} setIsActive={setIsActive} /> <BgGray isActive={isActive} setIsActive={setIsActive} />
<Col name={name} isActive={isActive} /> <Col name={name} isActive={isActive} />
<div className="relative flex flex-row-reverse gap-2"> <div className="relative flex flex-row-reverse gap-2">
<Logo matchedCity={matchedCity} /> <Logo matchedCity={matchedCity} />
<div className="flex lg:hidden z-20"> <div className="flex lg:hidden z-20">
<ButtonMenu isActive={isActive} setIsActive={setIsActive} /> <ButtonMenu isActive={isActive} setIsActive={setIsActive} />
<Logo isAbsolute={true} matchedCity={matchedCity} /> <Logo isAbsolute={true} matchedCity={matchedCity} />
</div> </div>
</div>
</div>
<Row name={name} />
<Link href="/login">
<Button
className="!hidden lg:!flex"
variant="outlined"
color="primary"
>
ورود | ثبت نام
</Button>
<Button
className={`!flex lg:!hidden !p-2 !rounded-full transition-all duration-500 !bg-[#EFEFEF]`}
variant="text"
color="primary"
>
<div className="flex lg:hidden">
<UserLogin />
</div>
</Button>
</Link>
</div> </div>
) </div>
<Row name={name} />
<Link href="/login">
<Button className="!hidden lg:!flex" variant="outlined" color="primary">
ورود | ثبت نام
</Button>
<Button
className={`!flex lg:!hidden !p-2 !rounded-full transition-all duration-500 !bg-[#EFEFEF]`}
variant="text"
color="primary"
>
<div className="flex lg:hidden">
<UserLogin />
</div>
</Button>
</Link>
</div>
);
} }
export default Content export default Content;
+1 -5
View File
@@ -1,13 +1,9 @@
import Content from "./Content"; import Content from "./Content";
function Header({ matchedCity, name }) { function Header({ matchedCity, name }) {
return ( return (
<div className="bg-[#FFF] rounded-lg w-full mx-auto"> <div className="bg-[#FFF] rounded-lg w-full mx-auto">
<Content <Content matchedCity={matchedCity} name={name} />
matchedCity={matchedCity}
name={name}
/>
</div> </div>
); );
} }
+1 -4
View File
@@ -9,10 +9,7 @@ function Row({ name }) {
<Link <Link
href={nav.link} href={nav.link}
className={` className={`
${nav.link === name ${nav.link === name ? "!text-[#526CAC]" : "text-[#525252]"}
? "!text-[#526CAC]"
: "text-[#525252]"
}
text-[16px] font-medium text-[16px] font-medium
`} `}
> >
+1 -1
View File
@@ -23,7 +23,7 @@ function Col({ isActive, name }) {
${ ${
isActiveURL( isActiveURL(
nav.link.replace("/", ""), nav.link.replace("/", ""),
name name,
) )
? "!text-[#526CAC] !bg-[rgba(199,_206,_244,_0.30)]" ? "!text-[#526CAC] !bg-[rgba(199,_206,_244,_0.30)]"
: "!text-[#525252]" : "!text-[#525252]"
+5 -4
View File
@@ -14,7 +14,7 @@ function Layout({
user, user,
value, value,
setValue, setValue,
matchedCity matchedCity,
}) { }) {
return ( return (
<div> <div>
@@ -30,9 +30,10 @@ function Layout({
<section <section
className={` className={`
opacity-page -mt-[calc(48px_+_12px)] sm:-mt-[calc(56px_+_21px)] md:-mt-[calc(64px_+_30px)] lg:-mt-[calc(80px_+_40px)] opacity-page -mt-[calc(48px_+_12px)] sm:-mt-[calc(56px_+_21px)] md:-mt-[calc(64px_+_30px)] lg:-mt-[calc(80px_+_40px)]
${isSidebar && ${
"padding-responsive min-h-screen flex items-stretch justify-center gap-[12px] lg:gap-[24px] pt-[76px] sm:pt-[109px] mt:pt-[142px] lg:pt-[176px]" isSidebar &&
} "padding-responsive min-h-screen flex items-stretch justify-center gap-[12px] lg:gap-[24px] pt-[76px] sm:pt-[109px] mt:pt-[142px] lg:pt-[176px]"
}
`} `}
> >
{isSidebar && ( {isSidebar && (
+1 -1
View File
@@ -1,4 +1,4 @@
"use client" "use client";
import CardD from "@/components/icons/CardD"; import CardD from "@/components/icons/CardD";
import LogoutD from "@/components/icons/LogoutD"; import LogoutD from "@/components/icons/LogoutD";
+1 -1
View File
@@ -6,7 +6,7 @@ import { removeToken } from "@/utils";
function ModalLogout({ open, handleClose }) { function ModalLogout({ open, handleClose }) {
const logout = () => { const logout = () => {
removeToken(); removeToken();
window.location.pathname = '/login' window.location.pathname = "/login";
handleClose(); handleClose();
}; };
+44 -43
View File
@@ -9,53 +9,54 @@ import { usePathname } from "next/navigation";
import BgGray from "@/components/layoutPanel/sidebar/BgGray"; import BgGray from "@/components/layoutPanel/sidebar/BgGray";
function Content({ children }) { function Content({ children }) {
const pathname = usePathname(); const pathname = usePathname();
const [active, setActive] = useState(false); const [active, setActive] = useState(false);
const [open, setOpen] = useState(true); const [open, setOpen] = useState(true);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
useEffect(() => { useEffect(() => {
setTimeout(() => { setTimeout(() => {
setLoading(false); setLoading(false);
}, 2000); }, 2000);
}, []); }, []);
return ( return (
<div className="flex min-h-screen dark:bg-[#1F1D2B]"> <div className="flex min-h-screen dark:bg-[#1F1D2B]">
<Sidebar <Sidebar
open={open} open={open}
active={active} active={active}
setOpen={setOpen} setOpen={setOpen}
setActive={setActive} setActive={setActive}
/> />
<BgGray isActive={active} setIsActive={setActive} /> <BgGray isActive={active} setIsActive={setActive} />
<main <main
className={` className={`
w-full transition-all duration-500 dark:bg-[#1F1D2B] w-full transition-all duration-500 dark:bg-[#1F1D2B]
${pathname.includes("dashboard") ${
? open pathname.includes("dashboard")
? "md:min-w-[calc(100%_-_243px)] md:w-[calc(100%_-_243px)] xl:min-w-[calc(100%_-_243px_-_332px)] xl:w-[calc(100%_-_243px_-_332px)]" ? open
: "md:min-w-[calc(100%_-_96px)] md:w-[calc(100%_-_96px)] xl:min-w-[calc(100%_-_96px_-_332px)] xl:w-[calc(100%_-_96px_-_332px)]" ? "md:min-w-[calc(100%_-_243px)] md:w-[calc(100%_-_243px)] xl:min-w-[calc(100%_-_243px_-_332px)] xl:w-[calc(100%_-_243px_-_332px)]"
: open : "md:min-w-[calc(100%_-_96px)] md:w-[calc(100%_-_96px)] xl:min-w-[calc(100%_-_96px_-_332px)] xl:w-[calc(100%_-_96px_-_332px)]"
? "md:w-[calc(100%-243px)]" : open
: "md:w-[calc(100%-96px)]" ? "md:w-[calc(100%-243px)]"
} : "md:w-[calc(100%-96px)]"
}
`} `}
> >
<Header <Header
data={Information} data={Information}
setActive={setActive} setActive={setActive}
disableProfile={pathname.includes("dashboard")} disableProfile={pathname.includes("dashboard")}
/> />
<section className="my-[24px] opacity-element mx-[16px] bg-[#FAFAFA] dark:bg-[#1F1D2B]"> <section className="my-[24px] opacity-element mx-[16px] bg-[#FAFAFA] dark:bg-[#1F1D2B]">
{children} {children}
</section> </section>
</main> </main>
{pathname.includes("dashboard") && ( {pathname.includes("dashboard") && (
<UserDetail data={Information} loading={loading} /> <UserDetail data={Information} loading={loading} />
)} )}
</div> </div>
); );
} }
export default Content; export default Content;
+4 -1
View File
@@ -16,7 +16,10 @@ function Table({ data, loading }) {
centerTable={centerTable} centerTable={centerTable}
> >
{data.list_of_doctors_appointments.map((row, idx) => ( {data.list_of_doctors_appointments.map((row, idx) => (
<TableRow key={idx} className="!border-0 !border-b !border-[#DBDBDB] dark:!border-transparent"> <TableRow
key={idx}
className="!border-0 !border-b !border-[#DBDBDB] dark:!border-transparent"
>
<TableCell <TableCell
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap" className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
align="center" align="center"
+2 -4
View File
@@ -2,11 +2,9 @@ import RegisterPage from "@/components/register";
import { getStateInfo } from "@/lib/getStateInfo"; import { getStateInfo } from "@/lib/getStateInfo";
function ContentLogin() { function ContentLogin() {
const { matchedCity } = getStateInfo(); const { matchedCity } = getStateInfo();
return ( return <RegisterPage matchedCity={matchedCity} />;
<RegisterPage matchedCity={matchedCity} />
);
} }
export default ContentLogin; export default ContentLogin;
+13 -13
View File
@@ -6,20 +6,20 @@ import LogInPage from "@/components/register/LogInPage";
import { useState } from "react"; import { useState } from "react";
function ContentVerify() { function ContentVerify() {
const [isSendMsg, setIsSendMsg] = useState(false); const [isSendMsg, setIsSendMsg] = useState(false);
return ( return (
<RegisterPage> <RegisterPage>
{isSendMsg ? ( {isSendMsg ? (
<SetCodePage <SetCodePage
setIsSendMsg={setIsSendMsg} setIsSendMsg={setIsSendMsg}
link={`/account/${localStorage.getItem("doctor-id")}`} link={`/account/${localStorage.getItem("doctor-id")}`}
/> />
) : ( ) : (
<LogInPage setIsSendMsg={setIsSendMsg} /> <LogInPage setIsSendMsg={setIsSendMsg} />
)} )}
</RegisterPage> </RegisterPage>
); );
} }
export default ContentVerify; export default ContentVerify;
+35 -33
View File
@@ -4,41 +4,43 @@ import Link from "next/link";
const about = ["سوالات متداول", "تماس با ما", "درباره ما"]; const about = ["سوالات متداول", "تماس با ما", "درباره ما"];
function LayoutRegister({ children, matchedCity }) { function LayoutRegister({ children, matchedCity }) {
return ( return (
<div <div
className="flex padding-responsive items-center justify-center pt-[32px] className="flex padding-responsive items-center justify-center pt-[32px]
overflow-auto flex-col h-screen w-full bg-banner-stroke !bg-bottom !bg-no-repeat !bg-cover overflow-auto flex-col h-screen w-full bg-banner-stroke !bg-bottom !bg-no-repeat !bg-cover
!pb-[60px] md:!pb-[60px]" !pb-[60px] md:!pb-[60px]"
> >
<Link href="/"> <Link href="/">
<div className="flex items-center justify-center gap-[5px] sm:mt-0"> <div className="flex items-center justify-center gap-[5px] sm:mt-0">
<Image <Image
src="/assets/images/logo.png" src="/assets/images/logo.png"
width={40} width={40}
height={40} height={40}
alt="logo" alt="logo"
/> />
<p className="text-[#5559CE] text-[20px] font-bold">{matchedCity?.site_name || "نوبت ۷۲۴"}</p> <p className="text-[#5559CE] text-[20px] font-bold">
</div> {matchedCity?.site_name || "نوبت ۷۲۴"}
</Link> </p>
{children}
<div className="fixed bottom-0 left-0 bg-[#FAFAFA] w-full pb-[10px] md:pb-[14px] px-[18px] sm:px-[67px] md:px[117px] lg:px-[166px]">
<div className="bg-border-t-gradient-sign h-px w-full"></div>
<div className="flex items-center justify-center gap-[32px] sm:gap-[40px] md:gap-[48px] lg:gap-[56px] mt-[10px] md:mt-[14px]">
{about.map((item, idx) => (
<Link href="/" key={idx}>
<p
className="text-[#494CB3] text-[14px] md:text-[16px] font-normal"
key={idx}
>
{item}
</p>
</Link>
))}
</div>
</div>
</div> </div>
) </Link>
{children}
<div className="fixed bottom-0 left-0 bg-[#FAFAFA] w-full pb-[10px] md:pb-[14px] px-[18px] sm:px-[67px] md:px[117px] lg:px-[166px]">
<div className="bg-border-t-gradient-sign h-px w-full"></div>
<div className="flex items-center justify-center gap-[32px] sm:gap-[40px] md:gap-[48px] lg:gap-[56px] mt-[10px] md:mt-[14px]">
{about.map((item, idx) => (
<Link href="/" key={idx}>
<p
className="text-[#494CB3] text-[14px] md:text-[16px] font-normal"
key={idx}
>
{item}
</p>
</Link>
))}
</div>
</div>
</div>
);
} }
export default LayoutRegister export default LayoutRegister;
+19 -12
View File
@@ -6,7 +6,7 @@ import { useState } from "react";
function LogInPage({ setIsSendMsg, setStep, matchedCity }) { function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
const [num, setNum] = useState(""); const [num, setNum] = useState("");
const [error, setError] = useState({ valid: true, text: '' }); const [error, setError] = useState({ valid: true, text: "" });
const handleChange = (val) => { const handleChange = (val) => {
const formatted = formatPhoneNumber(val); const formatted = formatPhoneNumber(val);
@@ -34,28 +34,35 @@ function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
error={!error.valid} error={!error.valid}
spaceNull={true} spaceNull={true}
inputProps={{ inputProps={{
startAdornment: startAdornment: (
<InputAdornment <InputAdornment
className="!ml-4" className="!ml-4"
position="start" position="start"
sx={{ sx={{
'.MuiTypography-root': { ".MuiTypography-root": {
lineHeight: '0 !important', lineHeight: "0 !important",
},
".muirtl-1qj5e5k-MuiTypography-root": {
color: "#000000de !important",
}, },
'.muirtl-1qj5e5k-MuiTypography-root': {
color: '#000000de !important'
}
}} }}
>09</InputAdornment>, >
09
</InputAdornment>
),
}} }}
title="شماره همراه" title="شماره همراه"
updateState={handleChange} updateState={handleChange}
/> />
<p className={` <p
className={`
text-[#d32f2f] text-[14px] mt-2 min-h-[21px] transition-all duration-1000 ease-in-out text-[#d32f2f] text-[14px] mt-2 min-h-[21px] transition-all duration-1000 ease-in-out
transform transform
${error.valid ? 'opacity-0 -translate-y-1' : 'opacity-100 translate-y-0'} ${error.valid ? "opacity-0 -translate-y-1" : "opacity-100 translate-y-0"}
`}>{error.text}</p> `}
>
{error.text}
</p>
</div> </div>
<Button <Button
fullWidth fullWidth
@@ -77,7 +84,7 @@ function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
<Link href="/"> <Link href="/">
<span className="text-[#F17732] underline">قوانین استفاده</span> <span className="text-[#F17732] underline">قوانین استفاده</span>
</Link>{" "} </Link>{" "}
از {matchedCity?.site_name || 'نوبت 724'} را می پذیرم. از {matchedCity?.site_name || "نوبت 724"} را می پذیرم.
</p> </p>
</div> </div>
); );
+5 -1
View File
@@ -13,7 +13,11 @@ function RegisterPage({ matchedCity }) {
{isSendMsg ? ( {isSendMsg ? (
<SetCodePage setIsSendMsg={setIsSendMsg} setStep={false} link="/" /> <SetCodePage setIsSendMsg={setIsSendMsg} setStep={false} link="/" />
) : ( ) : (
<LogInPage matchedCity={matchedCity} setStep={false} setIsSendMsg={setIsSendMsg} /> <LogInPage
matchedCity={matchedCity}
setStep={false}
setIsSendMsg={setIsSendMsg}
/>
)} )}
</LayoutRegister> </LayoutRegister>
); );
+1 -1
View File
@@ -11,7 +11,7 @@ function SmSearch({ placeholder, handleSearch }) {
> >
<TextField <TextField
variant="standard" variant="standard"
onChange={e => handleSearch(e.target.value)} onChange={(e) => handleSearch(e.target.value)}
InputProps={{ InputProps={{
disableUnderline: true, disableUnderline: true,
}} }}
+4 -6
View File
@@ -8,10 +8,11 @@ import specialtiesData from "@/data/specialties.json";
import { searchOnList } from "@/helper"; import { searchOnList } from "@/helper";
function SpecialtiesPage() { function SpecialtiesPage() {
const [filteredSpecialties, setFilteredSpecialties] = useState(specialtiesData); const [filteredSpecialties, setFilteredSpecialties] =
useState(specialtiesData);
const handleSearch = (value) => const handleSearch = (value) =>
setFilteredSpecialties(searchOnList(specialtiesData, value, 'name')); setFilteredSpecialties(searchOnList(specialtiesData, value, "name"));
return ( return (
<div className=""> <div className="">
@@ -19,10 +20,7 @@ function SpecialtiesPage() {
title="تخصص مورد نظر شما چیست؟" title="تخصص مورد نظر شما چیست؟"
detail="تخصص مورد نظرتان را جستجو کرده و یا از لیست زیر انتخاب نمایید:" detail="تخصص مورد نظرتان را جستجو کرده و یا از لیست زیر انتخاب نمایید:"
> >
<SmSearch <SmSearch placeholder="جستجوی تخصص" handleSearch={handleSearch} />
placeholder="جستجوی تخصص"
handleSearch={handleSearch}
/>
</HeadPageList> </HeadPageList>
<List specialties={filteredSpecialties} /> <List specialties={filteredSpecialties} />
</div> </div>
@@ -14,7 +14,9 @@ function ItemSpecialties({ data }) {
rounded-lg bg-[#FFF] shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)] rounded-lg bg-[#FFF] shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
hover:bg-[#5559CE] transition-all text-item-head-white duration-500 cursor-pointer hover-mode-item-speciality" hover:bg-[#5559CE] transition-all text-item-head-white duration-500 cursor-pointer hover-mode-item-speciality"
> >
<h2 className="text-[#3B3B3B] item-head text-[16px] font-bold text-center">{data.name}</h2> <h2 className="text-[#3B3B3B] item-head text-[16px] font-bold text-center">
{data.name}
</h2>
<p className="text-[#7E7E7E] text-[14px] font-medium"> <p className="text-[#7E7E7E] text-[14px] font-medium">
{data.number_of_doctors} پزشک {data.number_of_doctors} پزشک
</p> </p>
+1 -1
View File
@@ -8,7 +8,7 @@ const ProvinceContext = createContext();
export const ProvinceProvider = ({ children }) => { export const ProvinceProvider = ({ children }) => {
const [hostName, setHostName] = useState(""); const [hostName, setHostName] = useState("");
const isProvinceInclude = citiesData.find((city) => const isProvinceInclude = citiesData.find((city) =>
hostName.includes(city.domain.split(".")[0]) hostName.includes(city.domain.split(".")[0]),
); );
useEffect(() => { useEffect(() => {
+1 -1
View File
@@ -671,4 +671,4 @@
"footerDescription": "نوبت 724، سامانه جامع نوبت‌دهی پزشکی برای تمامی شهرها. رزرو نوبت از پزشکان و مراکز درمانی معتبر بدون نیاز به مراجعه حضوری.", "footerDescription": "نوبت 724، سامانه جامع نوبت‌دهی پزشکی برای تمامی شهرها. رزرو نوبت از پزشکان و مراکز درمانی معتبر بدون نیاز به مراجعه حضوری.",
"footerDisclaimer": "تمامی حقوق این سایت متعلق به نوبت 724 می‌باشد." "footerDisclaimer": "تمامی حقوق این سایت متعلق به نوبت 724 می‌باشد."
} }
] ]
+1 -1
View File
@@ -65,4 +65,4 @@
"location": "اهواز، کیان آباد، خیابان ۱۶ غربی، پلاک ۱۰", "location": "اهواز، کیان آباد، خیابان ۱۶ غربی، پلاک ۱۰",
"hours_of_work": "شنبه تا سه شنبه ساعت ۱۶ تا ۲۲" "hours_of_work": "شنبه تا سه شنبه ساعت ۱۶ تا ۲۲"
} }
] ]
+1 -1
View File
@@ -344,4 +344,4 @@
"name": "سکته مغزی", "name": "سکته مغزی",
"parent": null "parent": null
} }
] ]
+63 -63
View File
@@ -1,126 +1,126 @@
[ [
{ {
"id": "1", "id": "1",
"name": "آذربایجان شرقی" "name": "آذربایجان شرقی"
}, },
{ {
"id": "2", "id": "2",
"name": "آذربایجان غربی" "name": "آذربایجان غربی"
}, },
{ {
"id": "3", "id": "3",
"name": "اردبیل" "name": "اردبیل"
}, },
{ {
"id": "4", "id": "4",
"name": "اصفهان" "name": "اصفهان"
}, },
{ {
"id": "5", "id": "5",
"name": "البرز" "name": "البرز"
}, },
{ {
"id": "6", "id": "6",
"name": "ایلام" "name": "ایلام"
}, },
{ {
"id": "7", "id": "7",
"name": "بوشهر" "name": "بوشهر"
}, },
{ {
"id": "8", "id": "8",
"name": "تهران" "name": "تهران"
}, },
{ {
"id": "9", "id": "9",
"name": "چهارمحال و بختیاری" "name": "چهارمحال و بختیاری"
}, },
{ {
"id": "10", "id": "10",
"name": "خراسان جنوبی" "name": "خراسان جنوبی"
}, },
{ {
"id": "11", "id": "11",
"name": "خراسان رضوی" "name": "خراسان رضوی"
}, },
{ {
"id": "12", "id": "12",
"name": "خراسان شمالی" "name": "خراسان شمالی"
}, },
{ {
"id": "13", "id": "13",
"name": "خوزستان" "name": "خوزستان"
}, },
{ {
"id": "14", "id": "14",
"name": "زنجان" "name": "زنجان"
}, },
{ {
"id": "15", "id": "15",
"name": "سمنان" "name": "سمنان"
}, },
{ {
"id": "16", "id": "16",
"name": "سیستان و بلوچستان" "name": "سیستان و بلوچستان"
}, },
{ {
"id": "17", "id": "17",
"name": "فارس" "name": "فارس"
}, },
{ {
"id": "18", "id": "18",
"name": "قزوین" "name": "قزوین"
}, },
{ {
"id": "19", "id": "19",
"name": "قم" "name": "قم"
}, },
{ {
"id": "20", "id": "20",
"name": "کردستان" "name": "کردستان"
}, },
{ {
"id": "21", "id": "21",
"name": "کرمان" "name": "کرمان"
}, },
{ {
"id": "22", "id": "22",
"name": "کرمانشاه" "name": "کرمانشاه"
}, },
{ {
"id": "23", "id": "23",
"name": "کهگیلویه و بویراحمد" "name": "کهگیلویه و بویراحمد"
}, },
{ {
"id": "24", "id": "24",
"name": "گلستان" "name": "گلستان"
}, },
{ {
"id": "25", "id": "25",
"name": "گیلان" "name": "گیلان"
}, },
{ {
"id": "26", "id": "26",
"name": "لرستان" "name": "لرستان"
}, },
{ {
"id": "27", "id": "27",
"name": "مازندران" "name": "مازندران"
}, },
{ {
"id": "28", "id": "28",
"name": "مرکزی" "name": "مرکزی"
}, },
{ {
"id": "29", "id": "29",
"name": "هرمزگان" "name": "هرمزگان"
}, },
{ {
"id": "30", "id": "30",
"name": "همدان" "name": "همدان"
}, },
{ {
"id": "31", "id": "31",
"name": "یزد" "name": "یزد"
} }
] ]
+7 -7
View File
@@ -1,8 +1,8 @@
[ [
{ {
"id": 1, "id": 1,
"location": "اهواز، کیانپارس، پهلوان شرقی، مجتمع پزشکی آویسا، واحد ۱۲", "location": "اهواز، کیانپارس، پهلوان شرقی، مجتمع پزشکی آویسا، واحد ۱۲",
"hours_of_work": "شنبه تا سه شنبه ساعت 16 تا 22", "hours_of_work": "شنبه تا سه شنبه ساعت 16 تا 22",
"first_free_turn": "یکشنبه 24 اردیبهشت" "first_free_turn": "یکشنبه 24 اردیبهشت"
} }
] ]
+28 -31
View File
@@ -92,41 +92,40 @@ export const alert = (type, text, prop) => {
</p> </p>
<p className="text-[14px] font-normal">{text}</p> <p className="text-[14px] font-normal">{text}</p>
</div>, </div>,
{ prop } { prop },
); );
}; };
export const addLabelToList = (list) => export const addLabelToList = (list) =>
list.map(item => { list.map((item) => {
return { return {
...item, ...item,
label: item.name label: item.name,
} };
}) });
export const formatPhoneNumber = (input) => { export const formatPhoneNumber = (input) => {
const digits = input.replace(/\D/g, ''); const digits = input.replace(/\D/g, "");
const trimmed = digits.substring(0, 9); const trimmed = digits.substring(0, 9);
const match = trimmed.match(/^(\d{0,2})(\d{0,3})(\d{0,4})$/); const match = trimmed.match(/^(\d{0,2})(\d{0,3})(\d{0,4})$/);
if (!match) return trimmed; if (!match) return trimmed;
return [match[1], match[2], match[3]].filter(Boolean).join(' '); return [match[1], match[2], match[3]].filter(Boolean).join(" ");
}; };
export function validatePhoneNumber(input) { export function validatePhoneNumber(input) {
const digits = input.replace(/\D/g, ''); const digits = input.replace(/\D/g, "");
if (!digits) { if (!digits) {
return { valid: false, text: 'شماره موبایل نمی‌تواند خالی باشد.' }; return { valid: false, text: "شماره موبایل نمی‌تواند خالی باشد." };
} }
if (digits.length !== 9) { if (digits.length !== 9) {
return { valid: false, text: 'شماره موبایل باید دقیقا 11 رقم باشد.' }; return { valid: false, text: "شماره موبایل باید دقیقا 11 رقم باشد." };
} }
const isValid = /^[1-9]\d{8}$/.test(digits); const isValid = /^[1-9]\d{8}$/.test(digits);
if (!isValid) { if (!isValid) {
return { valid: false, text: 'شماره موبایل نامعتبر است.' }; return { valid: false, text: "شماره موبایل نامعتبر است." };
} }
return { valid: true, text: null }; return { valid: true, text: null };
@@ -134,47 +133,45 @@ export function validatePhoneNumber(input) {
export const searchOnList = (list, value, name) => { export const searchOnList = (list, value, name) => {
let newList = list; let newList = list;
newList = list.filter(item => newList = list.filter((item) => item[name].toLowerCase().includes(value));
item[name].toLowerCase().includes(value)
)
return newList; return newList;
} };
export const addKeyToList = (list, nameKey, nameValue) => { export const addKeyToList = (list, nameKey, nameValue) => {
const newList = list.map(item => { const newList = list.map((item) => {
return { return {
...item, ...item,
[nameKey]: item[nameValue] [nameKey]: item[nameValue],
} };
}); });
return newList; return newList;
} };
export function clearFilterParams(router, listRemove) { export function clearFilterParams(router, listRemove) {
const currentParams = new URLSearchParams(window.location.search); const currentParams = new URLSearchParams(window.location.search);
const keysToRemove = listRemove; const keysToRemove = listRemove;
keysToRemove.forEach((key) => currentParams.delete(key)); keysToRemove.forEach((key) => currentParams.delete(key));
const queryString = currentParams.toString(); const queryString = currentParams.toString();
const newUrl = queryString ? `/doctors?${queryString}` : '/doctors'; const newUrl = queryString ? `/doctors?${queryString}` : "/doctors";
router.push(newUrl); router.push(newUrl);
} }
export const filterList = (data) => { export const filterList = (data) => {
const parentList = specialties.filter(item => !item.parent); const parentList = specialties.filter((item) => !item.parent);
const childrenList = specialties.filter(item => item.parent); const childrenList = specialties.filter((item) => item.parent);
const changedParentList = addKeyToList(parentList, 'label', 'name') || []; const changedParentList = addKeyToList(parentList, "label", "name") || [];
const changedChildrenList = addKeyToList(childrenList, 'label', 'name') || []; const changedChildrenList = addKeyToList(childrenList, "label", "name") || [];
const filteredChildrenList = const filteredChildrenList =
data && data.category ? data && data.category
changedChildrenList.filter(item => item.parent === data.category.id) : ? changedChildrenList.filter((item) => item.parent === data.category.id)
[]; : [];
return { return {
parentList: changedParentList, parentList: changedParentList,
childrenList: filteredChildrenList childrenList: filteredChildrenList,
} };
} };
+10 -6
View File
@@ -5,12 +5,16 @@ import citiesData from "@/data/city.json";
import statesData from "@/data/state.json"; import statesData from "@/data/state.json";
export function getStateInfo() { export function getStateInfo() {
const headersList = headers(); const headersList = headers();
const host = headersList.get("host") || ""; const host = headersList.get("host") || "";
const subdomain = host.split(".")[0]; const subdomain = host.split(".")[0];
const matchedCity = citiesData.find((city) => city.domain.includes(subdomain)); const matchedCity = citiesData.find((city) =>
const matchedState = matchedCity && statesData.find(state => state.id === matchedCity.province_id) city.domain.includes(subdomain),
);
const matchedState =
matchedCity &&
statesData.find((state) => state.id === matchedCity.province_id);
return { matchedCity, matchedState }; return { matchedCity, matchedState };
} }
+17
View File
@@ -44,6 +44,7 @@
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"postcss": "^8", "postcss": "^8",
"prettier": "^3.5.3",
"tailwindcss": "^3.4.1" "tailwindcss": "^3.4.1"
} }
}, },
@@ -19102,6 +19103,22 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/prettier": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz",
"integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/pretty-bytes": { "node_modules/pretty-bytes": {
"version": "5.6.0", "version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
+1
View File
@@ -45,6 +45,7 @@
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"postcss": "^8", "postcss": "^8",
"prettier": "^3.5.3",
"tailwindcss": "^3.4.1" "tailwindcss": "^3.4.1"
} }
} }
+2 -2
View File
@@ -28,7 +28,7 @@ api.interceptors.request.use(
} }
return request; return request;
}, },
(err) => Promise.reject(err) (err) => Promise.reject(err),
); );
api.interceptors.response.use( api.interceptors.response.use(
@@ -41,7 +41,7 @@ api.interceptors.response.use(
window.location.pathname = "/login"; window.location.pathname = "/login";
} else { } else {
} }
} },
); );
export default api; export default api;