2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { showModal, setAccountLabel } from '../../../../store/actions';
|
2020-05-04 21:06:28 +02:00
|
|
|
import {
|
|
|
|
getSelectedIdentity,
|
|
|
|
getRpcPrefsForCurrentProvider,
|
2021-03-10 18:21:52 +01:00
|
|
|
getCurrentChainId,
|
2021-12-16 11:41:55 +01:00
|
|
|
getMetaMaskAccountsOrdered,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../../../selectors';
|
|
|
|
import AccountDetailsModal from './account-details-modal.component';
|
2019-06-27 17:03:18 +02:00
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
|
return {
|
2021-03-10 18:21:52 +01:00
|
|
|
chainId: getCurrentChainId(state),
|
2019-06-27 17:03:18 +02:00
|
|
|
selectedIdentity: getSelectedIdentity(state),
|
|
|
|
keyrings: state.metamask.keyrings,
|
|
|
|
rpcPrefs: getRpcPrefsForCurrentProvider(state),
|
2021-12-16 11:41:55 +01:00
|
|
|
accounts: getMetaMaskAccountsOrdered(state),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-06-27 17:03:18 +02:00
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
return {
|
2020-11-03 00:41:28 +01:00
|
|
|
showExportPrivateKeyModal: () =>
|
|
|
|
dispatch(showModal({ name: 'EXPORT_PRIVATE_KEY' })),
|
|
|
|
setAccountLabel: (address, label) =>
|
|
|
|
dispatch(setAccountLabel(address, label)),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2019-06-27 17:03:18 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default connect(
|
|
|
|
mapStateToProps,
|
|
|
|
mapDispatchToProps,
|
|
|
|
)(AccountDetailsModal);
|