2020-02-24 23:58:26 +01:00
|
|
|
import { compose } from 'redux'
|
2019-03-25 17:13:23 +01:00
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import { withRouter } from 'react-router-dom'
|
|
|
|
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,
|
2019-03-25 17:13:23 +01:00
|
|
|
} from '../../../store/actions'
|
2020-08-18 21:18:25 +02:00
|
|
|
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,
|
|
|
|
} = state
|
|
|
|
const {
|
|
|
|
featureFlags: { showIncomingTransactions } = {},
|
2019-03-25 17:13:23 +01:00
|
|
|
participateInMetaMetrics,
|
2020-02-27 07:29:41 +01:00
|
|
|
usePhishDetect,
|
2019-03-25 17:13:23 +01:00
|
|
|
} = metamask
|
|
|
|
|
|
|
|
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,
|
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)),
|
2019-03-25 17:13:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withRouter,
|
2020-07-14 17:20:41 +02:00
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
2019-03-25 17:13:23 +01:00
|
|
|
)(SecurityTab)
|