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

44 lines
1.1 KiB
React
Raw Normal View History

// @flow
import React from 'react';
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')}
type="confirm"
2018-09-26 19:48:07 +02:00
confirmButtonLabel={__('Send')}
onConfirmed={() => this.onConfirmed()}
onAborted={closeModal}
>
2018-09-26 19:48:07 +02:00
<section className="card__content">
<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>
</section>
</Modal>
);
}
}
export default ModalConfirmTransaction;