// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import {Modal} from 'react-bootstrap'; import TeamStore from 'stores/team_store.jsx'; import {FormattedMessage} from 'react-intl'; import {browserHistory} from 'react-router/es6'; import React from 'react'; import {deleteChannel} from 'actions/channel_actions.jsx'; export default class DeleteChannelModal extends React.Component { constructor(props) { super(props); this.handleDelete = this.handleDelete.bind(this); this.onHide = this.onHide.bind(this); this.state = {show: true}; } handleDelete() { if (this.props.channel.id.length !== 26) { return; } browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/channels/town-square'); deleteChannel(this.props.channel.id); } onHide() { this.setState({show: false}); } render() { return (

); } } DeleteChannelModal.propTypes = { onHide: React.PropTypes.func.isRequired, channel: React.PropTypes.object.isRequired };