2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
2022-08-11 19:33:33 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
import { getOnboardingInitiator } from '../../../selectors';
|
|
|
|
import { setCompletedOnboarding } from '../../../store/actions';
|
2022-08-11 19:33:33 +02:00
|
|
|
import { EVENT_NAMES } from '../../../../shared/constants/metametrics';
|
2021-02-04 19:15:23 +01:00
|
|
|
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 = {
|
2022-08-11 19:33:33 +02:00
|
|
|
create: EVENT_NAMES.NEW_WALLET_CREATED,
|
|
|
|
import: EVENT_NAMES.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);
|