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

68 lines
2.1 KiB
React
Raw Normal View History

import React from "react";
import { Modal } from "modal/modal";
2017-08-18 05:31:44 +02:00
import { CreditAmount, CurrencySymbol } from "component/common";
import Link from "component/link/index";
2017-08-21 05:38:34 +02:00
import { formatCredits } from "utils";
const ModalCreditIntro = props => {
2017-08-21 05:38:34 +02:00
const { closeModal, currentBalance, totalRewardValue, verifyAccount } = props;
const totalRewardRounded = Math.round(totalRewardValue / 10) * 10;
return (
<Modal type="custom" isOpen={true} contentLabel="Welcome to LBRY">
<section>
2017-08-21 05:38:34 +02:00
<h3 className="modal__header">{__("Quick Credit Intro")}</h3>
<p>
The LBRY network is controlled and powered by credits called{" "}
2017-08-21 05:38:34 +02:00
<em><CurrencySymbol /></em>, a blockchain asset. {" "}
<CurrencySymbol />{" "}
{__(
"is used to publish content, to have a say in the network rules, and to access paid content."
)}
</p>
<p>
2017-08-21 05:38:34 +02:00
{__("New verified users automatically receive more than ")} {" "}
{totalRewardValue
? <CreditAmount amount={totalRewardRounded} />
: <span className="credit-amount">{__("credits")}</span>}
2017-08-21 05:38:34 +02:00
{" "} {__(" in rewards for usage and influence of the network.")}
</p>
2017-08-21 05:38:34 +02:00
{currentBalance <= 0
? <p>
<strong>
{__(
"Without any credits, you will not be able to take this action."
)}
</strong>
</p>
: <p>
{__(
"But you probably knew all this, since you've already got %s of them!",
formatCredits(currentBalance, 2)
)}
</p>}
<div className="modal__buttons">
<Link
button="primary"
onClick={verifyAccount}
label={__("You Had Me At Free LBC")}
/>
2017-08-21 05:38:34 +02:00
<Link
button="alt"
onClick={closeModal}
label={
currentBalance <= 0
? __("Continue Without LBC")
: __("Meh, Not Now")
}
/>
</div>
</section>
</Modal>
);
};
export default ModalCreditIntro;