diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-11-11 13:56:13 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-11-11 13:56:13 -0500 |
commit | f8f0814a3796ffd80615c7722e096bef9ef17e73 (patch) | |
tree | 2d11bbe6aced74fab6b5fe03fd1a248762c71be4 /web/react/components/post_body_additional_content.jsx | |
parent | 89200132663c79c9d071af1e612afef1bb3d94e6 (diff) | |
parent | a1d40102a2f857c5dc79ed2c0066e1967e8505b8 (diff) | |
download | chat-f8f0814a3796ffd80615c7722e096bef9ef17e73.tar.gz chat-f8f0814a3796ffd80615c7722e096bef9ef17e73.tar.bz2 chat-f8f0814a3796ffd80615c7722e096bef9ef17e73.zip |
Merge pull request #1352 from florianorben/PLT-1049
PLT-1049: Vine URLs should not generate preview links
Diffstat (limited to 'web/react/components/post_body_additional_content.jsx')
-rw-r--r-- | web/react/components/post_body_additional_content.jsx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/web/react/components/post_body_additional_content.jsx b/web/react/components/post_body_additional_content.jsx index 8189ba2d3..0c2c44286 100644 --- a/web/react/components/post_body_additional_content.jsx +++ b/web/react/components/post_body_additional_content.jsx @@ -2,12 +2,14 @@ // See License.txt for license information. const PostAttachmentList = require('./post_attachment_list.jsx'); +const PostAttachmentOEmbed = require('./post_attachment_oembed.jsx'); export default class PostBodyAdditionalContent extends React.Component { constructor(props) { super(props); this.getSlackAttachment = this.getSlackAttachment.bind(this); + this.getOembedAttachment = this.getOembedAttachment.bind(this); this.getComponent = this.getComponent.bind(this); } @@ -25,17 +27,31 @@ export default class PostBodyAdditionalContent extends React.Component { ); } + getOembedAttachment() { + const link = this.props.post.props && this.props.post.props.oEmbedLink || ''; + return ( + <PostAttachmentOEmbed + key={'post_body_additional_content' + this.props.post.id} + link={link} + /> + ); + } + getComponent() { - switch (this.state.type) { + switch (this.props.post.type) { case 'slack_attachment': return this.getSlackAttachment(); + case 'oEmbed': + return this.getOembedAttachment(); + default: + return ''; } } render() { let content = []; - if (this.state.shouldRender) { + if (Boolean(this.props.post.type)) { const component = this.getComponent(); if (component) { |