// @flow import React from 'react'; import Button from 'component/button'; import { FormField } from 'component/common/form'; import UriIndicator from 'component/uriIndicator'; type Props = { claim_id: string, uri: string, title: string, errorMessage: string, isPending: boolean, sendSupport: (number, string, string) => void, onCancel: () => void, sendTipCallback?: () => void, }; type State = { amount: number, }; class WalletSendTip extends React.PureComponent { constructor(props: Props) { super(props); this.state = { amount: 0, }; (this: any).handleSendButtonClicked = this.handleSendButtonClicked.bind(this); } handleSendButtonClicked() { const { claim_id: claimId, uri, sendSupport, sendTipCallback } = this.props; const { amount } = this.state; sendSupport(amount, claimId, uri); // ex: close modal if (sendTipCallback) { sendTipCallback(); } } handleSupportPriceChange(event: SyntheticInputEvent<*>) { this.setState({ amount: Number(event.target.value), }); } render() { const { errorMessage, isPending, title, uri, onCancel } = this.props; return (

{__('Send a tip to')}

this.handleSupportPriceChange(event)} helper={ {__(`This will appear as a tip for ${title} located at ${uri}.`)}{' '}
); } } export default WalletSendTip;