diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..a8f34e2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,7 @@ { - "extends": "next/core-web-vitals" + "extends": "next/core-web-vitals", + "rules": { + "react/no-unescaped-entities": 0, + "react/jsx-key": [1, { "checkFragmentShorthand": true }] + } } diff --git a/components/AppsComponent/CheckoutData/page.jsx b/components/AppsComponent/CheckoutData/page.jsx index 5af009b..b13263a 100644 --- a/components/AppsComponent/CheckoutData/page.jsx +++ b/components/AppsComponent/CheckoutData/page.jsx @@ -139,6 +139,7 @@ const CheckoutData = () => { <> {addressData.map((e, index) => (
setAddressId(index)} className={`flex rtl justify-between cursor-pointer mx-2 relative ${ addressId == index @@ -213,6 +214,7 @@ const CheckoutData = () => {
{shippingData?.map((e, index) => (
handleShippingID(index)} className={`flex rtl justify-between cursor-pointer mx-2 ${ shippingId == index diff --git a/components/Blog/BlogsData/page.jsx b/components/Blog/BlogsData/page.jsx index 4a744c5..021d907 100644 --- a/components/Blog/BlogsData/page.jsx +++ b/components/Blog/BlogsData/page.jsx @@ -32,7 +32,7 @@ const BlogsData = ({ dataCaetgories, data }) => {
- {data?.blogs?.map((e) => ( + {data?.blogs?.map((e, index) => ( { slug={e.slug} id={e.id} summery={e.summery} + key={index} /> ))}
@@ -53,8 +54,8 @@ const BlogsData = ({ dataCaetgories, data }) => {

دسته بندی ها

- {dataCaetgories?.map((e) => ( -
handleGoCategories(e.id)}> + {dataCaetgories?.map((e, index) => ( +
handleGoCategories(e.id)}>

{e.name}

diff --git a/components/LandingPage/HeroSection/page.jsx b/components/LandingPage/HeroSection/page.jsx index 3f37fdb..add21e5 100644 --- a/components/LandingPage/HeroSection/page.jsx +++ b/components/LandingPage/HeroSection/page.jsx @@ -607,8 +607,8 @@ const HeroSection = ({ data }) => {
- {data?.products?.map((e) => ( -
+ {data?.products?.map((e, index) => ( +
))} diff --git a/components/Navbar/NavbarTransparent.jsx b/components/Navbar/NavbarTransparent.jsx index 03424bc..431b3d7 100644 --- a/components/Navbar/NavbarTransparent.jsx +++ b/components/Navbar/NavbarTransparent.jsx @@ -439,7 +439,10 @@ const NavbarTransparent = ({ theme }) => {
{e.children.map((s, index) => ( // -
+

{s.name}

// diff --git a/components/Navbar/page.jsx b/components/Navbar/page.jsx index b2e95ae..db72920 100644 --- a/components/Navbar/page.jsx +++ b/components/Navbar/page.jsx @@ -299,6 +299,7 @@ const Navbar = ({ theme }) => {
{dataNav?.map((e, index) => (

{ ${theme == 0 && isScrolled ? "text-gray-900" : ""}`} onMouseEnter={() => handleItemNavber(index)} onMouseLeave={() => setNavItemHover(null)} - key={index} > {e.name}{" "}

diff --git a/src/app/blogs/[...id]/page.jsx b/src/app/blogs/[...id]/page.jsx index 2d76191..5aec8fa 100644 --- a/src/app/blogs/[...id]/page.jsx +++ b/src/app/blogs/[...id]/page.jsx @@ -2,7 +2,9 @@ import BlogData from "@comp/Blog/BlogData/page"; import React from "react"; async function getData(id) { - const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/blog/${id}`); + const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/blog/${id}`, { + cache: "no-cache", + }); const post = await res.json(); return post; } diff --git a/src/app/blogs/page.jsx b/src/app/blogs/page.jsx index 5179a43..8afeb6a 100644 --- a/src/app/blogs/page.jsx +++ b/src/app/blogs/page.jsx @@ -11,13 +11,18 @@ async function getData(sParams) { const res = await fetch( `${process.env.NEXT_PUBLIC_API_URL}/blog?` + - new URLSearchParams({ ...query }) + new URLSearchParams({ ...query }), + { + cache: "no-cache", + } // ?page=${params.page ?? 0} // { cache: "no-cache" } ); const post = await res.json(); // + console.log("post", post); + return post; } diff --git a/src/app/layout.jsx b/src/app/layout.jsx index 29f7fd8..3e543e6 100644 --- a/src/app/layout.jsx +++ b/src/app/layout.jsx @@ -1,4 +1,5 @@ import RootData from "@comp/AppsComponent/RootData/page"; +import { Suspense } from "react"; export const metadata = { icons: { @@ -86,7 +87,9 @@ export default function RootLayout({ children }) { /> - {children} + + {children} + ); diff --git a/src/app/purchase-callback/page.jsx b/src/app/purchase-callback/page.jsx index 2060277..39c8658 100644 --- a/src/app/purchase-callback/page.jsx +++ b/src/app/purchase-callback/page.jsx @@ -4,9 +4,9 @@ import { useSearchParams } from "next/navigation"; const Page = () => { const params = useSearchParams(); - const refid = params.get("refid"); - const paymentStatus = params.get("paymentStatus"); - const factorNumber = params.get("factorNumber"); + const refid = params?.get("refid"); + const paymentStatus = params?.get("paymentStatus"); + const factorNumber = params?.get("factorNumber"); return ( <>