2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-11-03 00:41:28 +01:00
|
|
|
import {
|
|
|
|
buyEth,
|
|
|
|
hideModal,
|
|
|
|
showModal,
|
|
|
|
hideWarning,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../../../store/actions';
|
2021-03-12 23:23:26 +01:00
|
|
|
import {
|
|
|
|
getIsTestnet,
|
|
|
|
getIsMainnet,
|
|
|
|
getCurrentChainId,
|
|
|
|
getSelectedAddress,
|
|
|
|
} from '../../../../selectors/selectors';
|
2021-02-04 19:15:23 +01:00
|
|
|
import DepositEtherModal from './deposit-ether-modal.component';
|
2019-11-27 17:14:02 +01:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
function mapStateToProps(state) {
|
2019-11-27 17:14:02 +01:00
|
|
|
return {
|
2021-03-12 23:23:26 +01:00
|
|
|
chainId: getCurrentChainId(state),
|
2021-02-16 16:31:16 +01:00
|
|
|
isTestnet: getIsTestnet(state),
|
|
|
|
isMainnet: getIsMainnet(state),
|
2021-03-12 23:23:26 +01:00
|
|
|
address: getSelectedAddress(state),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-11-27 17:14:02 +01:00
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
function mapDispatchToProps(dispatch) {
|
2019-11-27 17:14:02 +01:00
|
|
|
return {
|
|
|
|
toWyre: (address) => {
|
2021-02-04 19:15:23 +01:00
|
|
|
dispatch(buyEth({ service: 'wyre', address }));
|
2019-11-27 17:14:02 +01:00
|
|
|
},
|
2021-06-25 15:10:24 +02:00
|
|
|
toTransak: (address) => {
|
|
|
|
dispatch(buyEth({ service: 'transak', address }));
|
|
|
|
},
|
2019-11-27 17:14:02 +01:00
|
|
|
hideModal: () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
dispatch(hideModal());
|
2019-11-27 17:14:02 +01:00
|
|
|
},
|
|
|
|
hideWarning: () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
dispatch(hideWarning());
|
2019-11-27 17:14:02 +01:00
|
|
|
},
|
|
|
|
showAccountDetailModal: () => {
|
2021-02-04 19:15:23 +01:00
|
|
|
dispatch(showModal({ name: 'ACCOUNT_DETAILS' }));
|
2019-11-27 17:14:02 +01:00
|
|
|
},
|
2021-03-12 23:23:26 +01:00
|
|
|
toFaucet: (chainId) => dispatch(buyEth({ chainId })),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2019-11-27 17:14:02 +01:00
|
|
|
}
|
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(DepositEtherModal);
|