chore: update dependencies in package.json

- Bumped versions for several packages including:
  - @emotion/styled from ^11.14.0 to ^11.14.1
  - @maptiler/sdk from ^2.4.0 to ^2.5.1
  - @mui/icons-material from ^7.1.0 to ^7.3.6
  - @mui/material from ^7.1.0 to ^7.3.6
  - @mui/styled-engine-sc from ^6.0.0-alpha.18 to ^6.4.9
  - @mui/x-charts from ^7.16.0 to ^7.29.1
  - @mui/x-date-pickers from ^7.17.0 to ^7.29.4
  - @next/third-parties from ^15.1.0 to ^15.5.7
  - axios from ^1.7.7 to ^1.13.2
  - dayjs from ^1.11.13 to ^1.11.19
  - jspdf from ^3.0.1 to ^3.0.4
  - next from ^14.2.20 to ^15.5.7
  - next-themes from ^0.3.0 to ^0.4.6
  - npm from ^10.8.2 to ^10.9.4
  - react from ^18.0.0 to ^18.3.1
  - react-dom from ^18 to ^18.3.1
  - react-easy-crop from ^5.1.0 to ^5.5.6
  - react-toastify from ^10.0.6 to ^11.0.5
  - sharp from ^0.34.1 to ^0.34.5
  - styled-components from ^6.1.11 to ^6.1.19
  - stylis from ^4.3.4 to ^4.3.6
  - swiper from ^11.1.9 to ^11.2.10
  - postcss from ^8 to ^8.5.6
  - prettier from ^3.5.3 to ^3.7.4
  - tailwindcss from ^3.4.1 to ^3.4.18
