2017-08-25 14:54:32 +08:00
|
|
|
import React, { Component } from "react";
|
2017-08-25 22:07:37 +08:00
|
|
|
import PropTypes, { bool, number, string } from "prop-types";
|
2017-08-25 14:54:32 +08:00
|
|
|
import { Modal, Button } from "react-bootstrap";
|
2017-08-25 22:07:37 +08:00
|
|
|
import _ from "lodash";
|
2017-08-25 14:54:32 +08:00
|
|
|
import { FormattedMessage } from "react-intl";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
|
|
|
|
class LeaveTeamModal extends Component {
|
2017-08-25 22:07:37 +08:00
|
|
|
|
2017-08-25 14:54:32 +08:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<Modal show={this.props.showModal}>
|
|
|
|
<Modal.Header closeButton>
|
|
|
|
<Modal.Title>
|
2017-08-25 22:07:37 +08:00
|
|
|
<FormattedMessage
|
|
|
|
id="settings_page.leave_team_modal.title"
|
|
|
|
values={{ teamName: this.props.teamName }}
|
|
|
|
/>
|
2017-08-25 14:54:32 +08:00
|
|
|
</Modal.Title>
|
|
|
|
</Modal.Header>
|
|
|
|
<Modal.Body>BANANAN</Modal.Body>
|
|
|
|
<Modal.Footer>
|
|
|
|
<Button>
|
|
|
|
<FormattedMessage id="general.close" />
|
|
|
|
</Button>
|
|
|
|
</Modal.Footer>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-25 22:07:37 +08:00
|
|
|
LeaveTeamModal.propTypes = {
|
|
|
|
showModal: bool.isRequired,
|
|
|
|
teamId: number.isRequired,
|
|
|
|
teamName: string.isRequired,
|
|
|
|
teams: PropTypes.arrayOf(
|
|
|
|
PropTypes.shape({
|
|
|
|
id: number.isRequired,
|
|
|
|
name: string.isRequired,
|
|
|
|
current_team: bool.isRequired,
|
|
|
|
role: string.isRequired,
|
|
|
|
members: number.isRequired,
|
|
|
|
}).isRequired
|
|
|
|
)
|
|
|
|
};
|
2017-08-25 14:54:32 +08:00
|
|
|
const mapStateToProps = ({ showLeaveTeamModal }) => ({
|
|
|
|
showModal: showLeaveTeamModal.show,
|
2017-08-25 22:07:37 +08:00
|
|
|
teamId: showLeaveTeamModal.id,
|
|
|
|
teamName: showLeaveTeamModal.teamName
|
2017-08-25 14:54:32 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(LeaveTeamModal);
|