about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-10-28 17:52:07 +0200
committerGitHub <noreply@github.com>2024-10-28 15:52:07 +0000
commite652b2d7b135d114fcaf4750a17cc04a51911820 (patch)
tree4d71a5d240d44c803e8a34002f08cb3aa8214aaf /src
parent2b53ef2541792197b59c54286e61aa54b496dc6f (diff)
downloadvoidsky-e652b2d7b135d114fcaf4750a17cc04a51911820.tar.zst
Fix clipping issue with 2 image grid (#5744)
* don't set aspect ratio for 2 images

* let -> const
Diffstat (limited to 'src')
-rw-r--r--src/view/com/util/images/ImageLayoutGrid.tsx13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/view/com/util/images/ImageLayoutGrid.tsx b/src/view/com/util/images/ImageLayoutGrid.tsx
index 1aaf166ff..7475a96c3 100644
--- a/src/view/com/util/images/ImageLayoutGrid.tsx
+++ b/src/view/com/util/images/ImageLayoutGrid.tsx
@@ -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}]}>