2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { compose } from 'redux';
|
|
|
|
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props';
|
2021-03-10 18:21:52 +01:00
|
|
|
import {
|
|
|
|
getCurrentChainId,
|
|
|
|
getRpcPrefsForCurrentProvider,
|
|
|
|
} from '../../../../selectors';
|
2021-02-04 19:15:23 +01:00
|
|
|
import { removeAccount } from '../../../../store/actions';
|
|
|
|
import ConfirmRemoveAccount from './confirm-remove-account.component';
|
2018-07-11 01:19:29 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2018-07-11 06:20:40 +02:00
|
|
|
return {
|
2021-03-10 18:21:52 +01:00
|
|
|
chainId: getCurrentChainId(state),
|
|
|
|
rpcPrefs: getRpcPrefsForCurrentProvider(state),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2018-07-11 06:20:40 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
2018-07-11 01:19:29 +02:00
|
|
|
return {
|
|
|
|
removeAccount: (address) => dispatch(removeAccount(address)),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2018-07-11 01:19:29 +02:00
|
|
|
|
2018-09-17 19:34:29 +02:00
|
|
|
export default compose(
|
|
|
|
withModalProps,
|
2020-07-14 17:20:41 +02:00
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
2021-02-04 19:15:23 +01:00
|
|
|
)(ConfirmRemoveAccount);
|