This commit is contained in:
hamed
2025-12-04 05:26:37 +03:30
parent 3ca69dcd0f
commit 40df2db108
19 changed files with 816 additions and 1420 deletions
+6 -5
View File
@@ -5,15 +5,16 @@ import { getStateInfo } from "@/lib/getStateInfo";
import { buildClinicParams } from "@/helper"; import { buildClinicParams } from "@/helper";
export default async function Clinics({ searchParams }) { export default async function Clinics({ searchParams }) {
const { matchedCity, matchedState } = getStateInfo(); const awaitedSearchParams = await searchParams;
const { matchedCity, matchedState } = await getStateInfo();
const API_URL = process.env.NEXT_PUBLIC_API_URL; const API_URL = process.env.NEXT_PUBLIC_API_URL;
const stateParams = searchParams.state; const stateParams = awaitedSearchParams.state;
const cityParams = searchParams.city; const cityParams = awaitedSearchParams.city;
let clinics; let clinics;
try { try {
// Params // Params
let newSearchParams = searchParams; let newSearchParams = awaitedSearchParams;
// Conditional State // Conditional State
if (stateParams) newSearchParams.state = stateParams; if (stateParams) newSearchParams.state = stateParams;
@@ -30,7 +31,7 @@ export default async function Clinics({ searchParams }) {
clinics = await fetchReq(`${API_URL}/api/v1/clinics`, { clinics = await fetchReq(`${API_URL}/api/v1/clinics`, {
params, params,
}); });
} catch (err) {} } catch (err) { }
return ( return (
<Layout name="/clinics"> <Layout name="/clinics">
+5 -6
View File
@@ -31,7 +31,7 @@ function ItemDoctor({ doctor, loading, setDoctors }) {
width={72} width={72}
height={72} height={72}
alt="image-doctor" alt="image-doctor"
src={doctor?.img && doctor?.img[0]?.url} src={doctor?.img?.[0]?.url || "/assets/images/user.png"}
className="object-contain rounded-full w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]" className="object-contain rounded-full w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]"
/> />
</CircularLoading> </CircularLoading>
@@ -83,11 +83,10 @@ function ItemDoctor({ doctor, loading, setDoctors }) {
<CustomLoading loading={loading} width={150} height={20}> <CustomLoading loading={loading} width={150} height={20}>
<p <p
className={`text-[12px] font-medium rounded w-fit p-1.5 ml-[52px] className={`text-[12px] font-medium rounded w-fit p-1.5 ml-[52px]
${ ${Number(doctor?.active)
Number(doctor?.active) ? "bg-[rgba(5,_186,_88,_0.04)] text-[#05BA58]"
? "bg-[rgba(5,_186,_88,_0.04)] text-[#05BA58]" : "bg-[rgba(211,_47,_47,_0.04)] text-[#D32F2F]"
: "bg-[rgba(211,_47,_47,_0.04)] text-[#D32F2F]" }`}
}`}
> >
{doctor?.free_turn} {doctor?.free_turn}
</p> </p>
+4 -3
View File
@@ -7,11 +7,12 @@ import { cookies } from "next/headers";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
export default async function Dashboard({ searchParams }) { export default async function Dashboard({ searchParams }) {
const { matchedCity } = getStateInfo(); const awaitedSearchParams = await searchParams;
const { matchedCity } = await getStateInfo();
const user = await getUser(); const user = await getUser();
const ability = defineAbilitiesFor(user); const ability = defineAbilitiesFor(user);
const cookieStore = cookies(); const cookieStore = await cookies();
const token = cookieStore.get("access_token"); const token = cookieStore.get("access_token");
if (!ability.can("access", "Dashboard")) { if (!ability.can("access", "Dashboard")) {
@@ -22,7 +23,7 @@ export default async function Dashboard({ searchParams }) {
return ( return (
<Content <Content
logged={token.value} logged={token.value}
params={searchParams} params={awaitedSearchParams}
matchedCity={matchedCity} matchedCity={matchedCity}
/> />
); );
+5 -4
View File
@@ -5,15 +5,16 @@ import { getStateInfo } from "@/lib/getStateInfo";
import axios from "axios"; import axios from "axios";
async function Doctors({ searchParams }) { async function Doctors({ searchParams }) {
const { matchedCity, matchedState } = getStateInfo(); const awaitedSearchParams = await searchParams;
const { matchedCity, matchedState } = await getStateInfo();
const API_URL = process.env.NEXT_PUBLIC_API_URL; const API_URL = process.env.NEXT_PUBLIC_API_URL;
let doctors = null; let doctors = null;
const stateParams = searchParams.state; const stateParams = awaitedSearchParams.state;
const cityParams = searchParams.city; const cityParams = awaitedSearchParams.city;
try { try {
let newSearchParams = searchParams; let newSearchParams = awaitedSearchParams;
// Conditional State // Conditional State
if (stateParams) newSearchParams.state = stateParams; if (stateParams) newSearchParams.state = stateParams;
+2 -2
View File
@@ -11,9 +11,9 @@ import { getStateInfo } from "@/lib/getStateInfo";
import { getCanonicalUrl } from "@/lib/getCanonicalUrl"; import { getCanonicalUrl } from "@/lib/getCanonicalUrl";
export async function generateMetadata() { export async function generateMetadata() {
const { matchedCity } = getStateInfo(); const { matchedCity } = await getStateInfo();
const canonicalUrl = getCanonicalUrl(); const canonicalUrl = await getCanonicalUrl();
const baseMetadata = { const baseMetadata = {
title: matchedCity ? matchedCity.title : "نوبت724", title: matchedCity ? matchedCity.title : "نوبت724",
+1 -1
View File
@@ -17,7 +17,7 @@ async function LayoutPanel({ children }) {
const API_URL = process.env.NEXT_PUBLIC_API_URL; const API_URL = process.env.NEXT_PUBLIC_API_URL;
try { try {
const cookieStore = cookies(); const cookieStore = await cookies();
const userInfo = cookieStore.get("userInfo"); const userInfo = cookieStore.get("userInfo");
const accessToken = cookieStore.get("access_token"); const accessToken = cookieStore.get("access_token");
@@ -56,9 +56,8 @@ function ListBime({ data }) {
<ul <ul
ref={list} ref={list}
className={`flex mt-[8px] items-center justify-start xl:justify-center gap-[8px] sm:gap-[13px] md:gap-[19px] lg:gap-[24px] ${ className={`flex mt-[8px] items-center justify-start xl:justify-center gap-[8px] sm:gap-[13px] md:gap-[19px] lg:gap-[24px] ${showArrows ? "overflow-x-auto hidden-scroll" : "overflow-visible"
showArrows ? "overflow-x-auto hidden-scroll" : "overflow-visible" }`}
}`}
> >
{data?.list_bime?.map((item, idx) => ( {data?.list_bime?.map((item, idx) => (
<CustomLoading key={idx} width={itemWidth} height={110}> <CustomLoading key={idx} width={itemWidth} height={110}>
@@ -67,7 +66,7 @@ function ListBime({ data }) {
style={{ minWidth: itemWidth }} style={{ minWidth: itemWidth }}
> >
<Image <Image
src={item.logo?.[0]?.url || ""} src={item.logo?.[0]?.url || "/assets/images/logo.png"}
height={92} height={92}
width={92} width={92}
alt="bime" alt="bime"
@@ -21,7 +21,7 @@ function Images({ data }) {
<CustomLoading width={600} height={400}> <CustomLoading width={600} height={400}>
<Image <Image
className="rounded-[8px] overflow-hidden w-full h-full object-cover" className="rounded-[8px] overflow-hidden w-full h-full object-cover"
src={images_clinic[0].url || ""} src={images_clinic[0]?.url || "/assets/images/clinic-img.png"}
alt="img clinic" alt="img clinic"
height={432} height={432}
width={600} width={600}
@@ -8,7 +8,7 @@ function Img({ url }) {
<CustomLoading loading={true} width="full" height={190}> <CustomLoading loading={true} width="full" height={190}>
<Image <Image
className="rounded-[8px] overflow-hidden" className="rounded-[8px] overflow-hidden"
src={url || ""} src={url || "/assets/images/clinic-img.png"}
alt="img clinic" alt="img clinic"
height={204} height={204}
width={288} width={288}
@@ -8,16 +8,15 @@ function List({ data }) {
return ( return (
<div <div
className={`hidden w-full md:grid gap-[16px] lg:gap-[24px] className={`hidden w-full md:grid gap-[16px] lg:gap-[24px]
${ ${lengthImgClinics === 1
lengthImgClinics === 1 ? "md:!hidden"
? "md:!hidden" : lengthImgClinics === 2
: lengthImgClinics === 2 ? "grid-cols-1 grid-rows-1"
? "grid-cols-1 grid-rows-1" : lengthImgClinics === 3
: lengthImgClinics === 3 ? "grid-cols-1 grid-rows-2"
? "grid-cols-1 grid-rows-2" : lengthImgClinics === 4
: lengthImgClinics === 4 ? "grid-cols-2 grid-rows-2"
? "grid-cols-2 grid-rows-2" : ""
: ""
} }
`} `}
> >
@@ -25,20 +24,19 @@ function List({ data }) {
idx !== 0 ? ( idx !== 0 ? (
<div <div
key={idx} key={idx}
className={`${ className={`${lengthImgClinics === 3
lengthImgClinics === 3
? "h-full" ? "h-full"
: lengthImgClinics === 4 : lengthImgClinics === 4
? idx === lengthImgClinics - 1 ? idx === lengthImgClinics - 1
? "w-[calc(200%+16px)] lg:w-[calc(200%+24px)]" ? "w-[calc(200%+16px)] lg:w-[calc(200%+24px)]"
: "w-full h-full" : "w-full h-full"
: "h-full w-full" : "h-full w-full"
}`} }`}
> >
<CustomLoading width="full" height={190}> <CustomLoading width="full" height={190}>
<Image <Image
className="rounded-[8px] overflow-hidden w-full h-full object-cover" className="rounded-[8px] overflow-hidden w-full h-full object-cover"
src={img.url || ""} src={img.url || "/assets/images/clinic-img.png"}
alt="img clinic" alt="img clinic"
height={204} height={204}
width={288} width={288}
+1 -1
View File
@@ -26,7 +26,7 @@ function ItemClinic({ setFilteredClinics, data, loading }) {
width={60} width={60}
height={60} height={60}
className="object-cover rounded-full w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]" className="object-cover rounded-full w-[64px] md:w-[68px] lg:w-[72px] h-[64px] md:h-[68px] lg:h-[72px]"
src={data.clinic_logo[0].url || ""} src={data.clinic_logo?.[0]?.url || "/assets/images/logo.png"}
alt="img clinic" alt="img clinic"
/> />
</CircularLoading> </CircularLoading>
+1 -1
View File
@@ -16,7 +16,7 @@ function Title({ doctor }) {
w-[40px] sm:w-[81px] md:w-[123px] lg:w-[164px] w-[40px] sm:w-[81px] md:w-[123px] lg:w-[164px]
h-[40px] sm:h-[81px] md:h-[123px] lg:h-[164px] h-[40px] sm:h-[81px] md:h-[123px] lg:h-[164px]
" "
src={doctor?.img[0]?.url} src={doctor?.img?.[0]?.url || "/assets/images/user.png"}
alt="img-doctor" alt="img-doctor"
height={164} height={164}
width={164} width={164}
+3 -3
View File
@@ -3,9 +3,9 @@ import Footer from "./footer";
import Header from "./header"; import Header from "./header";
import { cookies } from "next/headers"; import { cookies } from "next/headers";
function StLayout({ children, name }) { async function StLayout({ children, name }) {
const { matchedCity } = getStateInfo(); const { matchedCity } = await getStateInfo();
const cookieStore = cookies(); const cookieStore = await cookies();
const token = cookieStore.get("access_token"); const token = cookieStore.get("access_token");
return ( return (
+1 -1
View File
@@ -1,7 +1,7 @@
import { cookies } from "next/headers"; import { cookies } from "next/headers";
export async function getUser() { export async function getUser() {
const cookieStore = cookies(); const cookieStore = await cookies();
const raw = const raw =
cookieStore.get("access_token") && cookieStore.get("access_token") &&
cookieStore.get("refresh_token") && cookieStore.get("refresh_token") &&
+2 -2
View File
@@ -7,9 +7,9 @@ const MAIN_DOMAIN = "https://nobat724.com";
* Determines if the current domain should have a canonical tag * Determines if the current domain should have a canonical tag
* and returns the canonical URL if needed * and returns the canonical URL if needed
*/ */
export function getCanonicalUrl() { export async function getCanonicalUrl() {
try { try {
const headersList = headers(); const headersList = await headers();
const host = headersList.get("host") || ""; const host = headersList.get("host") || "";
const pathname = headersList.get("x-pathname") || "/"; const pathname = headersList.get("x-pathname") || "/";
+2 -2
View File
@@ -4,8 +4,8 @@ import { headers } from "next/headers";
import citiesData from "@/data/city.json"; import citiesData from "@/data/city.json";
import statesData from "@/data/state.json"; import statesData from "@/data/state.json";
export function getStateInfo() { export async function getStateInfo() {
const headersList = headers(); const headersList = await headers();
const host = headersList.get("host") || ""; const host = headersList.get("host") || "";
const subdomain = host.split(".")[0]; const subdomain = host.split(".")[0];
-4
View File
@@ -3,10 +3,6 @@ const nextConfig = {
output: "standalone", output: "standalone",
// Add other configurations below // Add other configurations below
reactStrictMode: true, reactStrictMode: true,
swcMinify: true,
experimental: {
missingSuspenseWithCSRBailout: false,
},
images: { images: {
unoptimized: true, unoptimized: true,
remotePatterns: [ remotePatterns: [
+740 -1338
View File
File diff suppressed because it is too large Load Diff
+25 -26
View File
@@ -13,49 +13,48 @@
"@casl/react": "^5.0.0", "@casl/react": "^5.0.0",
"@emotion/cache": "^11.11.0", "@emotion/cache": "^11.11.0",
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0", "@emotion/styled": "^11.14.1",
"@maptiler/sdk": "^2.4.0", "@maptiler/sdk": "^2.5.1",
"@material-ui/core": "^4.11.2", "@mui/icons-material": "^7.3.6",
"@mui/icons-material": "^7.1.0", "@mui/material": "^7.3.6",
"@mui/material": "^7.1.0", "@mui/styled-engine-sc": "^6.4.9",
"@mui/styled-engine-sc": "^6.0.0-alpha.18", "@mui/x-charts": "^7.29.1",
"@mui/x-charts": "^7.16.0", "@mui/x-date-pickers": "^7.29.4",
"@mui/x-date-pickers": "^7.17.0", "@next/third-parties": "^15.5.7",
"@next/third-parties": "^15.1.0",
"aos": "^2.3.4", "aos": "^2.3.4",
"axios": "^1.7.7", "axios": "^1.13.2",
"date-fns": "^3.6.0", "date-fns": "^3.6.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.19",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"i": "^0.3.7", "i": "^0.3.7",
"jalaali-js": "^1.2.8", "jalaali-js": "^1.2.8",
"jalaali-react-date-picker": "^1.0.18", "jalaali-react-date-picker": "^1.0.18",
"jalali-moment": "^3.3.11", "jalali-moment": "^3.3.11",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"jspdf": "^3.0.1", "jspdf": "^3.0.4",
"moment-jalaali": "^0.10.4", "moment-jalaali": "^0.10.4",
"next": "^14.2.20", "next": "^15.5.7",
"next-themes": "^0.3.0", "next-themes": "^0.4.6",
"npm": "^10.8.2", "npm": "^10.9.4",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",
"qrcode.react": "^4.2.0", "qrcode.react": "^4.2.0",
"react": "^18.0.0", "react": "^18.3.1",
"react-dom": "^18", "react-dom": "^18.3.1",
"react-easy-crop": "^5.1.0", "react-easy-crop": "^5.5.6",
"react-google-map-picker": "^1.2.3", "react-google-map-picker": "^1.2.3",
"react-images-uploading": "^3.1.7", "react-images-uploading": "^3.1.7",
"react-toastify": "^10.0.6", "react-toastify": "^11.0.5",
"sharp": "^0.34.1", "sharp": "^0.34.5",
"styled-components": "^6.1.11", "styled-components": "^6.1.19",
"stylis": "^4.3.4", "stylis": "^4.3.6",
"stylis-plugin-rtl": "^2.1.1", "stylis-plugin-rtl": "^2.1.1",
"swiper": "^11.1.9", "swiper": "^11.2.10",
"uninstall": "^0.0.0" "uninstall": "^0.0.0"
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"postcss": "^8", "postcss": "^8.5.6",
"prettier": "^3.5.3", "prettier": "^3.7.4",
"tailwindcss": "^3.4.1" "tailwindcss": "^3.4.18"
} }
} }