import { compose } from 'redux'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import { setFeatureFlag, setParticipateInMetaMetrics, setUsePhishDetect, setUseTokenDetection, setIpfsGateway, setUseMultiAccountBalanceChecker, setUseCurrencyRateCheck, setUseNftDetection, setOpenSeaEnabled, } from '../../../store/actions'; import { getOpenSeaEnabled, getUseNftDetection } from '../../../selectors'; import SecurityTab from './security-tab.component'; const mapStateToProps = (state) => { const { appState: { warning }, metamask, } = state; const { featureFlags: { showIncomingTransactions } = {}, participateInMetaMetrics, usePhishDetect, useTokenDetection, ipfsGateway, useMultiAccountBalanceChecker, useCurrencyRateCheck, } = metamask; return { warning, showIncomingTransactions, participateInMetaMetrics, usePhishDetect, useTokenDetection, ipfsGateway, useMultiAccountBalanceChecker, useCurrencyRateCheck, useNftDetection: getUseNftDetection(state), openSeaEnabled: getOpenSeaEnabled(state), }; }; const mapDispatchToProps = (dispatch) => { return { setParticipateInMetaMetrics: (val) => dispatch(setParticipateInMetaMetrics(val)), setShowIncomingTransactionsFeatureFlag: (shouldShow) => dispatch(setFeatureFlag('showIncomingTransactions', shouldShow)), setUsePhishDetect: (val) => dispatch(setUsePhishDetect(val)), setUseCurrencyRateCheck: (val) => dispatch(setUseCurrencyRateCheck(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);