fix: send tip
This commit is contained in:
parent
402bba5835
commit
93bd6a1d31
2 changed files with 8 additions and 7 deletions
|
@ -1,17 +1,17 @@
|
||||||
import React from 'react';
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doSendSupport } from 'redux/actions/wallet';
|
import { doSendSupport } from 'redux/actions/wallet';
|
||||||
import WalletSendTip from './view';
|
import { makeSelectTitleForUri, makeSelectClaimForUri } from 'redux/selectors/claims';
|
||||||
import { makeSelectTitleForUri } from 'redux/selectors/claims';
|
|
||||||
import { selectIsSendingSupport } from 'redux/selectors/wallet';
|
import { selectIsSendingSupport } from 'redux/selectors/wallet';
|
||||||
|
import WalletSendTip from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
isPending: selectIsSendingSupport(state),
|
isPending: selectIsSendingSupport(state),
|
||||||
title: makeSelectTitleForUri(props.uri)(state),
|
title: makeSelectTitleForUri(props.uri)(state),
|
||||||
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
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);
|
export default connect(select, perform)(WalletSendTip);
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { FormField } from 'component/common/form';
|
||||||
import UriIndicator from 'component/uriIndicator';
|
import UriIndicator from 'component/uriIndicator';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
claim_id: string,
|
|
||||||
uri: string,
|
uri: string,
|
||||||
title: string,
|
title: string,
|
||||||
|
claim: { claim_id: string },
|
||||||
errorMessage: string,
|
errorMessage: string,
|
||||||
isPending: boolean,
|
isPending: boolean,
|
||||||
sendSupport: (number, string, string) => void,
|
sendSupport: (number, string, string) => void,
|
||||||
|
@ -31,7 +31,8 @@ class WalletSendTip extends React.PureComponent<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSendButtonClicked() {
|
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;
|
const { amount } = this.state;
|
||||||
|
|
||||||
sendSupport(amount, claimId, uri);
|
sendSupport(amount, claimId, uri);
|
||||||
|
@ -49,7 +50,7 @@ class WalletSendTip extends React.PureComponent<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { errorMessage, isPending, title, uri, onCancel } = this.props;
|
const { title, errorMessage, isPending, uri, onCancel } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue