2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { setParticipateInMetaMetrics } from '../../../store/actions';
|
|
|
|
import { getFirstTimeFlowTypeRoute } from '../../../selectors';
|
|
|
|
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',
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-03-05 16:45:01 +01:00
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { firstTimeFlowType, participateInMetaMetrics } = state.metamask;
|
2019-03-05 16:45:01 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
nextRoute: getFirstTimeFlowTypeRoute(state),
|
2020-11-03 00:41:28 +01:00
|
|
|
firstTimeSelectionMetaMetricsName:
|
|
|
|
firstTimeFlowTypeNameMap[firstTimeFlowType],
|
2019-03-05 16:45:01 +01:00
|
|
|
participateInMetaMetrics,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-03-05 16:45:01 +01:00
|
|
|
|
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)),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-03-05 16:45:01 +01:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(MetaMetricsOptIn);
|