lbry-desktop/ui/modal/modalConfirmTransaction/view.jsx

48 lines
1.3 KiB
React
Raw Normal View History

// @flow
import React from 'react';
2019-07-18 00:22:47 +02:00
import Button from 'component/button';
import { Form } from 'component/common/form';
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')}
contentLabel={__('Confirm Transaction')}
2019-07-18 00:22:47 +02:00
type="custom"
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>
</Modal>
);
}
}
export default ModalConfirmTransaction;