diff options
author | Dan <danjm.com@gmail.com> | 2018-06-01 02:09:24 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-06-01 02:09:24 +0800 |
commit | 701611e317d120d2c0530e4794bd498a74e233b2 (patch) | |
tree | 4ec098d593de7ff5fe20907a48c56061cc14de54 /ui/app/components/modals/confirm-reset-account | |
parent | 1bde2892ec222cec1ba3265d50ed59f665afbf83 (diff) | |
parent | 2ca084b0557242b34733107701a14ba0724363b3 (diff) | |
download | tangerine-wallet-browser-701611e317d120d2c0530e4794bd498a74e233b2.tar.gz tangerine-wallet-browser-701611e317d120d2c0530e4794bd498a74e233b2.tar.zst tangerine-wallet-browser-701611e317d120d2c0530e4794bd498a74e233b2.zip |
Merge branch 'i3725-refactor-send-component-' into i3914-fix-newui-send-gas-estimation
Diffstat (limited to 'ui/app/components/modals/confirm-reset-account')
3 files changed, 69 insertions, 0 deletions
diff --git a/ui/app/components/modals/confirm-reset-account/confirm-reset-account.component.js b/ui/app/components/modals/confirm-reset-account/confirm-reset-account.component.js new file mode 100644 index 000000000..14a4da62a --- /dev/null +++ b/ui/app/components/modals/confirm-reset-account/confirm-reset-account.component.js @@ -0,0 +1,54 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import Button from '../../button' + +class ConfirmResetAccount extends Component { + static propTypes = { + hideModal: PropTypes.func.isRequired, + resetAccount: PropTypes.func.isRequired, + } + + static contextTypes = { + t: PropTypes.func, + } + + handleReset () { + this.props.resetAccount() + .then(() => this.props.hideModal()) + } + + render () { + const { t } = this.context + + return ( + <div className="modal-container"> + <div className="modal-container__content"> + <div className="modal-container__title"> + { `${t('resetAccount')}?` } + </div> + <div className="modal-container__description"> + { t('resetAccountDescription') } + </div> + </div> + <div className="modal-container__footer"> + <Button + type="default" + className="modal-container__footer-button" + onClick={() => this.props.hideModal()} + > + { t('nevermind') } + </Button> + <Button + type="secondary" + className="modal-container__footer-button" + onClick={() => this.handleReset()} + > + { t('reset') } + </Button> + </div> + </div> + ) + } +} + +export default ConfirmResetAccount diff --git a/ui/app/components/modals/confirm-reset-account/confirm-reset-account.container.js b/ui/app/components/modals/confirm-reset-account/confirm-reset-account.container.js new file mode 100644 index 000000000..9630a5593 --- /dev/null +++ b/ui/app/components/modals/confirm-reset-account/confirm-reset-account.container.js @@ -0,0 +1,13 @@ +import { connect } from 'react-redux' +import ConfirmResetAccount from './confirm-reset-account.component' + +const { hideModal, resetAccount } = require('../../../actions') + +const mapDispatchToProps = dispatch => { + return { + hideModal: () => dispatch(hideModal()), + resetAccount: () => dispatch(resetAccount()), + } +} + +export default connect(null, mapDispatchToProps)(ConfirmResetAccount) diff --git a/ui/app/components/modals/confirm-reset-account/index.js b/ui/app/components/modals/confirm-reset-account/index.js new file mode 100644 index 000000000..c812ffc55 --- /dev/null +++ b/ui/app/components/modals/confirm-reset-account/index.js @@ -0,0 +1,2 @@ +import ConfirmResetAccount from './confirm-reset-account.container' +module.exports = ConfirmResetAccount |