2019-03-05 16:45:01 +01:00
|
|
|
import { connect } from 'react-redux'
|
2019-03-22 00:03:30 +01:00
|
|
|
import { setParticipateInMetaMetrics } from '../../../store/actions'
|
2020-05-04 17:22:34 +02:00
|
|
|
import { getFirstTimeFlowTypeRoute } from '../../../selectors'
|
2020-08-18 21:18:25 +02:00
|
|
|
import MetaMetricsOptIn from './metametrics-opt-in.component'
|
2019-03-05 16:45:01 +01:00
|
|
|
|
|
|
|
const firstTimeFlowTypeNameMap = {
|
|
|
|
create: 'Selected Create New Wallet',
|
|
|
|
'import': 'Selected Import Wallet',
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
|
const { firstTimeFlowType, participateInMetaMetrics } = state.metamask
|
|
|
|
|
|
|
|
return {
|
|
|
|
nextRoute: getFirstTimeFlowTypeRoute(state),
|
|
|
|
firstTimeSelectionMetaMetricsName: firstTimeFlowTypeNameMap[firstTimeFlowType],
|
|
|
|
participateInMetaMetrics,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
2019-03-05 16:45:01 +01:00
|
|
|
return {
|
|
|
|
setParticipateInMetaMetrics: (val) => dispatch(setParticipateInMetaMetrics(val)),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(MetaMetricsOptIn)
|