2021-03-25 12:24:49 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { withRouter } from 'react-router';
|
|
|
|
import WalletSwap from './view';
|
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
2021-04-08 11:02:37 +02:00
|
|
|
import { doAddCoinSwap, doQueryCoinSwapStatus } from 'redux/actions/coinSwap';
|
2021-03-25 12:24:49 +01:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2021-04-04 09:10:55 +02:00
|
|
|
import { selectCoinSwaps } from 'redux/selectors/coinSwap';
|
2021-04-05 07:12:19 +02:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { doGetNewAddress, doCheckAddressIsMine } from 'redux/actions/wallet';
|
|
|
|
import { selectReceiveAddress } from 'redux/selectors/wallet';
|
2021-03-25 12:24:49 +01:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
receiveAddress: selectReceiveAddress(state),
|
2021-04-04 09:10:55 +02:00
|
|
|
coinSwaps: selectCoinSwaps(state),
|
2021-04-05 07:12:19 +02:00
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2021-03-25 12:24:49 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
|
|
|
doToast: (options) => dispatch(doToast(options)),
|
2021-04-04 09:10:55 +02:00
|
|
|
addCoinSwap: (coinSwap) => dispatch(doAddCoinSwap(coinSwap)),
|
2021-03-25 12:24:49 +01:00
|
|
|
getNewAddress: () => dispatch(doGetNewAddress()),
|
|
|
|
checkAddressIsMine: (address) => dispatch(doCheckAddressIsMine(address)),
|
2021-04-08 11:02:37 +02:00
|
|
|
queryCoinSwapStatus: (sendAddress) => dispatch(doQueryCoinSwapStatus(sendAddress)),
|
2021-03-25 12:24:49 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default withRouter(connect(select, perform)(WalletSwap));
|