test new shop

main
حسین معصومی پور 2024-09-11 14:42:22 +03:30
parent d2731f2ca1
commit 6f3c200b19
10 changed files with 34 additions and 14 deletions

View File

@ -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 }]
}
}

View File

@ -139,6 +139,7 @@ const CheckoutData = () => {
<>
{addressData.map((e, index) => (
<div
key={index}
onClick={() => setAddressId(index)}
className={`flex rtl justify-between cursor-pointer mx-2 relative ${
addressId == index
@ -213,6 +214,7 @@ const CheckoutData = () => {
<div>
{shippingData?.map((e, index) => (
<div
key={index}
onClick={() => handleShippingID(index)}
className={`flex rtl justify-between cursor-pointer mx-2 ${
shippingId == index

View File

@ -32,7 +32,7 @@ const BlogsData = ({ dataCaetgories, data }) => {
<div className="grid xs:grid-cold-1 md:grid-cols-4 gap-7 ltr mt-10">
<div className="xs:xol-span-1 lg:col-span-3">
<div className="grid xs:grid-cold-1 md:grid-cols-3 gap-7 rtl ">
{data?.blogs?.map((e) => (
{data?.blogs?.map((e, index) => (
<Cart
categoryName={e.categoryName}
title={e.title}
@ -40,6 +40,7 @@ const BlogsData = ({ dataCaetgories, data }) => {
slug={e.slug}
id={e.id}
summery={e.summery}
key={index}
/>
))}
</div>
@ -53,8 +54,8 @@ const BlogsData = ({ dataCaetgories, data }) => {
<h3 className="text-center font-medium mb-5"> دسته بندی ها</h3>
<div>
{dataCaetgories?.map((e) => (
<div onClick={() => handleGoCategories(e.id)}>
{dataCaetgories?.map((e, index) => (
<div key={index} onClick={() => handleGoCategories(e.id)}>
<div className="flex p-2">
<div className="w-3 h-3 rounded-full bg-secondary-900 mt-1 ml-2"></div>
<p className="mb-0"> {e.name}</p>

View File

@ -607,8 +607,8 @@ const HeroSection = ({ data }) => {
</div>
<div className="grid xs:grid-cols-2 lg:grid-cols-5 gap-5">
{data?.products?.map((e) => (
<div className="relative">
{data?.products?.map((e, index) => (
<div key={index} className="relative">
<CardNormal data={e} priority />
</div>
))}

View File

@ -439,7 +439,10 @@ const NavbarTransparent = ({ theme }) => {
<div className="my-3 ">
{e.children.map((s, index) => (
// <Link href={s.url} key={index}>
<div className="bg-primary-50 rounded-lg my-1 p-2 ">
<div
className="bg-primary-50 rounded-lg my-1 p-2 "
key={index}
>
<p className="mb-0 text-sm">{s.name}</p>
</div>
// </Link>

View File

@ -299,6 +299,7 @@ const Navbar = ({ theme }) => {
<div className="flex rtl">
{dataNav?.map((e, index) => (
<p
key={index}
className={`mb-0 pt-2 pb-3 px-2 tr03 cursor-pointer ${
navItemHover == index
? " border-y-[5px] border-b-primary-800 border-t-transparent text-primary-900"
@ -308,7 +309,6 @@ const Navbar = ({ theme }) => {
${theme == 0 && isScrolled ? "text-gray-900" : ""}`}
onMouseEnter={() => handleItemNavber(index)}
onMouseLeave={() => setNavItemHover(null)}
key={index}
>
{e.name}{" "}
</p>

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 }) {
/>
</head>
<body>
<RootData>{children}</RootData>
<RootData>
<Suspense>{children}</Suspense>
</RootData>
</body>
</html>
);

View File

@ -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 (
<>