From 3bd7275cfa949ea4758a0b3f10dc496a02c04f12 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 22 Mar 2018 16:08:27 +0200 Subject: [PATCH] Rename slack attachment to message attachment and fix border color on Android (#1533) --- .../index.js | 6 +++--- .../interactive_action/index.js | 0 .../interactive_action/interactive_action.js | 0 .../message_attachment.js} | 10 +++++++--- .../post_body_additional_content.js | 8 ++++---- 5 files changed, 14 insertions(+), 10 deletions(-) rename app/components/{slack_attachments => message_attachments}/index.js (91%) rename app/components/{slack_attachments => message_attachments}/interactive_action/index.js (100%) rename app/components/{slack_attachments => message_attachments}/interactive_action/interactive_action.js (100%) rename app/components/{slack_attachments/slack_attachment.js => message_attachments/message_attachment.js} (97%) diff --git a/app/components/slack_attachments/index.js b/app/components/message_attachments/index.js similarity index 91% rename from app/components/slack_attachments/index.js rename to app/components/message_attachments/index.js index 7a63401ec..ac08deabb 100644 --- a/app/components/slack_attachments/index.js +++ b/app/components/message_attachments/index.js @@ -7,9 +7,9 @@ import PropTypes from 'prop-types'; import CustomPropTypes from 'app/constants/custom_prop_types'; -import SlackAttachment from './slack_attachment'; +import MessageAttachment from './message_attachment'; -export default class SlackAttachments extends PureComponent { +export default class MessageAttachments extends PureComponent { static propTypes = { attachments: PropTypes.array.isRequired, baseTextStyle: CustomPropTypes.Style, @@ -38,7 +38,7 @@ export default class SlackAttachments extends PureComponent { attachments.forEach((attachment, i) => { content.push( - { return { container: { - borderColor: changeOpacity(theme.centerChannelColor, 0.15), - borderWidth: 1, + borderBottomColor: changeOpacity(theme.centerChannelColor, 0.15), + borderRightColor: changeOpacity(theme.centerChannelColor, 0.15), + borderTopColor: changeOpacity(theme.centerChannelColor, 0.15), + borderBottomWidth: 1, + borderRightWidth: 1, + borderTopWidth: 1, marginTop: 5, padding: 10, }, diff --git a/app/components/post_body_additional_content/post_body_additional_content.js b/app/components/post_body_additional_content/post_body_additional_content.js index 85fea118a..15831c0d5 100644 --- a/app/components/post_body_additional_content/post_body_additional_content.js +++ b/app/components/post_body_additional_content/post_body_additional_content.js @@ -18,7 +18,7 @@ import youTubeVideoId from 'youtube-video-id'; import youtubePlayIcon from 'assets/images/icons/youtube-play-icon.png'; import PostAttachmentOpenGraph from 'app/components/post_attachment_opengraph'; -import SlackAttachments from 'app/components/slack_attachments'; +import MessageAttachments from 'app/components/message_attachments'; import CustomPropTypes from 'app/constants/custom_prop_types'; import {emptyFunction} from 'app/utils/general'; import {isImageLink, isYoutubeLink} from 'app/utils/url'; @@ -109,7 +109,7 @@ export default class PostBodyAdditionalContent extends PureComponent { } const {isReplyPost, link, openGraphData, showLinkPreviews, theme} = this.props; - const attachments = this.getSlackAttachment(); + const attachments = this.getMessageAttachment(); if (attachments) { return attachments; } @@ -154,7 +154,7 @@ export default class PostBodyAdditionalContent extends PureComponent { } }; - getSlackAttachment = () => { + getMessageAttachment = () => { const { postId, postProps, @@ -169,7 +169,7 @@ export default class PostBodyAdditionalContent extends PureComponent { if (attachments && attachments.length) { return ( -