Fix janky fullscreen Lightbox images by using flex: 1 (#467)

Setting image to full width/height makes animation returning image to previous spot look extremely awkward. flex: 1 allows image to resize between thumbnail and fullscreen as was intended with lightbox.
This commit is contained in:
Alexander Stokes
2017-07-16 18:41:32 -04:00
committed by Kevin Cooper
parent f6c54825a3
commit 1e79078265

View File

@@ -17,7 +17,7 @@ export default class MessageImage extends React.Component {
<View style={[styles.container, this.props.containerStyle]}>
<Lightbox
activeProps={{
style: [styles.imageActive, { width, height }],
style: styles.imageActive,
}}
{...this.props.lightboxProps}
>
@@ -43,6 +43,7 @@ const styles = StyleSheet.create({
resizeMode: 'cover',
},
imageActive: {
flex: 1,
resizeMode: 'contain',
},
});