2017-08-18 19:09:40 +02:00
|
|
|
import React from "react";
|
|
|
|
import { Modal } from "modal/modal";
|
2017-08-18 05:31:44 +02:00
|
|
|
import { CreditAmount, CurrencySymbol } from "component/common";
|
2017-08-18 19:09:40 +02:00
|
|
|
import Link from "component/link/index";
|
2017-08-21 05:38:34 +02:00
|
|
|
import { formatCredits } from "utils";
|
2017-08-18 19:09:40 +02:00
|
|
|
|
|
|
|
const ModalCreditIntro = props => {
|
2017-08-21 05:38:34 +02:00
|
|
|
const { closeModal, currentBalance, totalRewardValue, verifyAccount } = props;
|
2017-08-18 19:09:40 +02:00
|
|
|
|
|
|
|
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>
|
2017-08-18 19:09:40 +02:00
|
|
|
<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."
|
|
|
|
)}
|
2017-08-18 19:09:40 +02:00
|
|
|
</p>
|
|
|
|
<p>
|
2017-08-21 05:38:34 +02:00
|
|
|
{__("New verified users automatically receive more than ")} {" "}
|
2017-08-18 19:09:40 +02:00
|
|
|
{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.")}
|
2017-08-18 19:09:40 +02:00
|
|
|
</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>}
|
|
|
|
|
2017-08-18 19:09:40 +02:00
|
|
|
<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")
|
|
|
|
}
|
|
|
|
/>
|
2017-08-18 19:09:40 +02:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ModalCreditIntro;
|