mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 11:01:41 +01:00
54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import {
|
|
buyEth,
|
|
hideModal,
|
|
showModal,
|
|
hideWarning,
|
|
} from '../../../../store/actions';
|
|
import {
|
|
getIsTestnet,
|
|
getIsMainnet,
|
|
getCurrentChainId,
|
|
getSelectedAddress,
|
|
getIsBuyableTransakChain,
|
|
getIsBuyableMoonPayChain,
|
|
} from '../../../../selectors/selectors';
|
|
import DepositEtherModal from './deposit-ether-modal.component';
|
|
|
|
function mapStateToProps(state) {
|
|
return {
|
|
chainId: getCurrentChainId(state),
|
|
isTestnet: getIsTestnet(state),
|
|
isMainnet: getIsMainnet(state),
|
|
address: getSelectedAddress(state),
|
|
isBuyableTransakChain: getIsBuyableTransakChain(state),
|
|
isBuyableMoonPayChain: getIsBuyableMoonPayChain(state),
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
toWyre: (address) => {
|
|
dispatch(buyEth({ service: 'wyre', address }));
|
|
},
|
|
toTransak: (address, chainId) => {
|
|
dispatch(buyEth({ service: 'transak', address, chainId }));
|
|
},
|
|
toMoonPay: (address, chainId) => {
|
|
dispatch(buyEth({ service: 'moonpay', address, chainId }));
|
|
},
|
|
hideModal: () => {
|
|
dispatch(hideModal());
|
|
},
|
|
hideWarning: () => {
|
|
dispatch(hideWarning());
|
|
},
|
|
showAccountDetailModal: () => {
|
|
dispatch(showModal({ name: 'ACCOUNT_DETAILS' }));
|
|
},
|
|
toFaucet: (chainId) => dispatch(buyEth({ chainId })),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(DepositEtherModal);
|