1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +01:00
metamask-extension/ui/pages/settings/security-tab/security-tab.container.js

69 lines
1.9 KiB
JavaScript
Raw Normal View History

import { compose } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {
setFeatureFlag,
setParticipateInMetaMetrics,
setUsePhishDetect,
setUseTokenDetection,
setIpfsGateway,
setUseMultiAccountBalanceChecker,
setUseNftDetection,
setOpenSeaEnabled,
} from '../../../store/actions';
import { getOpenSeaEnabled, getUseNftDetection } from '../../../selectors';
import SecurityTab from './security-tab.component';
2020-02-15 21:34:12 +01:00
const mapStateToProps = (state) => {
const {
2020-11-03 00:41:28 +01:00
appState: { warning },
metamask,
} = state;
2020-11-03 00:41:28 +01:00
const {
featureFlags: { showIncomingTransactions } = {},
participateInMetaMetrics,
usePhishDetect,
useTokenDetection,
ipfsGateway,
useMultiAccountBalanceChecker,
} = metamask;
return {
warning,
showIncomingTransactions,
participateInMetaMetrics,
usePhishDetect,
useTokenDetection,
ipfsGateway,
useMultiAccountBalanceChecker,
useNftDetection: getUseNftDetection(state),
openSeaEnabled: getOpenSeaEnabled(state),
};
};
2020-02-15 21:34:12 +01:00
const mapDispatchToProps = (dispatch) => {
return {
2020-11-03 00:41:28 +01:00
setParticipateInMetaMetrics: (val) =>
dispatch(setParticipateInMetaMetrics(val)),
setShowIncomingTransactionsFeatureFlag: (shouldShow) =>
dispatch(setFeatureFlag('showIncomingTransactions', shouldShow)),
setUsePhishDetect: (val) => dispatch(setUsePhishDetect(val)),
setUseTokenDetection: (value) => {
return dispatch(setUseTokenDetection(value));
},
setIpfsGateway: (value) => {
return dispatch(setIpfsGateway(value));
},
setUseMultiAccountBalanceChecker: (value) => {
return dispatch(setUseMultiAccountBalanceChecker(value));
},
setUseNftDetection: (val) => dispatch(setUseNftDetection(val)),
setOpenSeaEnabled: (val) => dispatch(setOpenSeaEnabled(val)),
};
};
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps),
)(SecurityTab);