From 42560ca047dbaad9d18d694376a3f7bb939af206 Mon Sep 17 00:00:00 2001 From: CJ <38697367+imisshtml@users.noreply.github.com> Date: Thu, 31 Oct 2019 11:29:08 -0400 Subject: [PATCH] MM-18934 Fix padding on image attachment border (#3466) * MM-18934 Fix padding on image attachment border Removed padding from image padding as it was pushing the images outside of the box. * MM-18934 Add spacing between border and image Added a margin to progressive image to allow for a spacing with the absolutefill * MM-18934 Fixed eslint Fixed eslint issues --- .../attachment_image/__snapshots__/index.test.js.snap | 1 - .../message_attachments/attachment_image/index.js | 1 - app/components/progressive_image/progressive_image.js | 8 +++++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap b/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap index 75cf22a00..c941946d9 100644 --- a/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap +++ b/app/components/message_attachments/attachment_image/__snapshots__/index.test.js.snap @@ -23,7 +23,6 @@ exports[`AttachmentImage it matches snapshot 1`] = ` "borderRadius": 2, "borderWidth": 1, "flex": 1, - "padding": 5, }, Object { "height": 28, diff --git a/app/components/message_attachments/attachment_image/index.js b/app/components/message_attachments/attachment_image/index.js index b30735032..2843c11b3 100644 --- a/app/components/message_attachments/attachment_image/index.js +++ b/app/components/message_attachments/attachment_image/index.js @@ -177,7 +177,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { borderWidth: 1, borderRadius: 2, flex: 1, - padding: 5, }, }; }); diff --git a/app/components/progressive_image/progressive_image.js b/app/components/progressive_image/progressive_image.js index 1db062fd1..1b4d73bd7 100644 --- a/app/components/progressive_image/progressive_image.js +++ b/app/components/progressive_image/progressive_image.js @@ -167,7 +167,7 @@ export default class ProgressiveImage extends PureComponent { resizeMethod={resizeMethod} onError={onError} source={{uri}} - style={StyleSheet.absoluteFill} + style={[StyleSheet.absoluteFill, styles.attachmentMargin]} > {this.props.children} @@ -189,4 +189,10 @@ const styles = StyleSheet.create({ alignItems: 'center', justifyContent: 'center', }, + attachmentMargin: { + marginTop: 2.5, + marginLeft: 2.5, + marginBottom: 5, + marginRight: 5, + }, });