change format all file
This commit is contained in:
@@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout";
|
||||
|
||||
function AboutUs() {
|
||||
return (
|
||||
<Layout name='/about-us'>
|
||||
<Layout name="/about-us">
|
||||
<AboutUsPage />
|
||||
</Layout>
|
||||
);
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout";
|
||||
|
||||
function Blogs() {
|
||||
return (
|
||||
<Layout name='/blogs'>
|
||||
<Layout name="/blogs">
|
||||
<BlogsPage />
|
||||
</Layout>
|
||||
);
|
||||
|
||||
@@ -4,9 +4,7 @@ import { getStateInfo } from "@/lib/getStateInfo";
|
||||
function Booking({ params: { slug } }) {
|
||||
const { matchedCity } = getStateInfo();
|
||||
|
||||
return (
|
||||
<BookingPage slug={slug} matchedCity={matchedCity} />
|
||||
);
|
||||
return <BookingPage slug={slug} matchedCity={matchedCity} />;
|
||||
}
|
||||
|
||||
export default Booking;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ function Clinics() {
|
||||
const { matchedCity, matchedState } = getStateInfo();
|
||||
|
||||
return (
|
||||
<Layout name='/clinics'>
|
||||
<Layout name="/clinics">
|
||||
<ClinicsPage matchedCity={matchedCity} matchedState={matchedState} />
|
||||
</Layout>
|
||||
);
|
||||
|
||||
@@ -2,9 +2,7 @@ function AnimationTextHead({ text, children }) {
|
||||
return (
|
||||
<div className="flex justify-center items-start relative w-fit">
|
||||
<div className="overflow-hidden mb-[4px] md:mb-[5px] lg:mb-[6px]">
|
||||
<p
|
||||
className="text-[#3B3B3B] text-nowrap overflow-hidden text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold"
|
||||
>
|
||||
<p className="text-[#3B3B3B] text-nowrap overflow-hidden text-[14px] sm:text-[16px] md:text-[18px] lg:text-[20px] font-bold">
|
||||
{text}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ function Logo({ isAbsolute, matchedCity }) {
|
||||
alt="logo"
|
||||
/>
|
||||
<p className="text-[#526CAC] text-[14px] lg:text-[16px] font-bold font-kalame">
|
||||
{matchedCity?.site_name || 'نوبت ۷۲۴'}
|
||||
{matchedCity?.site_name || "نوبت ۷۲۴"}
|
||||
</p>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
@@ -5,7 +5,8 @@ function Pageguide({ list }) {
|
||||
<li key={idx} className="flex items-center justify-start gap-1">
|
||||
<h2
|
||||
className={`text-[16px] font-normal
|
||||
${list.length > idx + 1
|
||||
${
|
||||
list.length > idx + 1
|
||||
? "text-[#9B9B9B]"
|
||||
: "text-[#525252]"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ import { Pagination as PaginationMUI } from "@mui/material";
|
||||
|
||||
function Pagination({ page, setPage, list, itemsPerPage }) {
|
||||
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 (
|
||||
<PaginationMUI
|
||||
@@ -10,7 +11,7 @@ function Pagination({ page, setPage, list, itemsPerPage }) {
|
||||
page={page || 1}
|
||||
onChange={setPage && handleChange}
|
||||
color="primary"
|
||||
className={count < 2 && '!hidden'}
|
||||
className={count < 2 && "!hidden"}
|
||||
sx={{
|
||||
"& .mui-8q7g72-MuiButtonBase-root-MuiPaginationItem-root": {
|
||||
color: "#616161",
|
||||
|
||||
@@ -47,7 +47,7 @@ function TimePickerField({ dataChange, isVacation, disable, timeStart, data }) {
|
||||
const hours = e.$H;
|
||||
const minute = e.$m;
|
||||
const newValue = `${handleTwoLength(hours)}:${handleTwoLength(
|
||||
minute
|
||||
minute,
|
||||
)}`;
|
||||
|
||||
const newData = data;
|
||||
|
||||
@@ -18,7 +18,7 @@ function TimePickerInput({ changeData, handleDisableHours, name, data }) {
|
||||
const hours = e.$H;
|
||||
const minute = e.$m;
|
||||
const newValue = `${handleTwoLength(hours)}:${handleTwoLength(
|
||||
minute
|
||||
minute,
|
||||
)}`;
|
||||
// setValue(newValue);
|
||||
changeData(newValue, name);
|
||||
|
||||
@@ -83,7 +83,7 @@ function ItemUser({
|
||||
data.is_like ? data.like - 1 : data.like + 1,
|
||||
data,
|
||||
"like",
|
||||
"is_like"
|
||||
"is_like",
|
||||
)
|
||||
}
|
||||
>
|
||||
@@ -105,7 +105,7 @@ function ItemUser({
|
||||
data.is_dislike ? data.dislike - 1 : data.dislike + 1,
|
||||
data,
|
||||
"dislike",
|
||||
"is_dislike"
|
||||
"is_dislike",
|
||||
)
|
||||
}
|
||||
>
|
||||
|
||||
@@ -11,7 +11,7 @@ function AutoCompleteSelect({
|
||||
label,
|
||||
disabled = false,
|
||||
listboxProps,
|
||||
sendAll
|
||||
sendAll,
|
||||
}) {
|
||||
return (
|
||||
<Autocomplete
|
||||
@@ -22,7 +22,13 @@ function AutoCompleteSelect({
|
||||
value={value || null}
|
||||
className="!w-full !rounded-lg auto-complete-selector"
|
||||
onChange={(e, newValue) => {
|
||||
updateData && updateData((newValue && sendAll) ? newValue : (newValue && !sendAll) && newValue.label || "", name);
|
||||
updateData &&
|
||||
updateData(
|
||||
newValue && sendAll
|
||||
? newValue
|
||||
: (newValue && !sendAll && newValue.label) || "",
|
||||
name,
|
||||
);
|
||||
}}
|
||||
sx={{
|
||||
...styleTextSelectRight,
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
import { TextField } from "@mui/material";
|
||||
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 (
|
||||
<TextField
|
||||
label={title}
|
||||
@@ -13,8 +22,9 @@ function Field({ title, error, spaceNull, inputProps, type, dir, value, updateSt
|
||||
className="!w-full !mx-auto !bg-[#FFF]"
|
||||
InputProps={inputProps}
|
||||
sx={{
|
||||
'.MuiOutlinedInput-notchedOutline.muirtl-1d3z3hw-MuiOutlinedInput-notchedOutline': {
|
||||
border: error && '1px solid red !important'
|
||||
".MuiOutlinedInput-notchedOutline.muirtl-1d3z3hw-MuiOutlinedInput-notchedOutline":
|
||||
{
|
||||
border: error && "1px solid red !important",
|
||||
},
|
||||
...styleTextSelectRight,
|
||||
// Hide Icon Number
|
||||
@@ -25,7 +35,9 @@ function Field({ title, error, spaceNull, inputProps, type, dir, value, updateSt
|
||||
"& input[type=number]": {
|
||||
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" },
|
||||
"& .MuiOutlinedInput-notchedOutline": {
|
||||
border: "1px solid #E9ECEF !important",
|
||||
|
||||
@@ -18,10 +18,10 @@ function ButtonFilter({ selected, setOpen }) {
|
||||
<Location />
|
||||
</div>
|
||||
<p
|
||||
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'
|
||||
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.city || 'شهر'}
|
||||
{selected.city || "شهر"}
|
||||
</p>
|
||||
<div className="w-[16px] h-[16px] md:w-[18px] md:h-[18px] lg:w-[20px] lg:h-[20px] grid place-items-center">
|
||||
<ArrowBottomH />
|
||||
|
||||
@@ -23,9 +23,9 @@ function Content({
|
||||
};
|
||||
|
||||
const handleFilter = () => {
|
||||
handleSearch && handleSearch('');
|
||||
handleSearch && handleSearch("");
|
||||
handleClose();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -10,7 +10,15 @@ import statesData from "@/data/state.json";
|
||||
import citiesData from "@/data/city.json";
|
||||
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 states = addLabelToList(statesData);
|
||||
@@ -22,12 +30,12 @@ function ModalSearchCity({ children, selected, handleSearch, state, setSelected,
|
||||
useEffect(() => {
|
||||
if (provinceSelected) {
|
||||
const selectedState = states.find(
|
||||
(state) => state.label === provinceSelected
|
||||
(state) => state.label === provinceSelected,
|
||||
);
|
||||
if (selectedState) {
|
||||
const stateId = selectedState.id;
|
||||
const filteredCities = cities.filter(
|
||||
(city) => city.province_id === stateId
|
||||
(city) => city.province_id === stateId,
|
||||
);
|
||||
setFilteredCities(filteredCities);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ async function getCroppedImg(imageSrc, pixelCrop) {
|
||||
ctx.drawImage(
|
||||
image,
|
||||
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);
|
||||
|
||||
@@ -31,7 +31,7 @@ async function getCroppedImg(imageSrc, pixelCrop) {
|
||||
ctx.putImageData(
|
||||
data,
|
||||
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");
|
||||
|
||||
@@ -4,9 +4,7 @@ import { getStateInfo } from "@/lib/getStateInfo";
|
||||
function UserAccount() {
|
||||
const { matchedCity } = getStateInfo();
|
||||
|
||||
return (
|
||||
<Content matchedCity={matchedCity} />
|
||||
);
|
||||
return <Content matchedCity={matchedCity} />;
|
||||
}
|
||||
|
||||
export default UserAccount;
|
||||
|
||||
+9
-6
@@ -213,11 +213,13 @@ html {
|
||||
}
|
||||
|
||||
.cover-head-blogs {
|
||||
background: linear-gradient(180deg,
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(0, 0, 0, 0) 0%,
|
||||
rgba(0, 0, 0, 0.07) 31.47%,
|
||||
rgba(0, 0, 0, 0.31) 59.72%,
|
||||
rgba(0, 0, 0, 0.7) 89.39%);
|
||||
rgba(0, 0, 0, 0.7) 89.39%
|
||||
);
|
||||
border-radius: 16px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
@@ -585,7 +587,6 @@ html {
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
|
||||
.day-label-bar-inner-rtl,
|
||||
.panel-jalaali,
|
||||
.panel-header-rtl,
|
||||
@@ -619,13 +620,15 @@ html {
|
||||
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;
|
||||
height: 50px;
|
||||
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;
|
||||
height: 50px;
|
||||
border-radius: 20px;
|
||||
@@ -845,5 +848,5 @@ html {
|
||||
/* End Of Toastify */
|
||||
|
||||
.text-item-head-white:hover .item-head {
|
||||
color: #D7D8ED;
|
||||
color: #d7d8ed;
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
import ContentVerify from "@/components/register/ContentVerify";
|
||||
|
||||
function LoginVerify() {
|
||||
return (
|
||||
<ContentVerify />
|
||||
);
|
||||
return <ContentVerify />;
|
||||
}
|
||||
|
||||
export default LoginVerify;
|
||||
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
import ContentLogin from "@/components/register/ContentLogin";
|
||||
|
||||
function LogIn() {
|
||||
return (
|
||||
<ContentLogin />
|
||||
);
|
||||
return <ContentLogin />;
|
||||
}
|
||||
|
||||
export default LogIn;
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<Layout name='/'>
|
||||
<Layout name="/">
|
||||
<HomePage />
|
||||
</Layout>
|
||||
);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import Content from "@/components/panel/Content";
|
||||
|
||||
function LayoutPanel({ children }) {
|
||||
return (
|
||||
<Content children={children} />
|
||||
);
|
||||
return <Content children={children} />;
|
||||
}
|
||||
|
||||
export default LayoutPanel;
|
||||
|
||||
@@ -3,7 +3,7 @@ import Information from "@/data/information.json";
|
||||
import Bank from "@/data/bank.json";
|
||||
|
||||
function UserAccount() {
|
||||
return <UserAccountPage data={{information: Information, bank: Bank}} />;
|
||||
return <UserAccountPage data={{ information: Information, bank: Bank }} />;
|
||||
}
|
||||
|
||||
export default UserAccount;
|
||||
|
||||
@@ -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">
|
||||
{socials.map((item, idx) => (
|
||||
<CircularLoading width={36} key={idx} height={36} loading={loading}>
|
||||
<li
|
||||
className="bg-[#EFEFEF] rounded-full hover-rotate-icon p-[9px]"
|
||||
>
|
||||
<li className="bg-[#EFEFEF] rounded-full hover-rotate-icon p-[9px]">
|
||||
{item}
|
||||
</li>
|
||||
</CircularLoading>
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import Information from "./information";
|
||||
import Location from "./location";
|
||||
|
||||
function Content({
|
||||
doctor,
|
||||
step,
|
||||
setStep,
|
||||
children,
|
||||
isFirst,
|
||||
disableSide,
|
||||
}) {
|
||||
function Content({ doctor, step, setStep, 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
|
||||
|
||||
@@ -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} />
|
||||
<Detail doctor={doctor} step={step} setStep={setStep} />
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ function Slider({ data, loading }) {
|
||||
className="min-w-[90px] min-h-[90px] object-cover rounded-[8px] overflow-hidden"
|
||||
/>
|
||||
</CustomLoading>
|
||||
) : undefined
|
||||
) : undefined,
|
||||
)}
|
||||
</ul>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import { Button, ButtonGroup, TextField } from "@mui/material";
|
||||
import SearchD from "@/components/icons/SearchD";
|
||||
import ModalSearchCity from "@/app/component/modalSearchCity";
|
||||
@@ -28,7 +27,7 @@ function SearchBar({ selected, setSelected, state, handleSearch }) {
|
||||
</ModalSearchCity>
|
||||
<TextField
|
||||
variant="standard"
|
||||
onChange={e => handleSearch(e.target.value)}
|
||||
onChange={(e) => handleSearch(e.target.value)}
|
||||
InputProps={{
|
||||
disableUnderline: true,
|
||||
}}
|
||||
|
||||
@@ -10,7 +10,7 @@ import HeadPageList from "@/app/component/head";
|
||||
|
||||
function ClinicsPage({ matchedCity, matchedState }) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [filteredClinics, setFilteredClinics] = useState(clinics)
|
||||
const [filteredClinics, setFilteredClinics] = useState(clinics);
|
||||
|
||||
const [selected, setSelected] = useState({
|
||||
province: matchedState?.name || "",
|
||||
@@ -23,10 +23,9 @@ function ClinicsPage({ matchedCity, matchedState }) {
|
||||
}, 2000);
|
||||
}, []);
|
||||
|
||||
|
||||
const handleSearch = (value) => {
|
||||
const searchOnName = searchOnList(clinics, value, 'title')
|
||||
const searchOnLocation = searchOnList(searchOnName, selected.city, 'city')
|
||||
const searchOnName = searchOnList(clinics, value, "title");
|
||||
const searchOnLocation = searchOnList(searchOnName, selected.city, "city");
|
||||
setFilteredClinics(searchOnLocation);
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ function ItemClinic({ data, loading }) {
|
||||
</CircularLoading>
|
||||
<div className="flex flex-col items-start justify-center gap-2">
|
||||
<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 loading={loading} width={60} height={18}>
|
||||
<p className="text-[#7E7E7E] text-[14px] font-normal">
|
||||
|
||||
@@ -10,7 +10,8 @@ function ContentContact({ text, children, url, label }) {
|
||||
{children}
|
||||
</div>
|
||||
<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>
|
||||
</li>
|
||||
);
|
||||
|
||||
@@ -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]
|
||||
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]
|
||||
${isDefault ? 'lg:pl-[18%]' : 'w-full'}`}
|
||||
${isDefault ? "lg:pl-[18%]" : "w-full"}`}
|
||||
>
|
||||
<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} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -8,25 +8,29 @@ import ContentContact from "../ContentContact";
|
||||
function Links({ matchedCity }) {
|
||||
return (
|
||||
<ul className="flex flex-col mt-[68px] justify-start items-start gap-[32px]">
|
||||
<ContentContact url="tel:900300400" label='تلفن تماس: ' text={matchedCity.contactPhone}>
|
||||
<ContentContact
|
||||
url="tel:900300400"
|
||||
label="تلفن تماس: "
|
||||
text={matchedCity.contactPhone}
|
||||
>
|
||||
<CallC />
|
||||
</ContentContact>
|
||||
<ContentContact
|
||||
url="https://wa.me/09124568794"
|
||||
text={matchedCity.socialMedia.whatsapp}
|
||||
label='واتساپ: '
|
||||
label="واتساپ: "
|
||||
>
|
||||
<WhatsappC />
|
||||
</ContentContact>
|
||||
<ContentContact
|
||||
url="mailto:batome@gmail.com"
|
||||
text={matchedCity.email}
|
||||
label='ایمیل: '
|
||||
label="ایمیل: "
|
||||
>
|
||||
<EmailC />
|
||||
</ContentContact>
|
||||
</ul>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default Links
|
||||
export default Links;
|
||||
|
||||
@@ -9,9 +9,7 @@ function ContactUsPage() {
|
||||
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">
|
||||
<Call matchedCity={matchedCity} isDefault={isDefault} />
|
||||
{matchedCity?.id === "63" && (
|
||||
<Connect />
|
||||
)}
|
||||
{matchedCity?.id === "63" && <Connect />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ function DashboardPage({
|
||||
setValue,
|
||||
isOpenSide,
|
||||
setIsOpenSide,
|
||||
matchedCity
|
||||
matchedCity,
|
||||
}) {
|
||||
return (
|
||||
<Layout
|
||||
|
||||
@@ -21,7 +21,8 @@ function AboutDcotor({ doctor, loading }) {
|
||||
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]
|
||||
after:shadow-xl after:w-full transition-all duration-500 md:after:!bg-[linear-gradient(transparent,transparent)]
|
||||
${isMore
|
||||
${
|
||||
isMore
|
||||
? "after:bg-transparent max-h-screen"
|
||||
: "after:bg-[linear-gradient(transparent,#FAFAFA)] max-h-[200px]"
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@ function ProgressAll({ doctor, loading }) {
|
||||
<br />
|
||||
رضایت کاربران
|
||||
</p>
|
||||
<p className="text-[#3B3B3B]">{numberToArStyle(doctor.total_user_satisfaction)}%</p>
|
||||
<p className="text-[#3B3B3B]">
|
||||
{numberToArStyle(doctor.total_user_satisfaction)}%
|
||||
</p>
|
||||
</div>
|
||||
</CircularLoading>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,8 @@ function Chart({ doctor, loading }) {
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center justify-center gap-[50px]">
|
||||
<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) => (
|
||||
|
||||
@@ -18,14 +18,17 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
|
||||
province: matchedState?.name || params?.province,
|
||||
city: matchedCity?.name || params?.city,
|
||||
});
|
||||
const findItem = (name, value) => specialties.find(item => item[name] === value)
|
||||
const itemCategory = findItem('id', params.category);
|
||||
const itemSpecialties = findItem('id', params.specialties);
|
||||
const findItem = (name, value) =>
|
||||
specialties.find((item) => item[name] === value);
|
||||
const itemCategory = findItem("id", params.category);
|
||||
const itemSpecialties = findItem("id", params.specialties);
|
||||
|
||||
const [data, setData] = useState({
|
||||
category: itemCategory || "",
|
||||
specialties: itemSpecialties ? { ...itemSpecialties, label: itemSpecialties.name } : "",
|
||||
turn: params && params.hasOwnProperty('turn') ? JSON.parse(params.turn) : 1,
|
||||
specialties: itemSpecialties
|
||||
? { ...itemSpecialties, label: itemSpecialties.name }
|
||||
: "",
|
||||
turn: params && params.hasOwnProperty("turn") ? JSON.parse(params.turn) : 1,
|
||||
gender: params.gender || "هر دو",
|
||||
degree: params.degree || "متخصص",
|
||||
});
|
||||
|
||||
@@ -6,7 +6,6 @@ import { filterList } from "@/helper";
|
||||
const group1 = ["خانم", "آقا", "هر دو"];
|
||||
const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"];
|
||||
|
||||
|
||||
function Content({ data, setData }) {
|
||||
const router = useRouter();
|
||||
const { parentList, childrenList } = filterList(data);
|
||||
@@ -15,21 +14,21 @@ function Content({ data, setData }) {
|
||||
const current = new URLSearchParams(window.location.search);
|
||||
current.set(name, value.id || value);
|
||||
if (removeSpecialties) {
|
||||
current.delete('specialties')
|
||||
};
|
||||
const queryString = current.toString();
|
||||
router.push(`/doctors?${queryString}`)
|
||||
current.delete("specialties");
|
||||
}
|
||||
const queryString = current.toString();
|
||||
router.push(`/doctors?${queryString}`);
|
||||
};
|
||||
|
||||
const changeData = (value, name, removeSpecialties) => {
|
||||
changeUrl(value, name, removeSpecialties);
|
||||
const newData = data;
|
||||
newData[name] = value;
|
||||
if (removeSpecialties) {
|
||||
newData.specialties = ''
|
||||
};
|
||||
setData(newData);
|
||||
newData.specialties = "";
|
||||
}
|
||||
setData(newData);
|
||||
};
|
||||
|
||||
return (
|
||||
<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}
|
||||
text="جنسیت پزشک"
|
||||
group={group1}
|
||||
name='gender'
|
||||
name="gender"
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<RadioContent
|
||||
@@ -67,7 +66,7 @@ function Content({ data, setData }) {
|
||||
value={data.degree}
|
||||
text="درجه علمی"
|
||||
group={group2}
|
||||
name='degree'
|
||||
name="degree"
|
||||
/>
|
||||
<span className="block mt-[16px] mb-[24px] w-full h-px bg-[#EFEFEF]"></span>
|
||||
<div className="flex items-center justify-start gap-[12px]">
|
||||
@@ -76,7 +75,7 @@ function Content({ data, setData }) {
|
||||
<Switch
|
||||
checked={data.turn}
|
||||
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",
|
||||
fontWeight: 500,
|
||||
},
|
||||
marginLeft: '0 !important',
|
||||
marginLeft: "0 !important",
|
||||
}}
|
||||
label="فقط پزشکان دارای نوبت"
|
||||
labelPlacement="start"
|
||||
|
||||
@@ -16,7 +16,13 @@ function FilterModal({ data, setData, children }) {
|
||||
const handleClose = () => setOpen(false);
|
||||
|
||||
const deleteData = () => {
|
||||
clearFilterParams(router, ['turn', 'specialties', 'degree', 'category', 'gender'])
|
||||
clearFilterParams(router, [
|
||||
"turn",
|
||||
"specialties",
|
||||
"degree",
|
||||
"category",
|
||||
"gender",
|
||||
]);
|
||||
setData({
|
||||
category: "",
|
||||
specialties: "",
|
||||
@@ -25,7 +31,7 @@ function FilterModal({ data, setData, children }) {
|
||||
degree: "متخصص",
|
||||
});
|
||||
handleClose();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -31,7 +31,7 @@ function SearchBar({ data, setData, params }) {
|
||||
</FilterModal>
|
||||
<TextField
|
||||
variant="standard"
|
||||
defaultValue={params.search || ''}
|
||||
defaultValue={params.search || ""}
|
||||
InputProps={{
|
||||
disableUnderline: true,
|
||||
}}
|
||||
|
||||
@@ -29,13 +29,17 @@ function SelectSort() {
|
||||
</SvgIcon>
|
||||
{value ? (
|
||||
<ul className="flex items-center justify-start gap-1">
|
||||
{Array(sort).fill({}).map((_, idx) => (
|
||||
{Array(sort)
|
||||
.fill({})
|
||||
.map((_, idx) => (
|
||||
<li key={idx}>
|
||||
<StarDI />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
) : "مرتب سازی"}
|
||||
) : (
|
||||
"مرتب سازی"
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
@@ -60,8 +64,13 @@ function SelectSort() {
|
||||
name={item.label}
|
||||
className="!flex !flex-col !items-start !w-full hover:!bg-transparent"
|
||||
>
|
||||
<div value={item.id} className="!p-2 !mr-2 !w-[calc(100%_-_16px)] flex items-center justify-start">
|
||||
{Array(item.label).fill({}).map((_, idx) => (
|
||||
<div
|
||||
value={item.id}
|
||||
className="!p-2 !mr-2 !w-[calc(100%_-_16px)] flex items-center justify-start"
|
||||
>
|
||||
{Array(item.label)
|
||||
.fill({})
|
||||
.map((_, idx) => (
|
||||
<StarDI key={idx} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -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={{
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/doctors",
|
||||
query: {
|
||||
category: item.parent,
|
||||
specialties: item.id,
|
||||
},
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<li key={idx}>
|
||||
<Button
|
||||
variant="contained"
|
||||
|
||||
@@ -23,7 +23,7 @@ function TextHeader() {
|
||||
</div>
|
||||
</h2>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default TextHeader
|
||||
export default TextHeader;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"use client"
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -12,8 +12,8 @@ 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 || '',
|
||||
province: state?.name || "",
|
||||
city: city?.name || "",
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -30,7 +30,7 @@ function Fields({ city, state }) {
|
||||
<span className="black w-px bg-[#EFEFEF]"></span>
|
||||
<TextField
|
||||
variant="standard"
|
||||
onChange={e => setData({ ...data, search: e.target.value })}
|
||||
onChange={(e) => setData({ ...data, search: e.target.value })}
|
||||
InputProps={{
|
||||
disableUnderline: true,
|
||||
}}
|
||||
@@ -53,7 +53,7 @@ function Fields({ city, state }) {
|
||||
md: "14px !important",
|
||||
lg: "16px !important",
|
||||
},
|
||||
}
|
||||
},
|
||||
}}
|
||||
placeholder="جستجوی نام پزشک، تخصص، بیماری ..."
|
||||
dir="rtl"
|
||||
@@ -65,7 +65,7 @@ function Fields({ city, state }) {
|
||||
query: {
|
||||
province: data.province,
|
||||
city: data.city,
|
||||
search: data.search
|
||||
search: data.search,
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -89,7 +89,7 @@ function Fields({ city, state }) {
|
||||
</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 {
|
||||
|
||||
@@ -14,9 +14,7 @@ function UserEdit({ active }) {
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
className={
|
||||
active ? "stroke-[#FAFAFA] delay-500" : ""
|
||||
}
|
||||
className={active ? "stroke-[#FAFAFA] delay-500" : ""}
|
||||
/>
|
||||
<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"
|
||||
|
||||
@@ -13,9 +13,7 @@ function StLayout({ children, name }) {
|
||||
<Header matchedCity={matchedCity} name={name} />
|
||||
</div>
|
||||
</header>
|
||||
<section
|
||||
className="opacity-page -mt-[calc(48px_+_12px)] sm:-mt-[calc(56px_+_21px)] md:-mt-[calc(64px_+_30px)] lg:-mt-[calc(80px_+_40px)]"
|
||||
>
|
||||
<section className="opacity-page -mt-[calc(48px_+_12px)] sm:-mt-[calc(56px_+_21px)] md:-mt-[calc(64px_+_30px)] lg:-mt-[calc(80px_+_40px)]">
|
||||
{children}
|
||||
</section>
|
||||
</main>
|
||||
|
||||
@@ -24,16 +24,20 @@ const head = [
|
||||
];
|
||||
|
||||
function Footer({ matchedCity }) {
|
||||
const socialMedias = [{
|
||||
const socialMedias = [
|
||||
{
|
||||
icon: <Instagram />,
|
||||
name: 'instagram'
|
||||
}, {
|
||||
name: "instagram",
|
||||
},
|
||||
{
|
||||
icon: <Telegram />,
|
||||
name: 'telegram'
|
||||
}, {
|
||||
name: "telegram",
|
||||
},
|
||||
{
|
||||
icon: <Whatsapp />,
|
||||
name: 'whatsapp'
|
||||
}];
|
||||
name: "whatsapp",
|
||||
},
|
||||
];
|
||||
const [openMenu, setOpenMenu] = useState({
|
||||
right: false,
|
||||
left: false,
|
||||
@@ -106,7 +110,10 @@ function Footer({ matchedCity }) {
|
||||
key={idx}
|
||||
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}
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
@@ -34,11 +34,7 @@ function Content({ matchedCity, name }) {
|
||||
</div>
|
||||
<Row name={name} />
|
||||
<Link href="/login">
|
||||
<Button
|
||||
className="!hidden lg:!flex"
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
>
|
||||
<Button className="!hidden lg:!flex" variant="outlined" color="primary">
|
||||
ورود | ثبت نام
|
||||
</Button>
|
||||
<Button
|
||||
@@ -52,7 +48,7 @@ function Content({ matchedCity, name }) {
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default Content
|
||||
export default Content;
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import Content from "./Content";
|
||||
|
||||
function Header({ matchedCity, name }) {
|
||||
|
||||
return (
|
||||
<div className="bg-[#FFF] rounded-lg w-full mx-auto">
|
||||
<Content
|
||||
matchedCity={matchedCity}
|
||||
name={name}
|
||||
/>
|
||||
<Content matchedCity={matchedCity} name={name} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,7 @@ function Row({ name }) {
|
||||
<Link
|
||||
href={nav.link}
|
||||
className={`
|
||||
${nav.link === name
|
||||
? "!text-[#526CAC]"
|
||||
: "text-[#525252]"
|
||||
}
|
||||
${nav.link === name ? "!text-[#526CAC]" : "text-[#525252]"}
|
||||
text-[16px] font-medium
|
||||
`}
|
||||
>
|
||||
|
||||
@@ -23,7 +23,7 @@ function Col({ isActive, name }) {
|
||||
${
|
||||
isActiveURL(
|
||||
nav.link.replace("/", ""),
|
||||
name
|
||||
name,
|
||||
)
|
||||
? "!text-[#526CAC] !bg-[rgba(199,_206,_244,_0.30)]"
|
||||
: "!text-[#525252]"
|
||||
|
||||
@@ -14,7 +14,7 @@ function Layout({
|
||||
user,
|
||||
value,
|
||||
setValue,
|
||||
matchedCity
|
||||
matchedCity,
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
@@ -30,7 +30,8 @@ function Layout({
|
||||
<section
|
||||
className={`
|
||||
opacity-page -mt-[calc(48px_+_12px)] sm:-mt-[calc(56px_+_21px)] md:-mt-[calc(64px_+_30px)] lg:-mt-[calc(80px_+_40px)]
|
||||
${isSidebar &&
|
||||
${
|
||||
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]"
|
||||
}
|
||||
`}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"use client"
|
||||
"use client";
|
||||
|
||||
import CardD from "@/components/icons/CardD";
|
||||
import LogoutD from "@/components/icons/LogoutD";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { removeToken } from "@/utils";
|
||||
function ModalLogout({ open, handleClose }) {
|
||||
const logout = () => {
|
||||
removeToken();
|
||||
window.location.pathname = '/login'
|
||||
window.location.pathname = "/login";
|
||||
handleClose();
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ function Content({ children }) {
|
||||
<main
|
||||
className={`
|
||||
w-full transition-all duration-500 dark:bg-[#1F1D2B]
|
||||
${pathname.includes("dashboard")
|
||||
${
|
||||
pathname.includes("dashboard")
|
||||
? open
|
||||
? "md:min-w-[calc(100%_-_243px)] md:w-[calc(100%_-_243px)] xl:min-w-[calc(100%_-_243px_-_332px)] xl:w-[calc(100%_-_243px_-_332px)]"
|
||||
: "md:min-w-[calc(100%_-_96px)] md:w-[calc(100%_-_96px)] xl:min-w-[calc(100%_-_96px_-_332px)] xl:w-[calc(100%_-_96px_-_332px)]"
|
||||
|
||||
@@ -16,7 +16,10 @@ function Table({ data, loading }) {
|
||||
centerTable={centerTable}
|
||||
>
|
||||
{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
|
||||
className="!pr-[18px] dark:!border-transparent !text-[#616161] dark:!text-[#A1A1A1] !text-[16px] !font-medium !text-nowrap"
|
||||
align="center"
|
||||
|
||||
@@ -4,9 +4,7 @@ import { getStateInfo } from "@/lib/getStateInfo";
|
||||
function ContentLogin() {
|
||||
const { matchedCity } = getStateInfo();
|
||||
|
||||
return (
|
||||
<RegisterPage matchedCity={matchedCity} />
|
||||
);
|
||||
return <RegisterPage matchedCity={matchedCity} />;
|
||||
}
|
||||
|
||||
export default ContentLogin;
|
||||
|
||||
@@ -18,7 +18,9 @@ function LayoutRegister({ children, matchedCity }) {
|
||||
height={40}
|
||||
alt="logo"
|
||||
/>
|
||||
<p className="text-[#5559CE] text-[20px] font-bold">{matchedCity?.site_name || "نوبت ۷۲۴"}</p>
|
||||
<p className="text-[#5559CE] text-[20px] font-bold">
|
||||
{matchedCity?.site_name || "نوبت ۷۲۴"}
|
||||
</p>
|
||||
</div>
|
||||
</Link>
|
||||
{children}
|
||||
@@ -38,7 +40,7 @@ function LayoutRegister({ children, matchedCity }) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default LayoutRegister
|
||||
export default LayoutRegister;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useState } from "react";
|
||||
|
||||
function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
|
||||
const [num, setNum] = useState("");
|
||||
const [error, setError] = useState({ valid: true, text: '' });
|
||||
const [error, setError] = useState({ valid: true, text: "" });
|
||||
|
||||
const handleChange = (val) => {
|
||||
const formatted = formatPhoneNumber(val);
|
||||
@@ -34,28 +34,35 @@ function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
|
||||
error={!error.valid}
|
||||
spaceNull={true}
|
||||
inputProps={{
|
||||
startAdornment:
|
||||
startAdornment: (
|
||||
<InputAdornment
|
||||
className="!ml-4"
|
||||
position="start"
|
||||
sx={{
|
||||
'.MuiTypography-root': {
|
||||
lineHeight: '0 !important',
|
||||
".MuiTypography-root": {
|
||||
lineHeight: "0 !important",
|
||||
},
|
||||
".muirtl-1qj5e5k-MuiTypography-root": {
|
||||
color: "#000000de !important",
|
||||
},
|
||||
'.muirtl-1qj5e5k-MuiTypography-root': {
|
||||
color: '#000000de !important'
|
||||
}
|
||||
}}
|
||||
>09</InputAdornment>,
|
||||
>
|
||||
09
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
title="شماره همراه"
|
||||
updateState={handleChange}
|
||||
/>
|
||||
<p className={`
|
||||
<p
|
||||
className={`
|
||||
text-[#d32f2f] text-[14px] mt-2 min-h-[21px] transition-all duration-1000 ease-in-out
|
||||
transform
|
||||
${error.valid ? 'opacity-0 -translate-y-1' : 'opacity-100 translate-y-0'}
|
||||
`}>{error.text}</p>
|
||||
${error.valid ? "opacity-0 -translate-y-1" : "opacity-100 translate-y-0"}
|
||||
`}
|
||||
>
|
||||
{error.text}
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
fullWidth
|
||||
@@ -77,7 +84,7 @@ function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
|
||||
<Link href="/">
|
||||
<span className="text-[#F17732] underline">قوانین استفاده</span>
|
||||
</Link>{" "}
|
||||
از {matchedCity?.site_name || 'نوبت 724'} را می پذیرم.
|
||||
از {matchedCity?.site_name || "نوبت 724"} را می پذیرم.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,11 @@ function RegisterPage({ matchedCity }) {
|
||||
{isSendMsg ? (
|
||||
<SetCodePage setIsSendMsg={setIsSendMsg} setStep={false} link="/" />
|
||||
) : (
|
||||
<LogInPage matchedCity={matchedCity} setStep={false} setIsSendMsg={setIsSendMsg} />
|
||||
<LogInPage
|
||||
matchedCity={matchedCity}
|
||||
setStep={false}
|
||||
setIsSendMsg={setIsSendMsg}
|
||||
/>
|
||||
)}
|
||||
</LayoutRegister>
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ function SmSearch({ placeholder, handleSearch }) {
|
||||
>
|
||||
<TextField
|
||||
variant="standard"
|
||||
onChange={e => handleSearch(e.target.value)}
|
||||
onChange={(e) => handleSearch(e.target.value)}
|
||||
InputProps={{
|
||||
disableUnderline: true,
|
||||
}}
|
||||
|
||||
@@ -8,10 +8,11 @@ import specialtiesData from "@/data/specialties.json";
|
||||
import { searchOnList } from "@/helper";
|
||||
|
||||
function SpecialtiesPage() {
|
||||
const [filteredSpecialties, setFilteredSpecialties] = useState(specialtiesData);
|
||||
const [filteredSpecialties, setFilteredSpecialties] =
|
||||
useState(specialtiesData);
|
||||
|
||||
const handleSearch = (value) =>
|
||||
setFilteredSpecialties(searchOnList(specialtiesData, value, 'name'));
|
||||
setFilteredSpecialties(searchOnList(specialtiesData, value, "name"));
|
||||
|
||||
return (
|
||||
<div className="">
|
||||
@@ -19,10 +20,7 @@ function SpecialtiesPage() {
|
||||
title="تخصص مورد نظر شما چیست؟"
|
||||
detail="تخصص مورد نظرتان را جستجو کرده و یا از لیست زیر انتخاب نمایید:"
|
||||
>
|
||||
<SmSearch
|
||||
placeholder="جستجوی تخصص"
|
||||
handleSearch={handleSearch}
|
||||
/>
|
||||
<SmSearch placeholder="جستجوی تخصص" handleSearch={handleSearch} />
|
||||
</HeadPageList>
|
||||
<List specialties={filteredSpecialties} />
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,9 @@ function ItemSpecialties({ data }) {
|
||||
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"
|
||||
>
|
||||
<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">
|
||||
{data.number_of_doctors} پزشک
|
||||
</p>
|
||||
|
||||
@@ -8,7 +8,7 @@ const ProvinceContext = createContext();
|
||||
export const ProvinceProvider = ({ children }) => {
|
||||
const [hostName, setHostName] = useState("");
|
||||
const isProvinceInclude = citiesData.find((city) =>
|
||||
hostName.includes(city.domain.split(".")[0])
|
||||
hostName.includes(city.domain.split(".")[0]),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
+28
-31
@@ -92,41 +92,40 @@ export const alert = (type, text, prop) => {
|
||||
</p>
|
||||
<p className="text-[14px] font-normal">{text}</p>
|
||||
</div>,
|
||||
{ prop }
|
||||
{ prop },
|
||||
);
|
||||
};
|
||||
|
||||
export const addLabelToList = (list) =>
|
||||
list.map(item => {
|
||||
list.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
label: item.name
|
||||
}
|
||||
})
|
||||
label: item.name,
|
||||
};
|
||||
});
|
||||
|
||||
export const formatPhoneNumber = (input) => {
|
||||
const digits = input.replace(/\D/g, '');
|
||||
const digits = input.replace(/\D/g, "");
|
||||
const trimmed = digits.substring(0, 9);
|
||||
const match = trimmed.match(/^(\d{0,2})(\d{0,3})(\d{0,4})$/);
|
||||
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) {
|
||||
const digits = input.replace(/\D/g, '');
|
||||
const digits = input.replace(/\D/g, "");
|
||||
|
||||
if (!digits) {
|
||||
return { valid: false, text: 'شماره موبایل نمیتواند خالی باشد.' };
|
||||
return { valid: false, text: "شماره موبایل نمیتواند خالی باشد." };
|
||||
}
|
||||
|
||||
|
||||
if (digits.length !== 9) {
|
||||
return { valid: false, text: 'شماره موبایل باید دقیقا 11 رقم باشد.' };
|
||||
return { valid: false, text: "شماره موبایل باید دقیقا 11 رقم باشد." };
|
||||
}
|
||||
|
||||
const isValid = /^[1-9]\d{8}$/.test(digits);
|
||||
if (!isValid) {
|
||||
return { valid: false, text: 'شماره موبایل نامعتبر است.' };
|
||||
return { valid: false, text: "شماره موبایل نامعتبر است." };
|
||||
}
|
||||
|
||||
return { valid: true, text: null };
|
||||
@@ -134,47 +133,45 @@ export function validatePhoneNumber(input) {
|
||||
|
||||
export const searchOnList = (list, value, name) => {
|
||||
let newList = list;
|
||||
newList = list.filter(item =>
|
||||
item[name].toLowerCase().includes(value)
|
||||
)
|
||||
newList = list.filter((item) => item[name].toLowerCase().includes(value));
|
||||
return newList;
|
||||
}
|
||||
};
|
||||
|
||||
export const addKeyToList = (list, nameKey, nameValue) => {
|
||||
const newList = list.map(item => {
|
||||
const newList = list.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
[nameKey]: item[nameValue]
|
||||
}
|
||||
[nameKey]: item[nameValue],
|
||||
};
|
||||
});
|
||||
|
||||
return newList;
|
||||
}
|
||||
};
|
||||
|
||||
export function clearFilterParams(router, listRemove) {
|
||||
const currentParams = new URLSearchParams(window.location.search);
|
||||
const keysToRemove = listRemove;
|
||||
keysToRemove.forEach((key) => currentParams.delete(key));
|
||||
const queryString = currentParams.toString();
|
||||
const newUrl = queryString ? `/doctors?${queryString}` : '/doctors';
|
||||
const newUrl = queryString ? `/doctors?${queryString}` : "/doctors";
|
||||
|
||||
router.push(newUrl);
|
||||
}
|
||||
|
||||
export const filterList = (data) => {
|
||||
const parentList = specialties.filter(item => !item.parent);
|
||||
const childrenList = specialties.filter(item => item.parent);
|
||||
const parentList = specialties.filter((item) => !item.parent);
|
||||
const childrenList = specialties.filter((item) => item.parent);
|
||||
|
||||
const changedParentList = addKeyToList(parentList, 'label', 'name') || [];
|
||||
const changedChildrenList = addKeyToList(childrenList, 'label', 'name') || [];
|
||||
const changedParentList = addKeyToList(parentList, "label", "name") || [];
|
||||
const changedChildrenList = addKeyToList(childrenList, "label", "name") || [];
|
||||
|
||||
const filteredChildrenList =
|
||||
data && data.category ?
|
||||
changedChildrenList.filter(item => item.parent === data.category.id) :
|
||||
[];
|
||||
data && data.category
|
||||
? changedChildrenList.filter((item) => item.parent === data.category.id)
|
||||
: [];
|
||||
|
||||
return {
|
||||
parentList: changedParentList,
|
||||
childrenList: filteredChildrenList
|
||||
}
|
||||
}
|
||||
childrenList: filteredChildrenList,
|
||||
};
|
||||
};
|
||||
|
||||
+6
-2
@@ -9,8 +9,12 @@ export function getStateInfo() {
|
||||
const host = headersList.get("host") || "";
|
||||
const subdomain = host.split(".")[0];
|
||||
|
||||
const matchedCity = citiesData.find((city) => city.domain.includes(subdomain));
|
||||
const matchedState = matchedCity && statesData.find(state => state.id === matchedCity.province_id)
|
||||
const matchedCity = citiesData.find((city) =>
|
||||
city.domain.includes(subdomain),
|
||||
);
|
||||
const matchedState =
|
||||
matchedCity &&
|
||||
statesData.find((state) => state.id === matchedCity.province_id);
|
||||
|
||||
return { matchedCity, matchedState };
|
||||
}
|
||||
|
||||
Generated
+17
@@ -44,6 +44,7 @@
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.3",
|
||||
"postcss": "^8",
|
||||
"prettier": "^3.5.3",
|
||||
"tailwindcss": "^3.4.1"
|
||||
}
|
||||
},
|
||||
@@ -19102,6 +19103,22 @@
|
||||
"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": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.3",
|
||||
"postcss": "^8",
|
||||
"prettier": "^3.5.3",
|
||||
"tailwindcss": "^3.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ api.interceptors.request.use(
|
||||
}
|
||||
return request;
|
||||
},
|
||||
(err) => Promise.reject(err)
|
||||
(err) => Promise.reject(err),
|
||||
);
|
||||
|
||||
api.interceptors.response.use(
|
||||
@@ -41,7 +41,7 @@ api.interceptors.response.use(
|
||||
window.location.pathname = "/login";
|
||||
} else {
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user