diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-02-14 02:50:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-14 02:50:19 +0800 |
commit | ee1197192f2f539d5e63c8d65f77a5cd94bbd7df (patch) | |
tree | 16917a2467eb28d2fc24212d0ad1416480b716a5 /ui/app/components/modals/notification-modals/confirm-reset-account.js | |
parent | 96d40ee618fc158c0e447f770d9077ba145ef91f (diff) | |
parent | cd976a2765b9e442642faec8a985c049f8cb393b (diff) | |
download | tangerine-wallet-browser-ee1197192f2f539d5e63c8d65f77a5cd94bbd7df.tar.gz tangerine-wallet-browser-ee1197192f2f539d5e63c8d65f77a5cd94bbd7df.tar.zst tangerine-wallet-browser-ee1197192f2f539d5e63c8d65f77a5cd94bbd7df.zip |
Merge pull request #3209 from danjm/MM-634-newui-reset-account
[NewUI] Add reset account button to new UI.
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) |