const { React, PropTypes, Actions } = require('mailspring-exports'); const { RetinaImg } = require('mailspring-component-kit'); class SendingCancelButton extends React.Component { static displayName = 'SendingCancelButton'; static propTypes = { taskId: PropTypes.string.isRequired }; constructor(props) { super(props); this.state = { cancelling: false }; } render() { if (this.state.cancelling) { return ( ); } else { return (
); } } _onClick = () => { Actions.cancelTask(this.props.taskId); this.setState({ cancelling: true }); }; } module.exports = SendingCancelButton;