fix 3 image grid in DMs (#6163)
This commit is contained in:
@@ -27,11 +27,10 @@ export function ImageLayoutGrid({style, ...props}: ImageLayoutGridProps) {
|
|||||||
? a.gap_xs
|
? a.gap_xs
|
||||||
: a.gap_2xs
|
: a.gap_2xs
|
||||||
: a.gap_xs
|
: a.gap_xs
|
||||||
const count = props.images.length
|
|
||||||
const aspectRatio = count === 3 ? 2 : undefined
|
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
<View style={[gap, a.rounded_md, a.overflow_hidden, {aspectRatio}]}>
|
<View style={[gap, a.rounded_md, a.overflow_hidden]}>
|
||||||
<ImageLayoutGridInner {...props} gap={gap} />
|
<ImageLayoutGridInner {...props} gap={gap} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -78,14 +77,14 @@ function ImageLayoutGridInner(props: ImageLayoutGridInnerProps) {
|
|||||||
case 3:
|
case 3:
|
||||||
return (
|
return (
|
||||||
<View style={[a.flex_1, a.flex_row, gap]}>
|
<View style={[a.flex_1, a.flex_row, gap]}>
|
||||||
<View style={[a.flex_1]}>
|
<View style={[a.flex_1, {aspectRatio: 1}]}>
|
||||||
<GalleryItem
|
<GalleryItem
|
||||||
{...props}
|
{...props}
|
||||||
index={0}
|
index={0}
|
||||||
insetBorderStyle={noCorners(['topRight', 'bottomRight'])}
|
insetBorderStyle={noCorners(['topRight', 'bottomRight'])}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={[a.flex_1, gap]}>
|
<View style={[a.flex_1, {aspectRatio: 1}, gap]}>
|
||||||
<View style={[a.flex_1]}>
|
<View style={[a.flex_1]}>
|
||||||
<GalleryItem
|
<GalleryItem
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in New Issue
Block a user