// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
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';
const ActionTypes = Constants.ActionTypes;
import React from 'react';
export default class RhsHeaderPost extends React.Component {
constructor(props) {
super(props);
this.handleClose = this.handleClose.bind(this);
this.toggleSize = this.toggleSize.bind(this);
this.handleBack = this.handleBack.bind(this);
this.state = {};
}
handleClose(e) {
e.preventDefault();
GlobalActions.emitCloseRightHandSide();
this.props.shrink();
}
toggleSize(e) {
e.preventDefault();
this.props.toggleSize();
}
handleBack(e) {
e.preventDefault();
if (this.props.fromSearch || this.props.isWebrtc) {
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;
const closeSidebarTooltip = (