1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-25 04:40:18 +02:00
metamask-extension/ui/app/pages/create-account/create-account.container.js
ricky 7181779576
Refactor new-account.js (#7312)
* Start refactor

* Use import syntax

* Add create-account.component

* Continue refactor

* Add new line

* Start using JSX and make tabs a bit more DRY

* 👋 bye-bye hyperscript

* These can be disabled when active

* Start JSX in new account component

* 👋 bye-bye hyperscript

* Move newAccountNumber into container

* Validate newAccountNumber prop
2019-10-29 12:12:41 -04:00

21 lines
818 B
JavaScript

import { connect } from 'react-redux'
import actions from '../../store/actions'
import { getCurrentViewContext } from '../../selectors/selectors'
import CreateAccountPage from './create-account.component'
const mapStateToProps = state => ({
displayedForm: getCurrentViewContext(state),
})
const mapDispatchToProps = dispatch => ({
displayForm: form => dispatch(actions.setNewAccountForm(form)),
showQrView: (selected, identity) => dispatch(actions.showQrView(selected, identity)),
showExportPrivateKeyModal: () => {
dispatch(actions.showModal({ name: 'EXPORT_PRIVATE_KEY' }))
},
hideModal: () => dispatch(actions.hideModal()),
setAccountLabel: (address, label) => dispatch(actions.setAccountLabel(address, label)),
})
export default connect(mapStateToProps, mapDispatchToProps)(CreateAccountPage)