fix: send tip

This commit is contained in:
Sean Yesmunt 2018-04-03 19:58:58 -04:00
parent 402bba5835
commit 93bd6a1d31
2 changed files with 8 additions and 7 deletions

View file

@ -1,17 +1,17 @@
import React from 'react';
import { connect } from 'react-redux';
import { doSendSupport } from 'redux/actions/wallet';
import WalletSendTip from './view';
import { makeSelectTitleForUri } from 'redux/selectors/claims';
import { makeSelectTitleForUri, makeSelectClaimForUri } from 'redux/selectors/claims';
import { selectIsSendingSupport } from 'redux/selectors/wallet';
import WalletSendTip from './view';
const select = (state, props) => ({
isPending: selectIsSendingSupport(state),
title: makeSelectTitleForUri(props.uri)(state),
claim: makeSelectClaimForUri(props.uri)(state),
});
const perform = dispatch => ({
sendSupport: (amount, claim_id, uri) => dispatch(doSendSupport(amount, claim_id, uri)),
sendSupport: (amount, claimId, uri) => dispatch(doSendSupport(amount, claimId, uri)),
});
export default connect(select, perform)(WalletSendTip);

View file

@ -5,9 +5,9 @@ import { FormField } from 'component/common/form';
import UriIndicator from 'component/uriIndicator';
type Props = {
claim_id: string,
uri: string,
title: string,
claim: { claim_id: string },
errorMessage: string,
isPending: boolean,
sendSupport: (number, string, string) => void,
@ -31,7 +31,8 @@ class WalletSendTip extends React.PureComponent<Props, State> {
}
handleSendButtonClicked() {
const { claim_id: claimId, uri, sendSupport, sendTipCallback } = this.props;
const { claim, uri, sendSupport, sendTipCallback } = this.props;
const { claim_id: claimId } = claim;
const { amount } = this.state;
sendSupport(amount, claimId, uri);
@ -49,7 +50,7 @@ class WalletSendTip extends React.PureComponent<Props, State> {
}
render() {
const { errorMessage, isPending, title, uri, onCancel } = this.props;
const { title, errorMessage, isPending, uri, onCancel } = this.props;
return (
<div>