diff --git a/src/app/[locale]/product/[slug]/page.jsx b/src/app/[locale]/product/[slug]/page.jsx index 30e9979..d2b1819 100644 --- a/src/app/[locale]/product/[slug]/page.jsx +++ b/src/app/[locale]/product/[slug]/page.jsx @@ -246,12 +246,9 @@ export default async function ProductPage({ params }) { showPrice={product.showPrice} category={product.category} summery={product.summery} + brand={product.brand} /> - { - product.brand && ( - - ) - } + diff --git a/src/app/[locale]/products/[category]/page.jsx b/src/app/[locale]/products/[category]/page.jsx index 1ecea0d..602b9e8 100644 --- a/src/app/[locale]/products/[category]/page.jsx +++ b/src/app/[locale]/products/[category]/page.jsx @@ -1,3 +1,4 @@ +import graphql from "src/utils/graphql"; import CategoriesData from "src/view/Categories"; @@ -61,12 +62,12 @@ query CategoriesAndBrands($locale:I18NLocaleCode,$slug:String!) { ` export async function generateMetadata({ params }) { - const { locale, slug } = await params; + const { locale, category } = await params; // Fetch product SEO data from Strapi GraphQL API const data = await graphql(gql_metadata, { locale, - slug, + slug:category, }); const productSEO = data?.categories?.[0]?.seo || data?.brands?.[0]?.seo; diff --git a/src/components/NavBar/index.jsx b/src/components/NavBar/index.jsx index 2cac028..ee137b7 100644 --- a/src/components/NavBar/index.jsx +++ b/src/components/NavBar/index.jsx @@ -287,6 +287,9 @@ const Navbar = ({ items }) => { setResponsiveNavBarItemStep(index); setActiveStepNavbar(e.documentId); + }else{ + setClosNavbar(false) + router.push(e.link) } }} > @@ -334,7 +337,7 @@ const Navbar = ({ items }) => { className="bg-primary-50 rounded-lg my-1 p-2 " key={index} > -

{s.name}

+

{s.title}

))} diff --git a/src/components/Product/ProductGallery.jsx b/src/components/Product/ProductGallery.jsx index ce47dda..6c8dbba 100644 --- a/src/components/Product/ProductGallery.jsx +++ b/src/components/Product/ProductGallery.jsx @@ -30,11 +30,12 @@ export default function ProductGallery({ images }) {
{selectedImage.alternativeText openLightbox(images.findIndex((img) => img.documentId === selectedImage.documentId))} />
@@ -47,7 +48,7 @@ export default function ProductGallery({ images }) { width={100} height={100} className={`object-cover cursor-pointer rounded-lg overflow-hidden ${ - selectedImage.documentId === image.documentId ? "ring-2 ring-primary" : "" + selectedImage.documentId === image.documentId ? "ring-2 ring-primary/50" : "" }`} onClick={() => setSelectedImage(image)} /> diff --git a/src/components/Product/ProductInfo.jsx b/src/components/Product/ProductInfo.jsx index 1b2962a..6609dcc 100644 --- a/src/components/Product/ProductInfo.jsx +++ b/src/components/Product/ProductInfo.jsx @@ -8,9 +8,10 @@ import Link from "next/link"; import ContactModal from "../ContactUs"; import { useState } from "react"; import { useTranslations } from "next-intl"; +import BrandInfo from "./BrandInfo"; -export default function ProductInfo({ title, price, discount, showPrice, category,summery }) { +export default function ProductInfo({ title, price, discount, showPrice, category, summery, brand }) { const locale = useLocale() @@ -28,72 +29,83 @@ export default function ProductInfo({ title, price, discount, showPrice, categor setOpen(false); } - const t = useTranslations("ContactModal") + const t = useTranslations("ContactModal") return ( -
+
-

{title}

- - - - {category.title} - - -

- { - summery - } -

- {showPrice && ( -
- {discount ? ( -
- - {locale === "ar-OM" ? ( - <> - {discountedPrice.toFixed(2)} {currencySymbol} - - ) : ( - <> - {currencySymbol} - {discountedPrice.toFixed(2)} - - )} - - - {locale === "ar-OM" ? ( - <> - {price.toFixed(2)} {currencySymbol} - - ) : ( - <> - {currencySymbol} - {price.toFixed(2)} - - )} - - - {discount}% OFF - -
- ) : ( - - {locale === "ar-OM" ? ( - <> - {price.toFixed(2)} {currencySymbol} - - ) : ( - <> - {currencySymbol} - {price.toFixed(2)} - - )} +
+
+

{title}

+ + + + {category.title} + +

+ { + summery + } +

+ {showPrice && ( +
+ {discount ? ( +
+ + {locale === "ar-OM" ? ( + <> + {discountedPrice.toFixed(2)} {currencySymbol} + + ) : ( + <> + {currencySymbol} + {discountedPrice.toFixed(2)} + + )} + + + {locale === "ar-OM" ? ( + <> + {price.toFixed(2)} {currencySymbol} + + ) : ( + <> + {currencySymbol} + {price.toFixed(2)} + + )} + + + {discount}% OFF + +
+ ) : ( + + {locale === "ar-OM" ? ( + <> + {price.toFixed(2)} {currencySymbol} + + ) : ( + <> + {currencySymbol} + {price.toFixed(2)} + + )} + + )} +
)}
- )} -
+
+ { + brand && ( + + ) + } +
+
+
{/* Replaced Button with Tailwind CSS */}