diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-01 16:42:13 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:56 +0200 |
| commit | 17ae0a3fafd806a5a533bf1d51a3ac708a8cf978 (patch) | |
| tree | c3687bd08891ef3698f4773e44a6920856229dfe /src/containers/modals/DeleteProfileModal.js | |
| parent | eea529f57e3ee39d2f492062688b2848ced0a747 (diff) | |
Implement room name edit
Diffstat (limited to 'src/containers/modals/DeleteProfileModal.js')
| -rw-r--r-- | src/containers/modals/DeleteProfileModal.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/containers/modals/DeleteProfileModal.js b/src/containers/modals/DeleteProfileModal.js new file mode 100644 index 00000000..0108a1eb --- /dev/null +++ b/src/containers/modals/DeleteProfileModal.js @@ -0,0 +1,36 @@ +import React from "react"; +import {connect} from "react-redux"; +import {closeDeleteProfileModal} from "../../actions/modals/profile"; +import {deleteCurrentUser} from "../../actions/users"; +import ConfirmationModal from "../../components/modals/ConfirmationModal"; + +const NewSimulationModalComponent = ({visible, callback}) => ( + <ConfirmationModal title="Delete my account" + message="Are you sure you want do delete your OpenDC account?" + show={visible} + callback={callback}/> +); + +const mapStateToProps = state => { + return { + visible: state.modals.deleteProfileModalVisible + }; +}; + +const mapDispatchToProps = dispatch => { + return { + callback: (isConfirmed) => { + if (isConfirmed) { + dispatch(deleteCurrentUser()); + } + dispatch(closeDeleteProfileModal()); + } + }; +}; + +const NewSimulationModal = connect( + mapStateToProps, + mapDispatchToProps +)(NewSimulationModalComponent); + +export default NewSimulationModal; |
