2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { getOnboardingInitiator } from '../../../selectors';
|
|
|
|
import { setCompletedOnboarding } from '../../../store/actions';
|
|
|
|
import EndOfFlow from './end-of-flow.component';
|
2019-02-27 15:46:41 +01:00
|
|
|
|
2019-03-05 16:45:01 +01:00
|
|
|
const firstTimeFlowTypeNameMap = {
|
|
|
|
create: 'New Wallet Created',
|
2020-11-03 00:41:28 +01:00
|
|
|
import: 'New Wallet Imported',
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-03-05 16:45:01 +01:00
|
|
|
|
2019-11-22 18:03:51 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2020-11-03 00:41:28 +01:00
|
|
|
const {
|
|
|
|
metamask: { firstTimeFlowType },
|
2021-02-04 19:15:23 +01:00
|
|
|
} = state;
|
2019-03-05 16:45:01 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
completionMetaMetricsName: firstTimeFlowTypeNameMap[firstTimeFlowType],
|
2019-11-22 18:03:51 +01:00
|
|
|
onboardingInitiator: getOnboardingInitiator(state),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-03-05 16:45:01 +01:00
|
|
|
|
2020-11-10 22:27:08 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
return {
|
|
|
|
setCompletedOnboarding: () => dispatch(setCompletedOnboarding()),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2020-11-10 22:27:08 +01:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(EndOfFlow);
|