2021-02-04 19:15:23 +01:00
|
|
|
import { compose } from 'redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { withRouter } from 'react-router-dom';
|
2019-03-25 17:13:23 +01:00
|
|
|
import {
|
2019-08-21 20:42:14 +02:00
|
|
|
setFeatureFlag,
|
2019-03-25 17:13:23 +01:00
|
|
|
setParticipateInMetaMetrics,
|
2020-02-27 07:29:41 +01:00
|
|
|
setUsePhishDetect,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../../store/actions';
|
|
|
|
import SecurityTab from './security-tab.component';
|
2019-03-25 17:13:23 +01:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2019-03-25 17:13:23 +01:00
|
|
|
const {
|
2020-11-03 00:41:28 +01:00
|
|
|
appState: { warning },
|
|
|
|
metamask,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = state;
|
2020-11-03 00:41:28 +01:00
|
|
|
const {
|
|
|
|
featureFlags: { showIncomingTransactions } = {},
|
2019-03-25 17:13:23 +01:00
|
|
|
participateInMetaMetrics,
|
2020-02-27 07:29:41 +01:00
|
|
|
usePhishDetect,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = metamask;
|
2019-03-25 17:13:23 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
warning,
|
2019-08-21 20:42:14 +02:00
|
|
|
showIncomingTransactions,
|
2019-03-25 17:13:23 +01:00
|
|
|
participateInMetaMetrics,
|
2020-02-27 07:29:41 +01:00
|
|
|
usePhishDetect,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-03-25 17:13:23 +01:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
2019-03-25 17:13:23 +01:00
|
|
|
return {
|
2020-11-03 00:41:28 +01:00
|
|
|
setParticipateInMetaMetrics: (val) =>
|
|
|
|
dispatch(setParticipateInMetaMetrics(val)),
|
|
|
|
setShowIncomingTransactionsFeatureFlag: (shouldShow) =>
|
|
|
|
dispatch(setFeatureFlag('showIncomingTransactions', shouldShow)),
|
2020-02-27 07:29:41 +01:00
|
|
|
setUsePhishDetect: (val) => dispatch(setUsePhishDetect(val)),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-03-25 17:13:23 +01:00
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withRouter,
|
2020-07-14 17:20:41 +02:00
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
2021-02-04 19:15:23 +01:00
|
|
|
)(SecurityTab);
|