1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-05 07:24:56 +01:00
metamask-extension/ui/components/app/modals/deposit-ether-modal/deposit-ether-modal.container.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2020-11-03 00:41:28 +01:00
import {
buyEth,
hideModal,
showModal,
hideWarning,
} from '../../../../store/actions';
import {
getIsTestnet,
getIsMainnet,
getCurrentChainId,
getSelectedAddress,
} from '../../../../selectors/selectors';
import DepositEtherModal from './deposit-ether-modal.component';
2020-11-03 00:41:28 +01:00
function mapStateToProps(state) {
return {
chainId: getCurrentChainId(state),
isTestnet: getIsTestnet(state),
isMainnet: getIsMainnet(state),
address: getSelectedAddress(state),
};
}
2020-11-03 00:41:28 +01:00
function mapDispatchToProps(dispatch) {
return {
toWyre: (address) => {
dispatch(buyEth({ service: 'wyre', address }));
},
toTransak: (address) => {
dispatch(buyEth({ service: 'transak', address }));
},
hideModal: () => {
dispatch(hideModal());
},
hideWarning: () => {
dispatch(hideWarning());
},
showAccountDetailModal: () => {
dispatch(showModal({ name: 'ACCOUNT_DETAILS' }));
},
toFaucet: (chainId) => dispatch(buyEth({ chainId })),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(DepositEtherModal);