lbry-desktop/ui/js/component/walletSend/view.jsx

70 lines
1.7 KiB
React
Raw Normal View History

2017-06-06 23:19:12 +02:00
import React from "react";
import { Form, FormRow, Submit } from "component/form";
import lbryuri from "lbryuri";
class WalletSend extends React.PureComponent {
handleSubmit() {
const { amount, address, sendToAddress } = this.props;
const validSubmit = parseFloat(amount) > 0.0 && address;
if (validSubmit) {
sendToAddress();
}
}
render() {
const {
closeModal,
modal,
setAmount,
setAddress,
amount,
address,
error,
} = this.props;
return (
<section className="card">
<Form onSubmit={this.handleSubmit.bind(this)}>
<div className="card__title-primary">
<h3>{__("Send Credits")}</h3>
</div>
<div className="card__content">
<FormRow
label={__("Amount")}
postfix={__("LBC")}
step="any"
min="0"
type="number"
placeholder="1.23"
size="10"
onChange={setAmount}
value={amount}
/>
</div>
<div className="card__content">
<FormRow
label={__("Recipient Address")}
placeholder="bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs"
type="text"
size="60"
onChange={setAddress}
value={address}
regexp={lbryuri.REGEXP_ADDRESS}
trim={true}
2017-08-26 05:21:26 +02:00
/>
<div className="form-row-submit">
<Submit
label={__("Send")}
disabled={!(parseFloat(amount) > 0.0) || !address}
/>
</div>
2017-08-26 05:21:26 +02:00
</div>
</Form>
</section>
);
}
}
2017-06-06 06:21:55 +02:00
export default WalletSend;