2018-05-28 21:53:15 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
2019-07-18 00:22:47 +02:00
|
|
|
import Button from 'component/button';
|
|
|
|
import { Form } from 'component/common/form';
|
2018-05-28 21:53:15 +02:00
|
|
|
import { Modal } from 'modal/modal';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
address: string,
|
|
|
|
amount: number,
|
|
|
|
closeModal: () => void,
|
|
|
|
sendToAddress: (string, number) => void,
|
|
|
|
};
|
|
|
|
|
|
|
|
class ModalConfirmTransaction extends React.PureComponent<Props> {
|
|
|
|
onConfirmed() {
|
|
|
|
const { closeModal, sendToAddress, amount, address } = this.props;
|
|
|
|
sendToAddress(address, amount);
|
|
|
|
closeModal();
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { amount, address, closeModal } = this.props;
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
isOpen
|
2018-09-26 19:48:07 +02:00
|
|
|
title={__('Send LBC')}
|
2018-05-28 21:53:15 +02:00
|
|
|
contentLabel={__('Confirm Transaction')}
|
2019-07-18 00:22:47 +02:00
|
|
|
type="custom"
|
2018-05-28 21:53:15 +02:00
|
|
|
onAborted={closeModal}
|
|
|
|
>
|
2019-07-21 23:31:22 +02:00
|
|
|
<Form onSubmit={() => this.onConfirmed()}>
|
2018-09-26 19:48:07 +02:00
|
|
|
<p>{__('Sending: ')}</p>
|
|
|
|
<blockquote>{amount} LBC</blockquote>
|
|
|
|
<p>{__('To address: ')}</p>
|
|
|
|
<blockquote>{address}</blockquote>
|
|
|
|
<p>{__('Once the transaction is sent, it cannot be reversed.')}</p>
|
2019-07-18 00:22:47 +02:00
|
|
|
<div className="card__actions">
|
2019-07-18 01:30:37 +02:00
|
|
|
<Button autoFocus button="primary" label={__('Send')} onClick={() => this.onConfirmed()} />
|
2019-07-18 00:22:47 +02:00
|
|
|
<Button button="link" label={__('Cancel')} onClick={closeModal} />
|
|
|
|
</div>
|
|
|
|
</Form>
|
2018-05-28 21:53:15 +02:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ModalConfirmTransaction;
|