diff options
author | Dan <danjm.com@gmail.com> | 2018-03-07 08:15:45 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-03-07 08:15:45 +0800 |
commit | 9d215bab0fe124f036d2ac41f375331c8d43b72b (patch) | |
tree | 6bbbdb2e6a2dcd5948ee8473cad152232c73643b /ui/app/components/modals/notification-modals/confirm-reset-account.js | |
parent | f06bca1151b07d908cd90f6efd97064e288e5f27 (diff) | |
parent | 9762a730413129361062804aa8dfc7be7cf74868 (diff) | |
download | tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.tar.gz tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.tar.zst tangerine-wallet-browser-9d215bab0fe124f036d2ac41f375331c8d43b72b.zip |
Merge branch 'master' into i18n
Diffstat (limited to 'ui/app/components/modals/notification-modals/confirm-reset-account.js')
-rw-r--r-- | ui/app/components/modals/notification-modals/confirm-reset-account.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ui/app/components/modals/notification-modals/confirm-reset-account.js b/ui/app/components/modals/notification-modals/confirm-reset-account.js new file mode 100644 index 000000000..e1bc91b24 --- /dev/null +++ b/ui/app/components/modals/notification-modals/confirm-reset-account.js @@ -0,0 +1,46 @@ +const { Component } = require('react') +const PropTypes = require('prop-types') +const h = require('react-hyperscript') +const { connect } = require('react-redux') +const actions = require('../../../actions') +const NotifcationModal = require('../notification-modal') + +class ConfirmResetAccount extends Component { + render () { + const { resetAccount } = this.props + + return h(NotifcationModal, { + header: 'Are you sure you want to reset account?', + message: h('div', [ + + h('span', `Resetting is for developer use only. This button wipes the current account's transaction history, + which is used to calculate the current account nonce. `), + + h('a.notification-modal__link', { + href: 'http://metamask.helpscoutdocs.com/article/36-resetting-an-account', + target: '_blank', + onClick (event) { global.platform.openWindow({ url: event.target.href }) }, + }, 'Read more.'), + + ]), + showCancelButton: true, + showConfirmButton: true, + onConfirm: resetAccount, + + }) + } +} + +ConfirmResetAccount.propTypes = { + resetAccount: PropTypes.func, +} + +const mapDispatchToProps = dispatch => { + return { + resetAccount: () => { + dispatch(actions.resetAccount()) + }, + } +} + +module.exports = connect(null, mapDispatchToProps)(ConfirmResetAccount) |