diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-11-08 18:00:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-08 18:00:39 +0000 |
commit | e9d7c444cea0d60b4d2fe1b3c7195edd3db98e5b (patch) | |
tree | b184d29cf4936b5da034ee0a0f292b975a1ab21b | |
parent | ce8d62f8c98182b6498c853c436ae13afa7e21e0 (diff) | |
download | voidsky-e9d7c444cea0d60b4d2fe1b3c7195edd3db98e5b.tar.zst |
fix 3 image grid in DMs (#6163)
-rw-r--r-- | src/view/com/util/images/ImageLayoutGrid.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/view/com/util/images/ImageLayoutGrid.tsx b/src/view/com/util/images/ImageLayoutGrid.tsx index 830040ba6..9d6a49836 100644 --- a/src/view/com/util/images/ImageLayoutGrid.tsx +++ b/src/view/com/util/images/ImageLayoutGrid.tsx @@ -27,11 +27,10 @@ export function ImageLayoutGrid({style, ...props}: ImageLayoutGridProps) { ? a.gap_xs : a.gap_2xs : a.gap_xs - const count = props.images.length - const aspectRatio = count === 3 ? 2 : undefined + return ( <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} /> </View> </View> @@ -78,14 +77,14 @@ function ImageLayoutGridInner(props: ImageLayoutGridInnerProps) { case 3: return ( <View style={[a.flex_1, a.flex_row, gap]}> - <View style={[a.flex_1]}> + <View style={[a.flex_1, {aspectRatio: 1}]}> <GalleryItem {...props} index={0} insetBorderStyle={noCorners(['topRight', 'bottomRight'])} /> </View> - <View style={[a.flex_1, gap]}> + <View style={[a.flex_1, {aspectRatio: 1}, gap]}> <View style={[a.flex_1]}> <GalleryItem {...props} |