From 590c7ed45dfe1ea9c818874ce83baec2d3f4d349 Mon Sep 17 00:00:00 2001 From: kosgrz <45372453+kosgrz@users.noreply.github.com> Date: Mon, 25 Feb 2019 17:00:45 +0100 Subject: [PATCH] [MM-14193] Render emojis in Message Attachment title (#2591) --- .../message_attachments/attachment_title.js | 33 +++++++++++++++++-- .../message_attachments/message_attachment.js | 1 + 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/components/message_attachments/attachment_title.js b/app/components/message_attachments/attachment_title.js index c50c8aef2..ca0d06853 100644 --- a/app/components/message_attachments/attachment_title.js +++ b/app/components/message_attachments/attachment_title.js @@ -6,12 +6,14 @@ import {Linking, Text, View} from 'react-native'; import PropTypes from 'prop-types'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; +import Markdown from 'app/components/markdown'; export default class AttachmentTitle extends PureComponent { static propTypes = { link: PropTypes.string, theme: PropTypes.object.isRequired, value: PropTypes.string, + navigator: PropTypes.object.isRequired, }; openLink = () => { @@ -26,6 +28,7 @@ export default class AttachmentTitle extends PureComponent { link, value, theme, + navigator, } = this.props; if (!value) { @@ -34,14 +37,37 @@ export default class AttachmentTitle extends PureComponent { const style = getStyleSheet(theme); - return ( - + let title; + if (link) { + title = ( {value} + ); + } else { + title = ( + + ); + } + + return ( + + {title} ); } @@ -50,6 +76,7 @@ export default class AttachmentTitle extends PureComponent { const getStyleSheet = makeStyleSheetFromTheme((theme) => { return { container: { + marginTop: 3, flex: 1, flexDirection: 'row', }, @@ -57,6 +84,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { color: theme.centerChannelColor, fontWeight: '600', marginBottom: 5, + fontSize: 14, + lineHeight: 20, }, link: { color: theme.linkColor, diff --git a/app/components/message_attachments/message_attachment.js b/app/components/message_attachments/message_attachment.js index 9ff263e2c..714620ade 100644 --- a/app/components/message_attachments/message_attachment.js +++ b/app/components/message_attachments/message_attachment.js @@ -86,6 +86,7 @@ export default class MessageAttachment extends PureComponent { link={attachment.title_link} theme={theme} value={attachment.title} + navigator={navigator} />