1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 23:14:56 +01:00
metamask-extension/ui/components/app/modals/account-details-modal/account-details-modal.container.js
filipsekulic 62f41600f2
Fix account name duplicates (#12867)
* Fix account name duplicates

* Change button disabling logic

* Fix function error

* Requested changes

* Move functions from selectors file into components

* Applying requested changes
2021-12-16 07:11:55 -03:30

34 lines
953 B
JavaScript

import { connect } from 'react-redux';
import { showModal, setAccountLabel } from '../../../../store/actions';
import {
getSelectedIdentity,
getRpcPrefsForCurrentProvider,
getCurrentChainId,
getMetaMaskAccountsOrdered,
} from '../../../../selectors';
import AccountDetailsModal from './account-details-modal.component';
const mapStateToProps = (state) => {
return {
chainId: getCurrentChainId(state),
selectedIdentity: getSelectedIdentity(state),
keyrings: state.metamask.keyrings,
rpcPrefs: getRpcPrefsForCurrentProvider(state),
accounts: getMetaMaskAccountsOrdered(state),
};
};
const mapDispatchToProps = (dispatch) => {
return {
showExportPrivateKeyModal: () =>
dispatch(showModal({ name: 'EXPORT_PRIVATE_KEY' })),
setAccountLabel: (address, label) =>
dispatch(setAccountLabel(address, label)),
};
};
export default connect(
mapStateToProps,
mapDispatchToProps,
)(AccountDetailsModal);