if width is specified, keep images aspect ratio (#1595)

This commit is contained in:
Athou
2024-11-29 13:30:48 +01:00
parent 3d4faf2406
commit 0a16bb2fba

View File

@@ -70,7 +70,11 @@ export function ImageWithPlaceholderWhileLoading({
width={width}
height={height}
onLoad={() => setLoading(false)}
style={{ ...style, display: loading ? "none" : (style?.display ?? "initial") }}
style={{
...style,
display: loading ? "none" : (style?.display ?? "initial"),
height: style?.width ? "auto" : style?.height,
}}
/>
</>
)