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',
|
2020-11-03 00:41:28 +01:00
|
|
|
import: 'Selected Import Wallet',
|
2019-03-05 16:45:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
|
const { firstTimeFlowType, participateInMetaMetrics } = state.metamask
|
|
|
|
|
|
|
|
return {
|
|
|
|
nextRoute: getFirstTimeFlowTypeRoute(state),
|
2020-11-03 00:41:28 +01:00
|
|
|
firstTimeSelectionMetaMetricsName:
|
|
|
|
firstTimeFlowTypeNameMap[firstTimeFlowType],
|
2019-03-05 16:45:01 +01:00
|
|
|
participateInMetaMetrics,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
2019-03-05 16:45:01 +01:00
|
|
|
return {
|
2020-11-03 00:41:28 +01:00
|
|
|
setParticipateInMetaMetrics: (val) =>
|
|
|
|
dispatch(setParticipateInMetaMetrics(val)),
|
2019-03-05 16:45:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(MetaMetricsOptIn)
|