lbry-desktop/ui/js/component/tipLink/index.js
2017-08-08 03:49:22 +05:30

28 lines
851 B
JavaScript

import React from "react";
import { connect } from "react-redux";
import {
doSendDraftTransaction,
doSetDraftTransactionAmount,
doSetDraftTransactionAddress,
} from "actions/wallet";
import { selectCurrentModal } from "selectors/app";
import { doCloseModal, doOpenModal } from "actions/app";
import TipLink from "./view";
const makeSelect = () => {
const select = (state, props) => ({
modal: selectCurrentModal(state),
});
return select;
};
const perform = dispatch => ({
closeModal: () => dispatch(doCloseModal()),
openModal: modal => dispatch(doOpenModal(modal)),
sendToAddress: () => dispatch(doSendDraftTransaction()),
setAmount: amount => dispatch(doSetDraftTransactionAmount(amount)),
setAddress: address => dispatch(doSetDraftTransactionAddress(address)),
});
export default connect(makeSelect, perform)(TipLink);