Compare commits

...

2 Commits

Author SHA1 Message Date
Amir Hossein Moghiseh a594730535 fix 2025-03-03 22:59:29 +03:30
Amir Hossein Moghiseh e0b3960b6b products 2025-03-03 22:45:35 +03:30
3 changed files with 7 additions and 10 deletions

View File

@ -217,8 +217,6 @@ export default async function ProductPage({ params }) {
return ( return (
<div className="max-w-screen-xl mx-auto px-4 py-8 "> <div className="max-w-screen-xl mx-auto px-4 py-8 ">
{/* <ColorAvg image={product.brand.image.url}/> */} {/* <ColorAvg image={product.brand.image.url}/> */}
<div className="flex flex-col lg:flex-row gap-8 items-center lg:items-start"> <div className="flex flex-col lg:flex-row gap-8 items-center lg:items-start">
<ProductGallery images={product.images} /> <ProductGallery images={product.images} />
<div className="flex flex-col gap-4 w-full "> <div className="flex flex-col gap-4 w-full ">
@ -227,8 +225,6 @@ export default async function ProductPage({ params }) {
<Link href="/" className=" underline inline-flex gap-2"> <Link href="/" className=" underline inline-flex gap-2">
<Home /> <Home />
</Link> </Link>
{ {
product?.category?.slug && product?.category?.slug &&
<> <>
@ -266,7 +262,6 @@ export default async function ProductPage({ params }) {
subcategories={product.subcategories} subcategories={product.subcategories}
/> />
</div> </div>
</div> </div>
</div> </div>

View File

@ -57,7 +57,7 @@ export default function ProductGallery({ images }) {
/> />
</div> </div>
<div className="mt-4 grid grid-cols-4 gap-1"> <div className="mt-4 grid grid-cols-4 gap-1">
{images.slice(0, 4).map((image, index) => ( {images.slice(0, 4).map((image) => (
<Image <Image
key={image.documentId} key={image.documentId}
src={image.url || "/placeholder.svg"} src={image.url || "/placeholder.svg"}
@ -76,7 +76,7 @@ export default function ProductGallery({ images }) {
<div className="relative max-w-4xl w-full"> <div className="relative max-w-4xl w-full">
{/* Close Button */} {/* Close Button */}
<button <button
className="absolute top-4 right-4 p-2 rounded-full text-white hover:bg-gray-700 transition-colors" className="absolute top-4 right-4 p-2 rounded-full text-white hover:bg-gray-700 transition-colors bg-gray-400 shadow-lg"
onClick={closeLightbox} onClick={closeLightbox}
> >
<X className="h-6 w-6" /> <X className="h-6 w-6" />
@ -93,7 +93,7 @@ export default function ProductGallery({ images }) {
{/* Previous Button */} {/* Previous Button */}
<button <button
className="absolute top-1/2 left-4 transform -translate-y-1/2 p-2 rounded-full text-white hover:bg-gray-700 transition-colors" className="absolute top-1/2 left-4 transform -translate-y-1/2 p-2 rounded-full text-white hover:bg-gray-700 transition-colors bg-gray-400 shadow-lg"
onClick={prevImage} onClick={prevImage}
> >
<ChevronLeft className="h-8 w-8" /> <ChevronLeft className="h-8 w-8" />
@ -101,7 +101,7 @@ export default function ProductGallery({ images }) {
{/* Next Button */} {/* Next Button */}
<button <button
className="absolute top-1/2 right-4 transform -translate-y-1/2 p-2 rounded-full text-white hover:bg-gray-700 transition-colors" className="absolute top-1/2 right-4 transform -translate-y-1/2 p-2 rounded-full text-white hover:bg-gray-700 transition-colors bg-gray-400 shadow-lg"
onClick={nextImage} onClick={nextImage}
> >
<ChevronRight className="h-8 w-8" /> <ChevronRight className="h-8 w-8" />

View File

@ -47,6 +47,7 @@ query Products_connection(
] ]
} }
locale: $locale locale: $locale
sort: ["order:asc"]
) { ) {
nodes { nodes {
documentId documentId
@ -84,6 +85,7 @@ query Products_connection(
} }
` `
@ -132,7 +134,7 @@ const ProductsListingPage = () => {
getProducts(category) getProducts(category)
}, [searchParams]) }, [searchParams])
console.log("products", products)
const t = useTranslations("PLP") const t = useTranslations("PLP")
return ( return (
<> <>