Fix clipping issue with 2 image grid (#5744)

* don't set aspect ratio for 2 images

* let -> const
This commit is contained in:
Samuel Newman
2024-10-28 17:52:07 +02:00
committed by GitHub
parent 2b53ef2541
commit e652b2d7b1
+1 -12
View File
@@ -24,18 +24,7 @@ export function ImageLayoutGrid({style, ...props}: ImageLayoutGridProps) {
: a.gap_2xs
: a.gap_xs
const count = props.images.length
let aspectRatio
switch (count) {
case 2:
aspectRatio = 2
break
case 3:
aspectRatio = 2
break
case 4:
aspectRatio = undefined
break
}
const aspectRatio = count === 3 ? 2 : undefined
return (
<View style={style}>
<View style={[gap, a.rounded_md, a.overflow_hidden, {aspectRatio}]}>