diff options
author | VeraLyu <lvroyce0210@gmail.com> | 2017-03-24 17:14:27 +0800 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-24 09:14:27 +0000 |
commit | 3ea091fd6df6b175bda64db81589f6936589d5d2 (patch) | |
tree | 78017547f5928ae65d0343e92bba20ada5d6bf30 /webapp/components | |
parent | f1274a7ec29919e9c99cf41f5c1b47589f38cfb1 (diff) | |
download | chat-3ea091fd6df6b175bda64db81589f6936589d5d2.tar.gz chat-3ea091fd6df6b175bda64db81589f6936589d5d2.tar.bz2 chat-3ea091fd6df6b175bda64db81589f6936589d5d2.zip |
Add file attachment to search result (#5806)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/search_results_item.jsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/webapp/components/search_results_item.jsx b/webapp/components/search_results_item.jsx index 1c7309f51..2773a8ee8 100644 --- a/webapp/components/search_results_item.jsx +++ b/webapp/components/search_results_item.jsx @@ -4,6 +4,7 @@ import $ from 'jquery'; import PostMessageContainer from 'components/post_view/components/post_message_container.jsx'; import UserProfile from './user_profile.jsx'; +import FileAttachmentListContainer from './file_attachment_list_container.jsx'; import ProfilePicture from './profile_picture.jsx'; import TeamStore from 'stores/team_store.jsx'; @@ -161,6 +162,16 @@ export default class SearchResultsItem extends React.Component { compactClass = 'post--compact'; } + let fileAttachment = null; + if (post.file_ids && post.file_ids.length > 0) { + fileAttachment = ( + <FileAttachmentListContainer + post={post} + compactDisplay={this.props.compactDisplay} + /> + ); + } + let message; let flagContent; let rhsControls; @@ -341,6 +352,7 @@ export default class SearchResultsItem extends React.Component { </ul> <div className='search-item-snippet post__body'> {message} + {fileAttachment} </div> </div> </div> |