Fix product images showing full picture instead of cropped
Some checks failed
Build and Deploy / build (push) Has been cancelled

This commit is contained in:
Unchained
2026-03-22 12:05:40 +02:00
parent 44d938953b
commit 625bd727d3
2 changed files with 3 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ export default function ProductCard({ product, index = 0, locale = "SR" }: Produ
src={image} src={image}
alt={localized.name} alt={localized.name}
fill fill
className="object-cover transition-transform duration-700 ease-out group-hover:scale-105" className="object-contain transition-transform duration-700 ease-out group-hover:scale-105"
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw" sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw"
/> />
) : ( ) : (

View File

@@ -171,7 +171,7 @@ export default function ProductDetail({ product, relatedProducts, locale = "SR"
src={image.url} src={image.url}
alt={image.alt || localized.name} alt={image.alt || localized.name}
fill fill
className="object-cover" className="object-contain"
sizes="80px" sizes="80px"
/> />
</button> </button>
@@ -186,7 +186,7 @@ export default function ProductDetail({ product, relatedProducts, locale = "SR"
src={images[selectedImage].url} src={images[selectedImage].url}
alt={images[selectedImage].alt || localized.name} alt={images[selectedImage].alt || localized.name}
fill fill
className="object-cover" className="object-contain"
priority priority
sizes="(max-width: 1024px) 100vw, 50vw" sizes="(max-width: 1024px) 100vw, 50vw"
/> />