2017-06-06 23:19:12 +02:00
|
|
|
import React from "react";
|
|
|
|
import Link from "component/link";
|
2017-08-18 19:09:40 +02:00
|
|
|
import Modal from "modal/modal";
|
2017-06-06 23:19:12 +02:00
|
|
|
import { FormRow } from "component/form";
|
2017-05-11 02:59:47 +02:00
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
const WalletSend = props => {
|
2017-05-11 02:59:47 +02:00
|
|
|
const {
|
|
|
|
sendToAddress,
|
|
|
|
closeModal,
|
|
|
|
modal,
|
|
|
|
setAmount,
|
|
|
|
setAddress,
|
|
|
|
amount,
|
|
|
|
address,
|
2017-06-06 23:19:12 +02:00
|
|
|
} = props;
|
2017-05-11 02:59:47 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<section className="card">
|
|
|
|
<form onSubmit={sendToAddress}>
|
|
|
|
<div className="card__title-primary">
|
2017-05-26 22:26:06 +02:00
|
|
|
<h3>{__("Send Credits")}</h3>
|
2017-05-11 02:59:47 +02:00
|
|
|
</div>
|
|
|
|
<div className="card__content">
|
2017-06-06 23:19:12 +02:00
|
|
|
<FormRow
|
|
|
|
label={__("Amount")}
|
2017-06-19 14:42:24 +02:00
|
|
|
postfix={__("LBC")}
|
2017-06-06 23:19:12 +02:00
|
|
|
step="0.01"
|
2017-08-12 19:39:51 +02:00
|
|
|
min="0"
|
2017-06-06 23:19:12 +02:00
|
|
|
type="number"
|
|
|
|
placeholder="1.23"
|
|
|
|
size="10"
|
|
|
|
onChange={setAmount}
|
|
|
|
value={amount}
|
|
|
|
/>
|
2017-05-11 02:59:47 +02:00
|
|
|
</div>
|
|
|
|
<div className="card__content">
|
2017-06-06 23:19:12 +02:00
|
|
|
<FormRow
|
|
|
|
label={__("Recipient Address")}
|
|
|
|
placeholder="bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs"
|
|
|
|
type="text"
|
|
|
|
size="60"
|
|
|
|
onChange={setAddress}
|
|
|
|
value={address}
|
|
|
|
/>
|
2017-08-26 05:21:26 +02:00
|
|
|
<div className="form-row-submit">
|
|
|
|
<Link
|
|
|
|
button="primary"
|
|
|
|
label={__("Send")}
|
|
|
|
onClick={sendToAddress}
|
|
|
|
disabled={!(parseFloat(amount) > 0.0) || !address}
|
|
|
|
/>
|
|
|
|
<input type="submit" className="hidden" />
|
|
|
|
</div>
|
2017-05-11 02:59:47 +02:00
|
|
|
</div>
|
|
|
|
</form>
|
2017-06-06 23:19:12 +02:00
|
|
|
{modal == "insufficientBalance" &&
|
|
|
|
<Modal
|
|
|
|
isOpen={true}
|
|
|
|
contentLabel={__("Insufficient balance")}
|
|
|
|
onConfirmed={closeModal}
|
|
|
|
>
|
|
|
|
{__(
|
|
|
|
"Insufficient balance: after this transaction you would have less than 1 LBC in your wallet."
|
|
|
|
)}
|
|
|
|
</Modal>}
|
|
|
|
{modal == "transactionSuccessful" &&
|
|
|
|
<Modal
|
|
|
|
isOpen={true}
|
|
|
|
contentLabel={__("Transaction successful")}
|
|
|
|
onConfirmed={closeModal}
|
|
|
|
>
|
|
|
|
{__("Your transaction was successfully placed in the queue.")}
|
|
|
|
</Modal>}
|
|
|
|
{modal == "transactionFailed" &&
|
|
|
|
<Modal
|
|
|
|
isOpen={true}
|
|
|
|
contentLabel={__("Transaction failed")}
|
|
|
|
onConfirmed={closeModal}
|
|
|
|
>
|
|
|
|
{__("Something went wrong")}:
|
|
|
|
</Modal>}
|
2017-05-11 02:59:47 +02:00
|
|
|
</section>
|
2017-06-06 23:19:12 +02:00
|
|
|
);
|
2017-06-06 06:21:55 +02:00
|
|
|
};
|
2017-05-11 02:59:47 +02:00
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
export default WalletSend;
|