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/experimental-tab/experimental-tab.container.js
2022-12-09 00:07:06 +05:30

43 lines
1.3 KiB
JavaScript

import { compose } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {
setUseNftDetection,
setOpenSeaEnabled,
setImprovedTokenAllowanceEnabled,
setTransactionSecurityCheckEnabled,
} from '../../../store/actions';
import {
getUseNftDetection,
getOpenSeaEnabled,
getIsImprovedTokenAllowanceEnabled,
getIsTransactionSecurityCheckEnabled,
} from '../../../selectors';
import ExperimentalTab from './experimental-tab.component';
const mapStateToProps = (state) => {
return {
useNftDetection: getUseNftDetection(state),
openSeaEnabled: getOpenSeaEnabled(state),
improvedTokenAllowanceEnabled: getIsImprovedTokenAllowanceEnabled(state),
transactionSecurityCheckEnabled:
getIsTransactionSecurityCheckEnabled(state),
};
};
const mapDispatchToProps = (dispatch) => {
return {
setUseNftDetection: (val) => dispatch(setUseNftDetection(val)),
setOpenSeaEnabled: (val) => dispatch(setOpenSeaEnabled(val)),
setImprovedTokenAllowanceEnabled: (val) =>
dispatch(setImprovedTokenAllowanceEnabled(val)),
setTransactionSecurityCheckEnabled: (val) =>
dispatch(setTransactionSecurityCheckEnabled(val)),
};
};
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps),
)(ExperimentalTab);