Center related products using flexbox instead of grid
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
This commit is contained in:
@@ -414,17 +414,16 @@ export default function ProductDetail({ product, relatedProducts, locale = "SR"
|
|||||||
{locale === "EN" ? "Similar Products" : "Slični proizvodi"}
|
{locale === "EN" ? "Similar Products" : "Slični proizvodi"}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-center">
|
<div className="flex flex-wrap justify-center gap-6 lg:gap-8">
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 lg:gap-8">
|
{relatedProducts.filter(p => p && p.id).slice(0, 4).map((relatedProduct, index) => (
|
||||||
{relatedProducts.filter(p => p && p.id).slice(0, 4).map((relatedProduct, index) => (
|
<div key={relatedProduct.id} className="w-full sm:w-[calc(50%-12px)] lg:w-[calc(25%-18px)]">
|
||||||
<ProductCard
|
<ProductCard
|
||||||
key={relatedProduct.id}
|
|
||||||
product={relatedProduct}
|
product={relatedProduct}
|
||||||
index={index}
|
index={index}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
/>
|
/>
|
||||||
))}
|
</div>
|
||||||
</div>
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user