Fix Markdown image layout on rotation

This commit is contained in:
Elias Nahum
2021-09-20 18:00:24 -03:00
parent 9ed616afa9
commit 2c9b74387e

View File

@@ -168,7 +168,7 @@ const MarkdownImage = ({
if (Platform.OS === 'android' && (height > ANDROID_MAX_HEIGHT || width > ANDROID_MAX_WIDTH)) {
// Android has a cap on the max image size that can be displayed
image = (
<Text style={errorTextStyle}>
<Text style={[errorTextStyle, style.container]}>
<FormattedText
id='mobile.markdown.image.too_large'
defaultMessage='Image exceeds max dimensions of {maxWidth} by {maxHeight}:'
@@ -186,7 +186,7 @@ const MarkdownImage = ({
disabled={disabled}
onLongPress={handleLinkLongPress}
onPress={handlePreviewImage}
style={{width, height}}
style={[{width, height}, style.container]}
>
<ProgressiveImage
id={fileInfo.id}
@@ -205,7 +205,7 @@ const MarkdownImage = ({
<TouchableWithFeedback
onPress={handleLinkPress}
onLongPress={handleLinkLongPress}
style={{width, height}}
style={[{width, height}, style.container]}
>
{image}
</TouchableWithFeedback>
@@ -213,10 +213,7 @@ const MarkdownImage = ({
}
return (
<View
style={style.container}
testID='markdown_image'
>
<View testID='markdown_image'>
{image}
</View>
);