diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-19 15:39:58 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:43 +0200 |
| commit | 19033b8460cb43dc2fa34a2cffa932b5efe111ca (patch) | |
| tree | 79bde2093acce8d8192d27e288d61bc53cf99e07 /src/components/modals/ConfirmationModal.js | |
| parent | 434be6d21ad665cb6abdf5138d0c563efbfe00b4 (diff) | |
Add profile page
Diffstat (limited to 'src/components/modals/ConfirmationModal.js')
| -rw-r--r-- | src/components/modals/ConfirmationModal.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/components/modals/ConfirmationModal.js b/src/components/modals/ConfirmationModal.js new file mode 100644 index 00000000..4543cfd4 --- /dev/null +++ b/src/components/modals/ConfirmationModal.js @@ -0,0 +1,35 @@ +import PropTypes from "prop-types"; +import React from "react"; +import Modal from "./Modal"; + +class ConfirmationModal extends React.Component { + static propTypes = { + title: PropTypes.string.isRequired, + message: PropTypes.string.isRequired, + show: PropTypes.bool.isRequired, + callback: PropTypes.func.isRequired, + }; + + onConfirm() { + this.props.callback(true); + } + + onCancel() { + this.props.callback(false); + } + + render() { + return ( + <Modal title={this.props.title} + show={this.props.show} + onSubmit={this.onConfirm.bind(this)} + onCancel={this.onCancel.bind(this)} + submitButtonType="danger" + submitButtonText="Confirm"> + {this.props.message} + </Modal> + ); + } +} + +export default ConfirmationModal; |
