update comment

zio/stable
Hailey 2024-01-30 17:09:02 -08:00
parent bb4c9df039
commit db3b10e98b
1 changed files with 9 additions and 4 deletions

View File

@ -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/facebook/yoga/issues/1418
// https://github.com/bluesky-social/social-app/issues/2601
const IMAGE_GAP = 5 const IMAGE_GAP = 5
const styles = StyleSheet.create({ const styles = StyleSheet.create({
flexRow: {flexDirection: 'row', gap: !isWeb ? IMAGE_GAP : undefined},
smallItem: {flex: 1, aspectRatio: 1},
container: isWeb container: isWeb
? { ? {
marginHorizontal: -IMAGE_GAP / 2, marginHorizontal: -IMAGE_GAP / 2,
@ -105,6 +105,11 @@ const styles = StyleSheet.create({
: { : {
gap: IMAGE_GAP, gap: IMAGE_GAP,
}, },
flexRow: {
flexDirection: 'row',
gap: isWeb ? undefined : IMAGE_GAP,
},
smallItem: {flex: 1, aspectRatio: 1},
image: isWeb image: isWeb
? { ? {
margin: IMAGE_GAP / 2, margin: IMAGE_GAP / 2,