From f3d60d3c5b5947d1c06b9e3aa30f0d2187917cc5 Mon Sep 17 00:00:00 2001 From: Unchained Date: Mon, 23 Mar 2026 10:45:10 +0200 Subject: [PATCH] Fix product images: use fill with aspect-square container --- src/components/product/ProductCard.tsx | 2 +- src/components/product/ProductDetail.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/product/ProductCard.tsx b/src/components/product/ProductCard.tsx index 50dd239..a352a44 100644 --- a/src/components/product/ProductCard.tsx +++ b/src/components/product/ProductCard.tsx @@ -34,7 +34,7 @@ export default function ProductCard({ product, index = 0, locale = "SR" }: Produ alt={localized.name} fill className="object-cover object-center transition-transform duration-700 ease-out group-hover:scale-105" - sizes="100vw" + sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw" loading="lazy" /> ) : ( diff --git a/src/components/product/ProductDetail.tsx b/src/components/product/ProductDetail.tsx index ed788fb..1085db5 100644 --- a/src/components/product/ProductDetail.tsx +++ b/src/components/product/ProductDetail.tsx @@ -180,15 +180,15 @@ export default function ProductDetail({ product, relatedProducts, locale = "SR" )} {/* Main Image */} -
+
{images[selectedImage] && ( {images[selectedImage].alt )}