diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-05-03 11:55:06 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-05-03 08:55:06 -0700 |
commit | ec5f40a4235369de7ffb45caaee822cbc1a7d8ba (patch) | |
tree | 7120f075ba8cf82e8bee6951e9cb48207da5b9a2 /webapp/components/rhs_header_post.jsx | |
parent | 6a6c5365d335666b5f76b92d1f41314e6873197f (diff) | |
download | chat-ec5f40a4235369de7ffb45caaee822cbc1a7d8ba.tar.gz chat-ec5f40a4235369de7ffb45caaee822cbc1a7d8ba.tar.bz2 chat-ec5f40a4235369de7ffb45caaee822cbc1a7d8ba.zip |
Add back button to RHS threads from pinned posts (#6306)
Diffstat (limited to 'webapp/components/rhs_header_post.jsx')
-rw-r--r-- | webapp/components/rhs_header_post.jsx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/webapp/components/rhs_header_post.jsx b/webapp/components/rhs_header_post.jsx index 951201024..55c16b0ae 100644 --- a/webapp/components/rhs_header_post.jsx +++ b/webapp/components/rhs_header_post.jsx @@ -6,7 +6,7 @@ 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 {getFlaggedPosts, getPinnedPosts} from 'actions/post_actions.jsx'; import {FormattedMessage} from 'react-intl'; @@ -24,15 +24,18 @@ export default class RhsHeaderPost extends React.Component { this.state = {}; } + handleClose(e) { e.preventDefault(); GlobalActions.emitCloseRightHandSide(); this.props.shrink(); } + toggleSize(e) { e.preventDefault(); this.props.toggleSize(); } + handleBack(e) { e.preventDefault(); @@ -50,8 +53,11 @@ export default class RhsHeaderPost extends React.Component { }); } else if (this.props.fromFlaggedPosts) { getFlaggedPosts(); + } else if (this.props.fromPinnedPosts) { + getPinnedPosts(); } } + render() { let back; const closeSidebarTooltip = ( @@ -91,6 +97,15 @@ export default class RhsHeaderPost extends React.Component { /> </Tooltip> ); + } else if (this.props.fromPinnedPosts) { + backToResultsTooltip = ( + <Tooltip id='backToResultsTooltip'> + <FormattedMessage + id='rhs_header.backToPinnedTooltip' + defaultMessage='Back to Pinned Posts' + /> + </Tooltip> + ); } const expandSidebarTooltip = ( @@ -111,7 +126,7 @@ export default class RhsHeaderPost extends React.Component { </Tooltip> ); - if (this.props.fromSearch || this.props.fromFlaggedPosts || this.props.isWebrtc) { + if (this.props.fromSearch || this.props.fromFlaggedPosts || this.props.isWebrtc || this.props.fromPinnedPosts) { back = ( <a href='#' @@ -190,6 +205,7 @@ RhsHeaderPost.propTypes = { isWebrtc: React.PropTypes.bool, fromSearch: React.PropTypes.string, fromFlaggedPosts: React.PropTypes.bool, + fromPinnedPosts: React.PropTypes.bool, toggleSize: React.PropTypes.func, shrink: React.PropTypes.func }; |