lbry-desktop/ui/js/modal/modalAffirmPurchase/view.jsx

33 lines
838 B
React
Raw Normal View History

2017-09-07 23:18:33 +02:00
import React from "react";
import FilePrice from "component/filePrice";
import { Modal } from "modal/modal";
class ModalAffirmPurchase extends React.PureComponent {
2017-09-08 05:15:05 +02:00
onAffirmPurchase() {
this.props.closeModal();
this.props.loadVideo(this.props.uri);
}
2017-09-07 23:18:33 +02:00
render() {
const { cancelPurchase, metadata: { title }, uri } = this.props;
2017-09-07 23:18:33 +02:00
return (
<Modal
type="confirm"
2017-09-08 05:15:05 +02:00
isOpen={true}
2017-09-07 23:18:33 +02:00
contentLabel={__("Confirm Purchase")}
onConfirmed={this.onAffirmPurchase.bind(this)}
onAborted={cancelPurchase}
2017-09-07 23:18:33 +02:00
>
{__("This will purchase")} <strong>{title}</strong> {__("for")}{" "}
<strong>
<FilePrice uri={uri} showFullPrice={true} look="plain" />
</strong>{" "}
{__("credits")}.
</Modal>
);
}
}
export default ModalAffirmPurchase;