diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-05-09 21:54:45 +0900 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-05-09 07:54:45 -0500 |
commit | f88769d1f2ba7f2097e9a545e18fb0c5eb4ea2e9 (patch) | |
tree | 3d378c5e7bc60b04e0892a1ca9d555652b83098b /webapp/components/search_results.jsx | |
parent | 882172b298a1e11768772b95031968d75a19af94 (diff) | |
download | chat-f88769d1f2ba7f2097e9a545e18fb0c5eb4ea2e9.tar.gz chat-f88769d1f2ba7f2097e9a545e18fb0c5eb4ea2e9.tar.bz2 chat-f88769d1f2ba7f2097e9a545e18fb0c5eb4ea2e9.zip |
[PLT-6363-1] Create PostFlagIcon component and add flag IDs to posts (#6271)
* [UI-AUTO] add IDs to last 10 posts' text
* create FlagPost component and add flag IDs for posts at center, RHS and
search results
Diffstat (limited to 'webapp/components/search_results.jsx')
-rw-r--r-- | webapp/components/search_results.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/webapp/components/search_results.jsx b/webapp/components/search_results.jsx index 682b04e2a..64e5a7c93 100644 --- a/webapp/components/search_results.jsx +++ b/webapp/components/search_results.jsx @@ -267,7 +267,7 @@ export default class SearchResults extends React.Component { </div> ); } else { - ctls = results.order.map(function mymap(id) { + ctls = results.order.map(function searchResults(id, idx, arr) { const post = results.posts[id]; let profile; if (UserStore.getCurrentId() === post.user_id) { @@ -285,12 +285,16 @@ export default class SearchResults extends React.Component { if (this.state.flaggedPosts) { isFlagged = this.state.flaggedPosts.get(post.id) === 'true'; } + + const reverseCount = arr.length - idx - 1; + return ( <SearchResultsItem key={post.id} channel={this.state.channels.get(post.channel_id)} compactDisplay={this.state.compactDisplay} post={post} + lastPostCount={(reverseCount >= 0 && reverseCount < Constants.TEST_ID_COUNT) ? reverseCount : -1} user={profile} term={searchTerm} isMentionSearch={this.props.isMentionSearch} |