import React from "react"; import Link from "component/link"; import FormFieldPrice from "component/formFieldPrice"; class TipLink extends React.PureComponent { constructor(props) { super(props); this.state = { feeAmount: "1.00", currency: "LBC", }; } handleSupportButtonClicked() { this.resetDefaults(); this.props.onTipShow(); } handleSendButtonClicked() { let claim_id = this.props.claim_id; let amount = this.state.feeAmount; this.props.sendSupport(amount, claim_id); this.props.onTipHide(); } handleSupportCancelButtonClicked() { this.props.onTipHide(); } handleSupportPriceChange(newValue) { this.setState({ feeAmount: newValue.amount, feeCurrency: newValue.currency, }); } resetDefaults() { this.setState({ feeAmount: "1.00", currency: "LBC", }); } render() { const { showTipBox } = this.props; const { feeAmount, currency } = this.state; let tipLink = ( ); let tipBox = ( this.handleSupportPriceChange(value)} defaultValue={{ amount: feeAmount, currency: currency }} />
{__("This sends the entered amount of LBCs to the publisher.")}
); return (
{showTipBox ? tipBox : tipLink}
); } } export default TipLink;