2017-05-11 02:59:47 +02:00
|
|
|
import React from 'react';
|
|
|
|
import Link from 'component/link';
|
|
|
|
import Modal from 'component/modal';
|
|
|
|
import {
|
|
|
|
FormRow
|
|
|
|
} from 'component/form';
|
|
|
|
|
|
|
|
const WalletSend = (props) => {
|
|
|
|
const {
|
|
|
|
sendToAddress,
|
|
|
|
closeModal,
|
|
|
|
modal,
|
|
|
|
setAmount,
|
|
|
|
setAddress,
|
|
|
|
amount,
|
|
|
|
address,
|
|
|
|
} = props
|
|
|
|
|
|
|
|
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-05-26 22:26:06 +02:00
|
|
|
<FormRow label={__("Amount")} postfix="LBC" step="0.01" 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-05-26 22:26:06 +02:00
|
|
|
<FormRow label={__("Recipient Address")} placeholder="bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs" type="text" size="60" onChange={setAddress} value={address} />
|
2017-05-11 02:59:47 +02:00
|
|
|
</div>
|
|
|
|
<div className="card__actions card__actions--form-submit">
|
2017-05-26 22:26:06 +02:00
|
|
|
<Link button="primary" label={_("Send")} onClick={sendToAddress} disabled={!(parseFloat(amount) > 0.0) || !address} />
|
2017-05-11 02:59:47 +02:00
|
|
|
<input type='submit' className='hidden' />
|
|
|
|
</div>
|
|
|
|
</form>
|
2017-05-26 22:26:06 +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.")}
|
2017-05-11 02:59:47 +02:00
|
|
|
</Modal>}
|
2017-05-26 22:26:06 +02:00
|
|
|
{modal == 'transactionSuccessful' && <Modal isOpen={true} contentLabel={__("Transaction successful")} onConfirmed={closeModal}>
|
|
|
|
{__("Your transaction was successfully placed in the queue.")}
|
2017-05-11 02:59:47 +02:00
|
|
|
</Modal>}
|
2017-05-26 22:26:06 +02:00
|
|
|
{modal == 'transactionFailed' && <Modal isOpen={true} contentLabel={__("Transaction failed")} onConfirmed={closeModal}>
|
|
|
|
{__("Something went wrong")}:
|
2017-05-11 02:59:47 +02:00
|
|
|
</Modal>}
|
|
|
|
</section>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default WalletSend
|