From 19033b8460cb43dc2fa34a2cffa932b5efe111ca Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sat, 19 Aug 2017 15:39:58 +0200 Subject: Add profile page --- src/components/modals/ConfirmationModal.js | 35 ++++++++++++++++++++++++++++++ src/components/modals/Modal.js | 14 +++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 src/components/modals/ConfirmationModal.js (limited to 'src/components/modals') 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 ( + + {this.props.message} + + ); + } +} + +export default ConfirmationModal; diff --git a/src/components/modals/Modal.js b/src/components/modals/Modal.js index 0b3301af..06273a46 100644 --- a/src/components/modals/Modal.js +++ b/src/components/modals/Modal.js @@ -1,3 +1,4 @@ +import classNames from "classnames"; import PropTypes from "prop-types"; import React from "react"; @@ -7,6 +8,12 @@ class Modal extends React.Component { show: PropTypes.bool.isRequired, onSubmit: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, + submitButtonType: PropTypes.string, + submitButtonText: PropTypes.string, + }; + static defaultProps = { + submitButtonType: "primary", + submitButtonText: "Save", }; static idCounter = 0; @@ -83,7 +90,7 @@ class Modal extends React.Component {
{this.props.title}
@@ -93,8 +100,9 @@ class Modal extends React.Component { -
-- cgit v1.2.3