lbry-desktop/src/renderer/component/walletSend/index.js
2017-12-04 17:12:59 -03:00

29 lines
857 B
JavaScript

import React from "react";
import { connect } from "react-redux";
import {
doSendDraftTransaction,
doSetDraftTransactionAmount,
doSetDraftTransactionAddress,
} from "redux/actions/wallet";
import {
selectDraftTransactionAmount,
selectDraftTransactionAddress,
selectDraftTransactionError,
} from "redux/selectors/wallet";
import WalletSend from "./view";
const select = state => ({
address: selectDraftTransactionAddress(state),
amount: selectDraftTransactionAmount(state),
error: selectDraftTransactionError(state),
});
const perform = dispatch => ({
sendToAddress: () => dispatch(doSendDraftTransaction()),
setAmount: event => dispatch(doSetDraftTransactionAmount(event.target.value)),
setAddress: event =>
dispatch(doSetDraftTransactionAddress(event.target.value)),
});
export default connect(select, perform)(WalletSend);