diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-11-06 09:05:32 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-11-06 09:05:32 -0500 |
commit | 1ecad4301e6e511a426da5884a54111c5bb7a4fd (patch) | |
tree | 114dea884f0a08729f5b6b5f9e45d2e470bedc71 /web/react/components/post_attachment_list.jsx | |
parent | 6417d4728dc9351d5bf3180e458be8ce6e1e642f (diff) | |
parent | 195728b949a4f3aee75e01f4b0e4a0b2f67850da (diff) | |
download | chat-1ecad4301e6e511a426da5884a54111c5bb7a4fd.tar.gz chat-1ecad4301e6e511a426da5884a54111c5bb7a4fd.tar.bz2 chat-1ecad4301e6e511a426da5884a54111c5bb7a4fd.zip |
Merge pull request #1327 from florianorben/PLT-857-2
PLT-857: Support `attachments` for Incoming Webhooks
Diffstat (limited to 'web/react/components/post_attachment_list.jsx')
-rw-r--r-- | web/react/components/post_attachment_list.jsx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/web/react/components/post_attachment_list.jsx b/web/react/components/post_attachment_list.jsx new file mode 100644 index 000000000..03b866656 --- /dev/null +++ b/web/react/components/post_attachment_list.jsx @@ -0,0 +1,32 @@ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +const PostAttachment = require('./post_attachment.jsx'); + +export default class PostAttachmentList extends React.Component { + constructor(props) { + super(props); + } + + render() { + let content = []; + this.props.attachments.forEach((attachment, i) => { + content.push( + <PostAttachment + attachment={attachment} + key={'att_' + i} + /> + ); + }); + + return ( + <div className='attachment_list'> + {content} + </div> + ); + } +} + +PostAttachmentList.propTypes = { + attachments: React.PropTypes.array.isRequired +}; |