diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-08-04 11:38:09 -0400 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-08-04 10:38:09 -0500 |
commit | 0184d6059bb1943fb74bf33d1d200a423c5bf5e6 (patch) | |
tree | 4b8480d65d5ec181b372a09f946bb7649809a467 /webapp/components/rhs_header_post.jsx | |
parent | 9b50b5028391ee29922ad5549b785ac2312be368 (diff) | |
download | chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.gz chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.bz2 chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.zip |
PLT-3506 Added flagged posts functionality (#3679)
* Added flagged posts functionality
* UI Improvements to flags (#3697)
* Added flag functionality for mobile
* Updating flagged text (#3699)
* Add back button to RHS thread when coming from flagged posts
* Updating position of flags (#3708)
* Plt 3506 - Reverting flag position (#3724)
* Revert "Updating position of flags (#3708)"
This reverts commit aaa05632c5d9eda35a048300a5bd7e99584c5b58.
* Fixing the icon in search
* Help text and white space improvements (#3730)
* Updatng help text and some white spacing.
* Updating help text
Diffstat (limited to 'webapp/components/rhs_header_post.jsx')
-rw-r--r-- | webapp/components/rhs_header_post.jsx | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/webapp/components/rhs_header_post.jsx b/webapp/components/rhs_header_post.jsx index 8e54016fb..7b71bd7cc 100644 --- a/webapp/components/rhs_header_post.jsx +++ b/webapp/components/rhs_header_post.jsx @@ -4,7 +4,9 @@ import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; import Constants from 'utils/constants.jsx'; import {Tooltip, OverlayTrigger} from 'react-bootstrap'; + import * as GlobalActions from 'actions/global_actions.jsx'; +import {getFlaggedPosts} from 'actions/post_actions.jsx'; import {FormattedMessage} from 'react-intl'; @@ -34,17 +36,21 @@ export default class RhsHeaderPost extends React.Component { handleBack(e) { e.preventDefault(); - AppDispatcher.handleServerAction({ - type: ActionTypes.RECEIVED_SEARCH_TERM, - term: this.props.fromSearch, - do_search: true, - is_mention_search: this.props.isMentionSearch - }); - - AppDispatcher.handleServerAction({ - type: ActionTypes.RECEIVED_POST_SELECTED, - postId: null - }); + if (this.props.fromSearch) { + AppDispatcher.handleServerAction({ + type: ActionTypes.RECEIVED_SEARCH_TERM, + term: this.props.fromSearch, + do_search: true, + is_mention_search: this.props.isMentionSearch + }); + + AppDispatcher.handleServerAction({ + type: ActionTypes.RECEIVED_POST_SELECTED, + postId: null + }); + } else if (this.props.fromFlaggedPosts) { + getFlaggedPosts(); + } } render() { let back; @@ -57,14 +63,26 @@ export default class RhsHeaderPost extends React.Component { </Tooltip> ); - const backToResultsTooltip = ( - <Tooltip id='backToResultsTooltip'> - <FormattedMessage - id='rhs_header.backToResultsTooltip' - defaultMessage='Back to Search Results' - /> - </Tooltip> - ); + let backToResultsTooltip; + if (this.props.fromSearch) { + backToResultsTooltip = ( + <Tooltip id='backToResultsTooltip'> + <FormattedMessage + id='rhs_header.backToResultsTooltip' + defaultMessage='Back to Search Results' + /> + </Tooltip> + ); + } else if (this.props.fromFlaggedPosts) { + backToResultsTooltip = ( + <Tooltip id='backToResultsTooltip'> + <FormattedMessage + id='rhs_header.backToFlaggedTooltip' + defaultMessage='Back to Flagged Posts' + /> + </Tooltip> + ); + } const expandSidebarTooltip = ( <Tooltip id='expandSidebarTooltip'> @@ -84,7 +102,7 @@ export default class RhsHeaderPost extends React.Component { </Tooltip> ); - if (this.props.fromSearch) { + if (this.props.fromSearch || this.props.fromFlaggedPosts) { back = ( <a href='#' @@ -161,6 +179,7 @@ RhsHeaderPost.defaultProps = { RhsHeaderPost.propTypes = { isMentionSearch: React.PropTypes.bool, fromSearch: React.PropTypes.string, + fromFlaggedPosts: React.PropTypes.bool, toggleSize: React.PropTypes.function, shrink: React.PropTypes.function }; |