You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
967 B
32 lines
967 B
6 years ago
|
import { connect } from 'react-redux'
|
||
|
import FirstTimeFlow from './first-time-flow.component'
|
||
6 years ago
|
import { getFirstTimeFlowTypeRoute } from './first-time-flow.selectors'
|
||
6 years ago
|
import {
|
||
|
createNewVaultAndGetSeedPhrase,
|
||
|
createNewVaultAndRestore,
|
||
|
unlockAndGetSeedPhrase,
|
||
6 years ago
|
} from '../../store/actions'
|
||
6 years ago
|
|
||
|
const mapStateToProps = state => {
|
||
6 years ago
|
const { metamask: { completedOnboarding, isInitialized, isUnlocked } } = state
|
||
6 years ago
|
|
||
|
return {
|
||
|
completedOnboarding,
|
||
|
isInitialized,
|
||
|
isUnlocked,
|
||
6 years ago
|
nextRoute: getFirstTimeFlowTypeRoute(state),
|
||
6 years ago
|
}
|
||
|
}
|
||
|
|
||
|
const mapDispatchToProps = dispatch => {
|
||
|
return {
|
||
|
createNewAccount: password => dispatch(createNewVaultAndGetSeedPhrase(password)),
|
||
|
createNewAccountFromSeed: (password, seedPhrase) => {
|
||
|
return dispatch(createNewVaultAndRestore(password, seedPhrase))
|
||
|
},
|
||
|
unlockAccount: password => dispatch(unlockAndGetSeedPhrase(password)),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default connect(mapStateToProps, mapDispatchToProps)(FirstTimeFlow)
|