diff options
author | Hailey <me@haileyok.com> | 2024-01-30 17:09:02 -0800 |
---|---|---|
committer | Hailey <me@haileyok.com> | 2024-01-30 17:09:02 -0800 |
commit | db3b10e98b775bee48559bda5da3444a89437703 (patch) | |
tree | 90095d916ec18816f3f1daa3a92fca2f05e0acf6 /src | |
parent | bb4c9df039d36457bb6e78b7fb7dfcdefe0b72d5 (diff) | |
download | voidsky-db3b10e98b775bee48559bda5da3444a89437703.tar.zst |
update comment
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/util/images/ImageLayoutGrid.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/view/com/util/images/ImageLayoutGrid.tsx b/src/view/com/util/images/ImageLayoutGrid.tsx index ad7a42af5..ba6c04f50 100644 --- a/src/view/com/util/images/ImageLayoutGrid.tsx +++ b/src/view/com/util/images/ImageLayoutGrid.tsx @@ -89,14 +89,14 @@ function ImageLayoutGridInner(props: ImageLayoutGridInnerProps) { } } -// This is used to compute margins (rather than flexbox gap) due to Yoga bugs: +// On web we use margin to calculate gap, as aspectRatio does not properly size +// all images on web. On native though we cannot rely on margin, since the +// negative margin interferes with the swipe controls on pagers. // https://github.com/facebook/yoga/issues/1418 +// https://github.com/bluesky-social/social-app/issues/2601 const IMAGE_GAP = 5 const styles = StyleSheet.create({ - flexRow: {flexDirection: 'row', gap: !isWeb ? IMAGE_GAP : undefined}, - smallItem: {flex: 1, aspectRatio: 1}, - container: isWeb ? { marginHorizontal: -IMAGE_GAP / 2, @@ -105,6 +105,11 @@ const styles = StyleSheet.create({ : { gap: IMAGE_GAP, }, + flexRow: { + flexDirection: 'row', + gap: isWeb ? undefined : IMAGE_GAP, + }, + smallItem: {flex: 1, aspectRatio: 1}, image: isWeb ? { margin: IMAGE_GAP / 2, |