import React from "react";
import { Modal } from "component/modal";
import Link from "component/link";
import { FormField } from "component/form";
class TipLink extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
showTipBox: false,
feeAmount: "1.00",
};
}
handleTipPublisherButtonClicked() {
this.setState({
showTipBox: true,
});
}
handleTipButtonClicked() {
let address = this.props.claim.address;
let amount = this.state.feeAmount;
this.props.setAddress(address);
this.props.setAmount(amount);
this.props.sendToAddress();
this.setState({
showTipBox: false,
});
}
handleTipCancelButtonClicked() {
this.setState({
showTipBox: false,
});
}
handleFeeAmountChange(event) {
this.setState({
feeAmount: event.target.value,
});
}
render() {
const { showTipBox } = this.state;
let tipLink = (
);
let tipBox = (
this.handleFeeAmountChange(event)}
/>
{__(" ")}
);
return (
{showTipBox ? tipBox : tipLink}
{modal == "insufficientBalance" &&
{__(
"Insufficient balance: after this transaction you would have less than 1 LBC in your wallet."
)}
}
{modal == "transactionSuccessful" &&
{__(
"The publisher of the content was successfully tipped " +
this.state.feeAmount +
" LBC. Mahalo!"
)}
}
{modal == "transactionFailed" &&
{__("Something went wrong")}:
}
);
}
}
export default TipLink;