Merged in fix/card-width-fix (pull request #1369)

feat(images): calculate width correct using aspect ratio

* feat(images): calculate width correct using aspect ratio


Approved-by: Erik Tiekstra
This commit is contained in:
Linus Flood
2025-02-19 06:29:22 +00:00
parent ba3ecedaee
commit c2b7d97ddd
3 changed files with 36 additions and 21 deletions

View File

@@ -44,7 +44,9 @@ export default function Card({
imageWidth =
imageWidth ||
(backgroundImage?.dimensions
? backgroundImage.dimensions.aspectRatio * imageHeight
? backgroundImage.dimensions.aspectRatio >= 1
? backgroundImage.dimensions.aspectRatio * imageHeight
: imageHeight / backgroundImage.dimensions.aspectRatio
: 420)
return (