From 254d5d4ebd12bcee48ae56d4475f8d1aeb38bbd1 Mon Sep 17 00:00:00 2001 From: Ehsan Date: Sun, 18 May 2025 01:18:35 +0330 Subject: [PATCH] change format all file --- app/about-us/page.js | 2 +- app/blogs/page.js | 2 +- app/booking/[slug]/page.js | 4 +- app/clinics/page.js | 2 +- app/component/AnimationTextHead.js | 4 +- app/component/Logo.js | 2 +- app/component/Pageguide.js | 9 +- app/component/Pagination.js | 11 +- app/component/TimePickerField.js | 2 +- app/component/TimePickerInput.js | 2 +- app/component/comment/ItemUser.js | 4 +- app/component/element/AutoCompleteSelect.js | 28 ++-- app/component/element/Field.js | 28 +++- app/component/loading/Multiline.js | 20 +-- app/component/modalSearchCity/ButtonFilter.js | 6 +- app/component/modalSearchCity/Content.js | 4 +- app/component/modalSearchCity/index.js | 14 +- app/component/uploadFile/cropImg.js | 4 +- app/dashboard/page.js | 4 +- app/globals.css | 23 +-- app/login-verify/page.js | 4 +- app/login/page.js | 4 +- app/page.js | 2 +- app/panel/(layout)/layout.js | 4 +- app/panel/(layout)/user-account/page.js | 2 +- components/blog/detail/SocialMedia.js | 4 +- components/booking/Content.js | 43 +++-- components/booking/information/index.js | 4 +- .../clinic/components/about/images/Slider.js | 2 +- components/clinics/head/SearchBar.js | 3 +- components/clinics/index.js | 7 +- components/clinics/list/ItemClinic.js | 4 +- components/contactUs/ContentContact.js | 3 +- components/contactUs/call/Call.js | 6 +- components/contactUs/call/Links.js | 48 +++--- components/contactUs/index.js | 4 +- components/dashboard/Content.js | 50 +++--- components/dashboard/index.js | 2 +- .../userAccount/tabs/transactions/Card.js | 8 +- .../userAccount/tabs/transactions/List.js | 8 +- .../doctor/detailDoctor/cards/AboutDcotor.js | 9 +- .../cards/comments/chart/ProgressAll.js | 4 +- .../cards/comments/chart/index.js | 5 +- components/doctors/index.js | 13 +- components/doctors/modal/Content.js | 23 ++- components/doctors/modal/FilterModal.js | 10 +- components/doctors/search/index.js | 2 +- components/doctors/sortlist/SelectSort.js | 29 ++-- components/home/FrequentSearches.js | 19 +-- components/home/TextHeader.js | 38 ++--- components/home/search/Fields.js | 152 +++++++++--------- components/home/search/index.js | 2 +- components/home/search/modal/index.js | 16 +- components/icons/UserEdit.js | 4 +- components/layout/StLayout.js | 44 +++-- components/layout/footer/index.js | 29 ++-- components/layout/header/Content.js | 70 ++++---- components/layout/header/index.js | 6 +- components/layout/header/list/Row.js | 5 +- components/layout/header/list/col/index.js | 2 +- components/layout/index.js | 9 +- components/layout/sidebar/List.js | 2 +- components/layout/sidebar/ModalLogout.js | 2 +- components/panel/Content.js | 87 +++++----- components/panel/dashboard/list/Table.js | 5 +- components/register/ContentLogin.js | 6 +- components/register/ContentVerify.js | 26 +-- components/register/LayoutRegister.js | 68 ++++---- components/register/LogInPage.js | 31 ++-- components/register/index.js | 6 +- components/searchHead/SmSearch.js | 2 +- components/specialties/index.js | 10 +- .../specialties/list/ItemSpecialties.js | 4 +- context/ProvinceProvider.js | 2 +- data/city.json | 2 +- data/clinics.json | 2 +- data/specialties.json | 2 +- data/state.json | 126 +++++++-------- data/turns.json | 14 +- helper/index.js | 59 ++++--- lib/getStateInfo.js | 16 +- package-lock.json | 17 ++ package.json | 1 + services/api.js | 4 +- 84 files changed, 721 insertions(+), 651 deletions(-) diff --git a/app/about-us/page.js b/app/about-us/page.js index 6250812..12cb522 100644 --- a/app/about-us/page.js +++ b/app/about-us/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; function AboutUs() { return ( - + ); diff --git a/app/blogs/page.js b/app/blogs/page.js index 8afea25..ed9764b 100644 --- a/app/blogs/page.js +++ b/app/blogs/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; function Blogs() { return ( - + ); diff --git a/app/booking/[slug]/page.js b/app/booking/[slug]/page.js index 814ce01..a46998b 100644 --- a/app/booking/[slug]/page.js +++ b/app/booking/[slug]/page.js @@ -4,9 +4,7 @@ import { getStateInfo } from "@/lib/getStateInfo"; function Booking({ params: { slug } }) { const { matchedCity } = getStateInfo(); - return ( - - ); + return ; } export default Booking; diff --git a/app/clinics/page.js b/app/clinics/page.js index 94902b3..588d600 100644 --- a/app/clinics/page.js +++ b/app/clinics/page.js @@ -6,7 +6,7 @@ function Clinics() { const { matchedCity, matchedState } = getStateInfo(); return ( - + ); diff --git a/app/component/AnimationTextHead.js b/app/component/AnimationTextHead.js index d86f897..62216f2 100644 --- a/app/component/AnimationTextHead.js +++ b/app/component/AnimationTextHead.js @@ -2,9 +2,7 @@ function AnimationTextHead({ text, children }) { return (
-

+

{text}

diff --git a/app/component/Logo.js b/app/component/Logo.js index d80c909..d1fac10 100644 --- a/app/component/Logo.js +++ b/app/component/Logo.js @@ -14,7 +14,7 @@ function Logo({ isAbsolute, matchedCity }) { alt="logo" />

- {matchedCity?.site_name || 'نوبت ۷۲۴'} + {matchedCity?.site_name || "نوبت ۷۲۴"}

diff --git a/app/component/Pageguide.js b/app/component/Pageguide.js index c7a4ce5..e75878d 100644 --- a/app/component/Pageguide.js +++ b/app/component/Pageguide.js @@ -5,10 +5,11 @@ function Pageguide({ list }) {
  • idx + 1 - ? "text-[#9B9B9B]" - : "text-[#525252]" - } + ${ + list.length > idx + 1 + ? "text-[#9B9B9B]" + : "text-[#525252]" + } `} > {item} diff --git a/app/component/Pagination.js b/app/component/Pagination.js index cf19340..d99dd39 100644 --- a/app/component/Pagination.js +++ b/app/component/Pagination.js @@ -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 ( @@ -105,7 +105,7 @@ function ItemUser({ data.is_dislike ? data.dislike - 1 : data.dislike + 1, data, "dislike", - "is_dislike" + "is_dislike", ) } > diff --git a/app/component/element/AutoCompleteSelect.js b/app/component/element/AutoCompleteSelect.js index 3630664..20134ab 100644 --- a/app/component/element/AutoCompleteSelect.js +++ b/app/component/element/AutoCompleteSelect.js @@ -11,7 +11,7 @@ function AutoCompleteSelect({ label, disabled = false, listboxProps, - sendAll + sendAll, }) { return ( { - updateData && updateData((newValue && sendAll) ? newValue : (newValue && !sendAll) && newValue.label || "", name); + updateData && + updateData( + newValue && sendAll + ? newValue + : (newValue && !sendAll && newValue.label) || "", + name, + ); }} sx={{ ...styleTextSelectRight, // Hide Icon Number "& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button": - { - display: "none", - }, + { + display: "none", + }, "& input[type=number]": { MozAppearance: "textfield", }, @@ -49,13 +55,13 @@ function AutoCompleteSelect({ border: "1px solid #D7D7D7", }, "& .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": - { - border: "1px solid #5559CE !important", - }, + { + border: "1px solid #5559CE !important", + }, "& .MuiOutlinedInput-notchedOutline": { border: isError ? "1px solid red !important" : "", }, diff --git a/app/component/element/Field.js b/app/component/element/Field.js index 54075a4..0257412 100644 --- a/app/component/element/Field.js +++ b/app/component/element/Field.js @@ -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 ( ( - - )) + .fill({}) + .map((_, idx) => ( + + )) : children; } diff --git a/app/component/modalSearchCity/ButtonFilter.js b/app/component/modalSearchCity/ButtonFilter.js index 4cda88c..537d9ed 100644 --- a/app/component/modalSearchCity/ButtonFilter.js +++ b/app/component/modalSearchCity/ButtonFilter.js @@ -18,10 +18,10 @@ function ButtonFilter({ selected, setOpen }) {

    - {selected.city || 'شهر'} + {selected.city || "شهر"}

    diff --git a/app/component/modalSearchCity/Content.js b/app/component/modalSearchCity/Content.js index 7110d37..4551bdb 100644 --- a/app/component/modalSearchCity/Content.js +++ b/app/component/modalSearchCity/Content.js @@ -23,9 +23,9 @@ function Content({ }; const handleFilter = () => { - handleSearch && handleSearch(''); + handleSearch && handleSearch(""); handleClose(); - } + }; return (
    diff --git a/app/component/modalSearchCity/index.js b/app/component/modalSearchCity/index.js index 31edf2f..0542be1 100644 --- a/app/component/modalSearchCity/index.js +++ b/app/component/modalSearchCity/index.js @@ -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); } diff --git a/app/component/uploadFile/cropImg.js b/app/component/uploadFile/cropImg.js index 7686276..31655de 100644 --- a/app/component/uploadFile/cropImg.js +++ b/app/component/uploadFile/cropImg.js @@ -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"); diff --git a/app/dashboard/page.js b/app/dashboard/page.js index a001ee6..fe89cd2 100644 --- a/app/dashboard/page.js +++ b/app/dashboard/page.js @@ -4,9 +4,7 @@ import { getStateInfo } from "@/lib/getStateInfo"; function UserAccount() { const { matchedCity } = getStateInfo(); - return ( - - ); + return ; } export default UserAccount; diff --git a/app/globals.css b/app/globals.css index 1caaab4..57b70da 100644 --- a/app/globals.css +++ b/app/globals.css @@ -213,11 +213,13 @@ html { } .cover-head-blogs { - 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%); + 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% + ); 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; -} \ No newline at end of file + color: #d7d8ed; +} diff --git a/app/login-verify/page.js b/app/login-verify/page.js index e1a25e1..f8c24cf 100644 --- a/app/login-verify/page.js +++ b/app/login-verify/page.js @@ -1,9 +1,7 @@ import ContentVerify from "@/components/register/ContentVerify"; function LoginVerify() { - return ( - - ); + return ; } export default LoginVerify; diff --git a/app/login/page.js b/app/login/page.js index de07643..fc3470c 100644 --- a/app/login/page.js +++ b/app/login/page.js @@ -1,9 +1,7 @@ import ContentLogin from "@/components/register/ContentLogin"; function LogIn() { - return ( - - ); + return ; } export default LogIn; diff --git a/app/page.js b/app/page.js index ed4c21c..3e22ae8 100644 --- a/app/page.js +++ b/app/page.js @@ -3,7 +3,7 @@ import Layout from "@/components/layout/StLayout"; export default function Home() { return ( - + ); diff --git a/app/panel/(layout)/layout.js b/app/panel/(layout)/layout.js index 28ccc5a..09f05e5 100644 --- a/app/panel/(layout)/layout.js +++ b/app/panel/(layout)/layout.js @@ -1,9 +1,7 @@ import Content from "@/components/panel/Content"; function LayoutPanel({ children }) { - return ( - - ); + return ; } export default LayoutPanel; diff --git a/app/panel/(layout)/user-account/page.js b/app/panel/(layout)/user-account/page.js index b4582b0..56c3b25 100644 --- a/app/panel/(layout)/user-account/page.js +++ b/app/panel/(layout)/user-account/page.js @@ -3,7 +3,7 @@ import Information from "@/data/information.json"; import Bank from "@/data/bank.json"; function UserAccount() { - return ; + return ; } export default UserAccount; diff --git a/components/blog/detail/SocialMedia.js b/components/blog/detail/SocialMedia.js index f45c231..7271ec3 100644 --- a/components/blog/detail/SocialMedia.js +++ b/components/blog/detail/SocialMedia.js @@ -10,9 +10,7 @@ function SocialMedia({ loading }) {
      {socials.map((item, idx) => ( -
    • +
    • {item}
    • diff --git a/components/booking/Content.js b/components/booking/Content.js index eb61109..a1da09f 100644 --- a/components/booking/Content.js +++ b/components/booking/Content.js @@ -1,32 +1,25 @@ import Information from "./information"; import Location from "./location"; -function Content({ - doctor, - step, - setStep, - children, - isFirst, - disableSide, -}) { - return ( -
      - {isFirst ? ( - - ) : ( - - )} - {children} -
      - ); + > + {isFirst ? ( + + ) : ( + + )} + {children} +
    + ); } export default Content; diff --git a/components/booking/information/index.js b/components/booking/information/index.js index 5d01fe0..5eb5a2e 100644 --- a/components/booking/information/index.js +++ b/components/booking/information/index.js @@ -19,7 +19,9 @@ function Information({ doctor, step, setStep, typePay, isPay, disableSide }) { } `} > -

    جزئیات نوبت

    +

    + جزئیات نوبت +

    diff --git a/components/clinic/components/about/images/Slider.js b/components/clinic/components/about/images/Slider.js index 3ee9911..d41153f 100644 --- a/components/clinic/components/about/images/Slider.js +++ b/components/clinic/components/about/images/Slider.js @@ -16,7 +16,7 @@ function Slider({ data, loading }) { className="min-w-[90px] min-h-[90px] object-cover rounded-[8px] overflow-hidden" /> - ) : undefined + ) : undefined, )} ); diff --git a/components/clinics/head/SearchBar.js b/components/clinics/head/SearchBar.js index 609dac9..7063f2d 100644 --- a/components/clinics/head/SearchBar.js +++ b/components/clinics/head/SearchBar.js @@ -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 }) { handleSearch(e.target.value)} + onChange={(e) => handleSearch(e.target.value)} InputProps={{ disableUnderline: true, }} diff --git a/components/clinics/index.js b/components/clinics/index.js index c699a07..498c7a9 100644 --- a/components/clinics/index.js +++ b/components/clinics/index.js @@ -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); }; diff --git a/components/clinics/list/ItemClinic.js b/components/clinics/list/ItemClinic.js index d34618e..410875d 100644 --- a/components/clinics/list/ItemClinic.js +++ b/components/clinics/list/ItemClinic.js @@ -16,7 +16,9 @@ function ItemClinic({ data, loading }) {
    -

    {data.title}

    +

    + {data.title} +

    diff --git a/components/contactUs/ContentContact.js b/components/contactUs/ContentContact.js index bf67661..fc1c8ce 100644 --- a/components/contactUs/ContentContact.js +++ b/components/contactUs/ContentContact.js @@ -10,7 +10,8 @@ function ContentContact({ text, children, url, label }) { {children}

    - {label}{text} + {label} + {text}

  • ); diff --git a/components/contactUs/call/Call.js b/components/contactUs/call/Call.js index 8ca0819..fa5c287 100644 --- a/components/contactUs/call/Call.js +++ b/components/contactUs/call/Call.js @@ -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"}`} >

    تماس با ما

    -

    {matchedCity.footerDescription}

    +

    + {matchedCity.footerDescription} +

    ); diff --git a/components/contactUs/call/Links.js b/components/contactUs/call/Links.js index 04a5824..b4bf9f6 100644 --- a/components/contactUs/call/Links.js +++ b/components/contactUs/call/Links.js @@ -6,27 +6,31 @@ import WhatsappC from "../../icons/WhatsappC"; import ContentContact from "../ContentContact"; function Links({ matchedCity }) { - return ( -
      - - - - - - - - - -
    - ) + return ( +
      + + + + + + + + + +
    + ); } -export default Links \ No newline at end of file +export default Links; diff --git a/components/contactUs/index.js b/components/contactUs/index.js index 73456b6..f24d6ad 100644 --- a/components/contactUs/index.js +++ b/components/contactUs/index.js @@ -9,9 +9,7 @@ function ContactUsPage() { return (
    - {matchedCity?.id === "63" && ( - - )} + {matchedCity?.id === "63" && }
    ); } diff --git a/components/dashboard/Content.js b/components/dashboard/Content.js index 65c1377..d9ee861 100644 --- a/components/dashboard/Content.js +++ b/components/dashboard/Content.js @@ -7,32 +7,32 @@ import DashboardPage from "@/components/dashboard"; import UserAccountPage from "@/components/dashboard/userAccount/UserAccount"; function Content({ matchedCity }) { - const [value, setValue] = useState(0); - const [isOpenSide, setIsOpenSide] = useState(false); - const [isTurnsDetails, setIsTurnsDetails] = useState(false); + const [value, setValue] = useState(0); + const [isOpenSide, setIsOpenSide] = useState(false); + const [isTurnsDetails, setIsTurnsDetails] = useState(false); - return ( - - - - ); + return ( + + + + ); } export default Content; diff --git a/components/dashboard/index.js b/components/dashboard/index.js index 34603b3..b7a1aea 100644 --- a/components/dashboard/index.js +++ b/components/dashboard/index.js @@ -9,7 +9,7 @@ function DashboardPage({ setValue, isOpenSide, setIsOpenSide, - matchedCity + matchedCity, }) { return ( diff --git a/components/dashboard/userAccount/tabs/transactions/List.js b/components/dashboard/userAccount/tabs/transactions/List.js index dc3596f..cb2dc2c 100644 --- a/components/dashboard/userAccount/tabs/transactions/List.js +++ b/components/dashboard/userAccount/tabs/transactions/List.js @@ -92,8 +92,8 @@ function List({ user, loading }) { row.status === "success" ? "bg-[#E8FADD] text-[#75E22E]" : row.status === "pending" - ? "bg-[#FFF3DD] text-[#FDBA35]" - : "bg-[#FFE3E2] text-[#FF5450]" + ? "bg-[#FFF3DD] text-[#FDBA35]" + : "bg-[#FFE3E2] text-[#FF5450]" } `} variant="text" @@ -101,8 +101,8 @@ function List({ user, loading }) { {row.status === "success" ? "پرداخت شده" : row.status === "pending" - ? "در انتظار" - : "پرداخت نشده"} + ? "در انتظار" + : "پرداخت نشده"} diff --git a/components/doctor/detailDoctor/cards/AboutDcotor.js b/components/doctor/detailDoctor/cards/AboutDcotor.js index 2973a9d..942177f 100644 --- a/components/doctor/detailDoctor/cards/AboutDcotor.js +++ b/components/doctor/detailDoctor/cards/AboutDcotor.js @@ -21,10 +21,11 @@ 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 - ? "after:bg-transparent max-h-screen" - : "after:bg-[linear-gradient(transparent,#FAFAFA)] max-h-[200px]" - } + ${ + isMore + ? "after:bg-transparent max-h-screen" + : "after:bg-[linear-gradient(transparent,#FAFAFA)] max-h-[200px]" + } `} > {doctor.detail} diff --git a/components/doctor/detailDoctor/cards/comments/chart/ProgressAll.js b/components/doctor/detailDoctor/cards/comments/chart/ProgressAll.js index 1a5e560..75c8c4f 100644 --- a/components/doctor/detailDoctor/cards/comments/chart/ProgressAll.js +++ b/components/doctor/detailDoctor/cards/comments/chart/ProgressAll.js @@ -27,7 +27,9 @@ function ProgressAll({ doctor, loading }) {
    رضایت کاربران

    -

    {numberToArStyle(doctor.total_user_satisfaction)}%

    +

    + {numberToArStyle(doctor.total_user_satisfaction)}% +

    diff --git a/components/doctor/detailDoctor/cards/comments/chart/index.js b/components/doctor/detailDoctor/cards/comments/chart/index.js index b31a7c3..601bd7a 100644 --- a/components/doctor/detailDoctor/cards/comments/chart/index.js +++ b/components/doctor/detailDoctor/cards/comments/chart/index.js @@ -54,8 +54,9 @@ function Chart({ doctor, loading }) {
      {doctor.progress_detail.map((item, idx) => ( diff --git a/components/doctors/index.js b/components/doctors/index.js index b9b278e..92bb153 100644 --- a/components/doctors/index.js +++ b/components/doctors/index.js @@ -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 || "متخصص", }); diff --git a/components/doctors/modal/Content.js b/components/doctors/modal/Content.js index 3884c84..ecbdfcf 100644 --- a/components/doctors/modal/Content.js +++ b/components/doctors/modal/Content.js @@ -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') - }; + current.delete("specialties"); + } const queryString = current.toString(); - router.push(`/doctors?${queryString}`) - } + router.push(`/doctors?${queryString}`); + }; const changeData = (value, name, removeSpecialties) => { changeUrl(value, name, removeSpecialties); const newData = data; newData[name] = value; if (removeSpecialties) { - newData.specialties = '' - }; + newData.specialties = ""; + } setData(newData); - } + }; return (
      @@ -59,7 +58,7 @@ function Content({ data, setData }) { value={data.gender} text="جنسیت پزشک" group={group1} - name='gender' + name="gender" />
      @@ -76,7 +75,7 @@ function Content({ data, setData }) { { - 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" diff --git a/components/doctors/modal/FilterModal.js b/components/doctors/modal/FilterModal.js index 5341eb4..60717ee 100644 --- a/components/doctors/modal/FilterModal.js +++ b/components/doctors/modal/FilterModal.js @@ -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 ( <> diff --git a/components/doctors/search/index.js b/components/doctors/search/index.js index 9302732..d42d9df 100644 --- a/components/doctors/search/index.js +++ b/components/doctors/search/index.js @@ -31,7 +31,7 @@ function SearchBar({ data, setData, params }) { {value ? (
        - {Array(sort).fill({}).map((_, idx) => ( -
      • - -
      • - ))} + {Array(sort) + .fill({}) + .map((_, idx) => ( +
      • + +
      • + ))}
      - ) : "مرتب سازی"} + ) : ( + "مرتب سازی" + )}
      ); }} @@ -60,10 +64,15 @@ function SelectSort() { name={item.label} className="!flex !flex-col !items-start !w-full hover:!bg-transparent" > -
      - {Array(item.label).fill({}).map((_, idx) => ( - - ))} +
      + {Array(item.label) + .fill({}) + .map((_, idx) => ( + + ))}
      ))} diff --git a/components/home/FrequentSearches.js b/components/home/FrequentSearches.js index ef5087e..5dc975c 100644 --- a/components/home/FrequentSearches.js +++ b/components/home/FrequentSearches.js @@ -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 (

      @@ -17,13 +16,15 @@ function FrequentSearches() {

        {childrenList.map((item, idx) => ( - +
      + ); } -export default TextHeader \ No newline at end of file +export default TextHeader; diff --git a/components/home/search/Fields.js b/components/home/search/Fields.js index 0ff24ac..ac7fdee 100644 --- a/components/home/search/Fields.js +++ b/components/home/search/Fields.js @@ -1,4 +1,4 @@ -"use client" +"use client"; import { useState } from "react"; @@ -10,86 +10,86 @@ import Link from "next/link"; import SearchD from "@/components/icons/SearchD"; function Fields({ city, state }) { - const [open, setOpen] = useState(false); - const [data, setData] = useState({ - province: state?.name || '', - city: city?.name || '', - }); + const [open, setOpen] = useState(false); + const [data, setData] = useState({ + province: state?.name || "", + city: city?.name || "", + }); - return ( - <> - - - - - setData({ ...data, search: e.target.value })} - InputProps={{ - disableUnderline: true, - }} - sx={{ - display: "flex", - flexDirection: "column", - justifyContent: "center", - "& .MuiInput-root": { - padding: "0", - borderBottom: "none", - }, - "& .MuiInputBase-input": { - color: "#6C757D", - }, - "& .MuiInputBase-input": { - color: "#6C757D", - fontSize: { - xs: "10px !important", - sm: "12px !important", - md: "14px !important", - lg: "16px !important", - }, - } - }} - placeholder="جستجوی نام پزشک، تخصص، بیماری ..." - dir="rtl" - className={`!shadow-none !w-full lg:!w-[524px] bg-[#FAFAFA] !text-[14px] md:!text-[16px] !rounded-0 !font-normal !text-[#6C757D]`} - /> - - - + - - - ) + > +
      + +
      + + + + ); } -export default Fields \ No newline at end of file +export default Fields; diff --git a/components/home/search/index.js b/components/home/search/index.js index 0bc36d6..72cbc90 100644 --- a/components/home/search/index.js +++ b/components/home/search/index.js @@ -3,7 +3,7 @@ import Fields from "./Fields"; import { getStateInfo } from "@/lib/getStateInfo"; function SearchBar() { - const { matchedCity, matchedState } = getStateInfo() + const { matchedCity, matchedState } = getStateInfo(); return ( { // 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 { diff --git a/components/icons/UserEdit.js b/components/icons/UserEdit.js index 841fc7d..7bb4638 100644 --- a/components/icons/UserEdit.js +++ b/components/icons/UserEdit.js @@ -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" : ""} /> -
      -
      -
      -
      -
      -
      -
      - {children} -
      -
      -
      -
      -
      -
      -
      -
      -
      + return ( +
      +
      +
      +
      +
      +
      +
      +
      + {children} +
      +
      +
      +
      +
      +
      +
      - ); +
      +
      + ); } export default StLayout; diff --git a/components/layout/footer/index.js b/components/layout/footer/index.js index debe31e..612415e 100644 --- a/components/layout/footer/index.js +++ b/components/layout/footer/index.js @@ -24,16 +24,20 @@ const head = [ ]; function Footer({ matchedCity }) { - const socialMedias = [{ - icon: , - name: 'instagram' - }, { - icon: , - name: 'telegram' - }, { - icon: , - name: 'whatsapp' - }]; + const socialMedias = [ + { + icon: , + name: "instagram", + }, + { + icon: , + name: "telegram", + }, + { + icon: , + 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" > - + {item.icon} diff --git a/components/layout/header/Content.js b/components/layout/header/Content.js index 6a968c3..c951ac2 100644 --- a/components/layout/header/Content.js +++ b/components/layout/header/Content.js @@ -11,48 +11,44 @@ import UserLogin from "@/components/icons/UserLogin"; import { useState } from "react"; function Content({ matchedCity, name }) { - const [isActive, setIsActive] = useState(false); + const [isActive, setIsActive] = useState(false); - return ( -
      -
      - - -
      - -
      - - -
      -
      -
      - - - - - + > +
      + + +
      + +
      + + +
      - ) +
      + + + + + +
      + ); } -export default Content \ No newline at end of file +export default Content; diff --git a/components/layout/header/index.js b/components/layout/header/index.js index 3ac434c..64b7907 100644 --- a/components/layout/header/index.js +++ b/components/layout/header/index.js @@ -1,13 +1,9 @@ import Content from "./Content"; function Header({ matchedCity, name }) { - return (
      - +
      ); } diff --git a/components/layout/header/list/Row.js b/components/layout/header/list/Row.js index 206d92a..771b0db 100644 --- a/components/layout/header/list/Row.js +++ b/components/layout/header/list/Row.js @@ -9,10 +9,7 @@ function Row({ name }) { diff --git a/components/layout/header/list/col/index.js b/components/layout/header/list/col/index.js index 430e42c..3ae2736 100644 --- a/components/layout/header/list/col/index.js +++ b/components/layout/header/list/col/index.js @@ -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]" diff --git a/components/layout/index.js b/components/layout/index.js index 6e9fb29..dedbcb9 100644 --- a/components/layout/index.js +++ b/components/layout/index.js @@ -14,7 +14,7 @@ function Layout({ user, value, setValue, - matchedCity + matchedCity, }) { return (
      @@ -30,9 +30,10 @@ function Layout({
      {isSidebar && ( diff --git a/components/layout/sidebar/List.js b/components/layout/sidebar/List.js index fa06934..56738b4 100644 --- a/components/layout/sidebar/List.js +++ b/components/layout/sidebar/List.js @@ -1,4 +1,4 @@ -"use client" +"use client"; import CardD from "@/components/icons/CardD"; import LogoutD from "@/components/icons/LogoutD"; diff --git a/components/layout/sidebar/ModalLogout.js b/components/layout/sidebar/ModalLogout.js index f4212ed..72831be 100644 --- a/components/layout/sidebar/ModalLogout.js +++ b/components/layout/sidebar/ModalLogout.js @@ -6,7 +6,7 @@ import { removeToken } from "@/utils"; function ModalLogout({ open, handleClose }) { const logout = () => { removeToken(); - window.location.pathname = '/login' + window.location.pathname = "/login"; handleClose(); }; diff --git a/components/panel/Content.js b/components/panel/Content.js index 857f697..5b785b9 100644 --- a/components/panel/Content.js +++ b/components/panel/Content.js @@ -9,53 +9,54 @@ import { usePathname } from "next/navigation"; import BgGray from "@/components/layoutPanel/sidebar/BgGray"; function Content({ children }) { - const pathname = usePathname(); - const [active, setActive] = useState(false); - const [open, setOpen] = useState(true); - const [loading, setLoading] = useState(true); + const pathname = usePathname(); + const [active, setActive] = useState(false); + const [open, setOpen] = useState(true); + const [loading, setLoading] = useState(true); - useEffect(() => { - setTimeout(() => { - setLoading(false); - }, 2000); - }, []); + useEffect(() => { + setTimeout(() => { + setLoading(false); + }, 2000); + }, []); - return ( -
      - - -
      + + +
      -
      -
      - {children} -
      -
      - {pathname.includes("dashboard") && ( - - )} -
      - ); + > +
      +
      + {children} +
      + + {pathname.includes("dashboard") && ( + + )} +
      + ); } export default Content; diff --git a/components/panel/dashboard/list/Table.js b/components/panel/dashboard/list/Table.js index 2446c38..34e5582 100644 --- a/components/panel/dashboard/list/Table.js +++ b/components/panel/dashboard/list/Table.js @@ -16,7 +16,10 @@ function Table({ data, loading }) { centerTable={centerTable} > {data.list_of_doctors_appointments.map((row, idx) => ( - + - ); + return ; } export default ContentLogin; diff --git a/components/register/ContentVerify.js b/components/register/ContentVerify.js index d89fb87..98ff167 100644 --- a/components/register/ContentVerify.js +++ b/components/register/ContentVerify.js @@ -6,20 +6,20 @@ import LogInPage from "@/components/register/LogInPage"; import { useState } from "react"; function ContentVerify() { - const [isSendMsg, setIsSendMsg] = useState(false); + const [isSendMsg, setIsSendMsg] = useState(false); - return ( - - {isSendMsg ? ( - - ) : ( - - )} - - ); + return ( + + {isSendMsg ? ( + + ) : ( + + )} + + ); } export default ContentVerify; diff --git a/components/register/LayoutRegister.js b/components/register/LayoutRegister.js index 96bd584..903dbdc 100644 --- a/components/register/LayoutRegister.js +++ b/components/register/LayoutRegister.js @@ -4,41 +4,43 @@ import Link from "next/link"; const about = ["سوالات متداول", "تماس با ما", "درباره ما"]; function LayoutRegister({ children, matchedCity }) { - return ( -
      - -
      - logo -

      {matchedCity?.site_name || "نوبت ۷۲۴"}

      -
      - - {children} -
      -
      -
      - {about.map((item, idx) => ( - -

      - {item} -

      - - ))} -
      -
      + > + +
      + logo +

      + {matchedCity?.site_name || "نوبت ۷۲۴"} +

      - ) + + {children} +
      +
      +
      + {about.map((item, idx) => ( + +

      + {item} +

      + + ))} +
      +
      +
      + ); } -export default LayoutRegister \ No newline at end of file +export default LayoutRegister; diff --git a/components/register/LogInPage.js b/components/register/LogInPage.js index 7d4c212..caee821 100644 --- a/components/register/LogInPage.js +++ b/components/register/LogInPage.js @@ -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: ( 09, + > + 09 + + ), }} title="شماره همراه" updateState={handleChange} /> -

      {error.text}

      + ${error.valid ? "opacity-0 -translate-y-1" : "opacity-100 translate-y-0"} + `} + > + {error.text} +

      ); diff --git a/components/register/index.js b/components/register/index.js index bf10451..163f395 100644 --- a/components/register/index.js +++ b/components/register/index.js @@ -13,7 +13,11 @@ function RegisterPage({ matchedCity }) { {isSendMsg ? ( ) : ( - + )} ); diff --git a/components/searchHead/SmSearch.js b/components/searchHead/SmSearch.js index 8c274c2..0679bf1 100644 --- a/components/searchHead/SmSearch.js +++ b/components/searchHead/SmSearch.js @@ -11,7 +11,7 @@ function SmSearch({ placeholder, handleSearch }) { > handleSearch(e.target.value)} + onChange={(e) => handleSearch(e.target.value)} InputProps={{ disableUnderline: true, }} diff --git a/components/specialties/index.js b/components/specialties/index.js index f2bc66e..a5dfd04 100644 --- a/components/specialties/index.js +++ b/components/specialties/index.js @@ -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 (
      @@ -19,10 +20,7 @@ function SpecialtiesPage() { title="تخصص مورد نظر شما چیست؟" detail="تخصص مورد نظرتان را جستجو کرده و یا از لیست زیر انتخاب نمایید:" > - +
      diff --git a/components/specialties/list/ItemSpecialties.js b/components/specialties/list/ItemSpecialties.js index a1f377d..c7b60ef 100644 --- a/components/specialties/list/ItemSpecialties.js +++ b/components/specialties/list/ItemSpecialties.js @@ -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" > -

      {data.name}

      +

      + {data.name} +

      {data.number_of_doctors} پزشک

      diff --git a/context/ProvinceProvider.js b/context/ProvinceProvider.js index 7b5636e..3153ce8 100644 --- a/context/ProvinceProvider.js +++ b/context/ProvinceProvider.js @@ -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(() => { diff --git a/data/city.json b/data/city.json index e176a7e..419baa1 100644 --- a/data/city.json +++ b/data/city.json @@ -671,4 +671,4 @@ "footerDescription": "نوبت 724، سامانه جامع نوبت‌دهی پزشکی برای تمامی شهرها. رزرو نوبت از پزشکان و مراکز درمانی معتبر بدون نیاز به مراجعه حضوری.", "footerDisclaimer": "تمامی حقوق این سایت متعلق به نوبت 724 می‌باشد." } -] \ No newline at end of file +] diff --git a/data/clinics.json b/data/clinics.json index 63b21f8..bd34842 100644 --- a/data/clinics.json +++ b/data/clinics.json @@ -65,4 +65,4 @@ "location": "اهواز، کیان آباد، خیابان ۱۶ غربی، پلاک ۱۰", "hours_of_work": "شنبه تا سه شنبه ساعت ۱۶ تا ۲۲" } -] \ No newline at end of file +] diff --git a/data/specialties.json b/data/specialties.json index 86bebd7..6720455 100644 --- a/data/specialties.json +++ b/data/specialties.json @@ -344,4 +344,4 @@ "name": "سکته مغزی", "parent": null } -] \ No newline at end of file +] diff --git a/data/state.json b/data/state.json index 1c4db31..3200021 100644 --- a/data/state.json +++ b/data/state.json @@ -1,126 +1,126 @@ [ { - "id": "1", - "name": "آذربایجان شرقی" + "id": "1", + "name": "آذربایجان شرقی" }, { - "id": "2", - "name": "آذربایجان غربی" + "id": "2", + "name": "آذربایجان غربی" }, { - "id": "3", - "name": "اردبیل" + "id": "3", + "name": "اردبیل" }, { - "id": "4", - "name": "اصفهان" + "id": "4", + "name": "اصفهان" }, { - "id": "5", - "name": "البرز" + "id": "5", + "name": "البرز" }, { - "id": "6", - "name": "ایلام" + "id": "6", + "name": "ایلام" }, { - "id": "7", - "name": "بوشهر" + "id": "7", + "name": "بوشهر" }, { - "id": "8", - "name": "تهران" + "id": "8", + "name": "تهران" }, { - "id": "9", - "name": "چهارمحال و بختیاری" + "id": "9", + "name": "چهارمحال و بختیاری" }, { - "id": "10", - "name": "خراسان جنوبی" + "id": "10", + "name": "خراسان جنوبی" }, { - "id": "11", - "name": "خراسان رضوی" + "id": "11", + "name": "خراسان رضوی" }, { - "id": "12", - "name": "خراسان شمالی" + "id": "12", + "name": "خراسان شمالی" }, { - "id": "13", - "name": "خوزستان" + "id": "13", + "name": "خوزستان" }, { - "id": "14", - "name": "زنجان" + "id": "14", + "name": "زنجان" }, { - "id": "15", - "name": "سمنان" + "id": "15", + "name": "سمنان" }, { - "id": "16", - "name": "سیستان و بلوچستان" + "id": "16", + "name": "سیستان و بلوچستان" }, { - "id": "17", - "name": "فارس" + "id": "17", + "name": "فارس" }, { - "id": "18", - "name": "قزوین" + "id": "18", + "name": "قزوین" }, { - "id": "19", - "name": "قم" + "id": "19", + "name": "قم" }, { - "id": "20", - "name": "کردستان" + "id": "20", + "name": "کردستان" }, { - "id": "21", - "name": "کرمان" + "id": "21", + "name": "کرمان" }, { - "id": "22", - "name": "کرمانشاه" + "id": "22", + "name": "کرمانشاه" }, { - "id": "23", - "name": "کهگیلویه و بویراحمد" + "id": "23", + "name": "کهگیلویه و بویراحمد" }, { - "id": "24", - "name": "گلستان" + "id": "24", + "name": "گلستان" }, { - "id": "25", - "name": "گیلان" + "id": "25", + "name": "گیلان" }, { - "id": "26", - "name": "لرستان" + "id": "26", + "name": "لرستان" }, { - "id": "27", - "name": "مازندران" + "id": "27", + "name": "مازندران" }, { - "id": "28", - "name": "مرکزی" + "id": "28", + "name": "مرکزی" }, { - "id": "29", - "name": "هرمزگان" + "id": "29", + "name": "هرمزگان" }, { - "id": "30", - "name": "همدان" + "id": "30", + "name": "همدان" }, { - "id": "31", - "name": "یزد" + "id": "31", + "name": "یزد" } -] \ No newline at end of file +] diff --git a/data/turns.json b/data/turns.json index 6e33909..db21cb7 100644 --- a/data/turns.json +++ b/data/turns.json @@ -1,8 +1,8 @@ [ - { - "id": 1, - "location": "اهواز، کیانپارس، پهلوان شرقی، مجتمع پزشکی آویسا، واحد ۱۲", - "hours_of_work": "شنبه تا سه شنبه ساعت 16 تا 22", - "first_free_turn": "یکشنبه 24 اردیبهشت" - } -] \ No newline at end of file + { + "id": 1, + "location": "اهواز، کیانپارس، پهلوان شرقی، مجتمع پزشکی آویسا، واحد ۱۲", + "hours_of_work": "شنبه تا سه شنبه ساعت 16 تا 22", + "first_free_turn": "یکشنبه 24 اردیبهشت" + } +] diff --git a/helper/index.js b/helper/index.js index 0fea6fe..8048526 100644 --- a/helper/index.js +++ b/helper/index.js @@ -92,41 +92,40 @@ export const alert = (type, text, prop) => {

      {text}

      , - { 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 - } -} \ No newline at end of file + childrenList: filteredChildrenList, + }; +}; diff --git a/lib/getStateInfo.js b/lib/getStateInfo.js index 6245119..5904410 100644 --- a/lib/getStateInfo.js +++ b/lib/getStateInfo.js @@ -5,12 +5,16 @@ import citiesData from "@/data/city.json"; import statesData from "@/data/state.json"; export function getStateInfo() { - const headersList = headers(); - const host = headersList.get("host") || ""; - const subdomain = host.split(".")[0]; + const headersList = headers(); + 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 }; + return { matchedCity, matchedState }; } diff --git a/package-lock.json b/package-lock.json index 471dbbb..6c26791 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 34f25c4..1ff5161 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "devDependencies": { "cross-env": "^7.0.3", "postcss": "^8", + "prettier": "^3.5.3", "tailwindcss": "^3.4.1" } } diff --git a/services/api.js b/services/api.js index 46d6b0f..2682e3e 100644 --- a/services/api.js +++ b/services/api.js @@ -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;