negative progress
This commit is contained in:
parent
7b5e752e90
commit
8c012bc087
10 changed files with 47 additions and 22 deletions
|
@ -22,7 +22,6 @@ const app = {
|
|||
i18n: i18n,
|
||||
logs: logs,
|
||||
log: function(message) {
|
||||
console.log(message);
|
||||
logs.push(message);
|
||||
},
|
||||
};
|
||||
|
|
|
@ -5,7 +5,6 @@ import { CreditAmount, BusyMessage } from "component/common";
|
|||
const InviteSummary = props => {
|
||||
const { isPending, invitesRemaining } = props;
|
||||
|
||||
console.log(invitesRemaining);
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="card__title-primary">
|
||||
|
|
|
@ -10,7 +10,7 @@ class TransactionListRecent extends React.PureComponent {
|
|||
|
||||
render() {
|
||||
const { fetchingTransactions, hasTransactions, transactions } = this.props;
|
||||
console.log(transactions);
|
||||
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="card__title-primary">
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React from "react";
|
||||
import rewards from "rewards";
|
||||
import { connect } from "react-redux";
|
||||
import { doCloseModal, doAuthNavigate } from "actions/app";
|
||||
import { doSetClientSetting } from "actions/settings";
|
||||
import { selectUserIsRewardApproved } from "selectors/user";
|
||||
import { selectBalance } from "selectors/wallet";
|
||||
import {
|
||||
makeSelectHasClaimedReward,
|
||||
makeSelectRewardByType,
|
||||
|
@ -17,8 +17,8 @@ const select = (state, props) => {
|
|||
selectReward = makeSelectRewardByType();
|
||||
|
||||
return {
|
||||
currentBalance: selectBalance(state),
|
||||
isRewardApproved: selectUserIsRewardApproved(state),
|
||||
reward: selectReward(state, { reward_type: rewards.TYPE_NEW_USER }),
|
||||
totalRewardValue: selectUnclaimedRewardValue(state),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -2,39 +2,62 @@ import React from "react";
|
|||
import { Modal } from "modal/modal";
|
||||
import { CreditAmount, CurrencySymbol } from "component/common";
|
||||
import Link from "component/link/index";
|
||||
import { formatCredits } from "utils";
|
||||
|
||||
const ModalCreditIntro = props => {
|
||||
const { closeModal, totalRewardValue, verifyAccount } = props;
|
||||
const { closeModal, currentBalance, totalRewardValue, verifyAccount } = props;
|
||||
|
||||
const totalRewardRounded = Math.round(totalRewardValue / 10) * 10;
|
||||
|
||||
return (
|
||||
<Modal type="custom" isOpen={true} contentLabel="Welcome to LBRY">
|
||||
<section>
|
||||
<h3 className="modal__header">{__("Claim Your Credits")}</h3>
|
||||
<h3 className="modal__header">{__("Quick Credit Intro")}</h3>
|
||||
<p>
|
||||
The LBRY network is controlled and powered by credits called{" "}
|
||||
<em><CurrencySymbol /></em>, a blockchain asset.
|
||||
<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>
|
||||
{__("New patrons receive ")} {" "}
|
||||
{__("New verified users automatically receive more than ")} {" "}
|
||||
{totalRewardValue
|
||||
? <CreditAmount amount={totalRewardRounded} />
|
||||
: <span className="credit-amount">{__("credits")}</span>}
|
||||
{" "} {__("in rewards for usage and influence of the network.")}
|
||||
</p>
|
||||
<p>
|
||||
{__(
|
||||
"You'll also earn weekly bonuses for checking out the greatest new stuff."
|
||||
)}
|
||||
{" "} {__(" in rewards for usage and influence of the network.")}
|
||||
</p>
|
||||
{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")}
|
||||
/>
|
||||
<Link button="alt" onClick={closeModal} label={__("I Burn Money")} />
|
||||
<Link
|
||||
button="alt"
|
||||
onClick={closeModal}
|
||||
label={
|
||||
currentBalance <= 0
|
||||
? __("Continue Without LBC")
|
||||
: __("Meh, Not Now")
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</Modal>
|
||||
|
|
|
@ -51,7 +51,8 @@ class ModalRouter extends React.PureComponent {
|
|||
!isCreditIntroAcknowledged &&
|
||||
user &&
|
||||
!user.is_reward_approved &&
|
||||
!user.is_identity_verified
|
||||
!user.is_identity_verified &&
|
||||
["rewards", "send", "receive", "show", "publish", "wallet"].includes(page)
|
||||
) {
|
||||
openModal(modals.CREDIT_INTRO);
|
||||
return true;
|
||||
|
|
|
@ -8,7 +8,6 @@ import ModalWelcome from "./view";
|
|||
|
||||
const perform = dispatch => () => ({
|
||||
closeModal: () => {
|
||||
console.log("Make 'em welcome");
|
||||
dispatch(doSetClientSetting(settings.NEW_USER_ACKNOWLEDGED, true));
|
||||
dispatch(doCloseModal());
|
||||
},
|
||||
|
|
|
@ -22,7 +22,11 @@ const ModalWelcome = props => {
|
|||
)}
|
||||
</p>
|
||||
<div className="modal__buttons">
|
||||
<Link button="primary" onClick={closeModal} label={__("Continue")} />
|
||||
<Link
|
||||
button="primary"
|
||||
onClick={closeModal}
|
||||
label={__("Blockchain Centaurs? I'm In")}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</Modal>
|
||||
|
|
|
@ -32,7 +32,7 @@ class RewardsPage extends React.PureComponent {
|
|||
!user.is_identity_verified
|
||||
) {
|
||||
return (
|
||||
<div>
|
||||
<section className="card">
|
||||
<div className="card__content empty">
|
||||
<p>
|
||||
{__("Only verified accounts are eligible to earn rewards.")}
|
||||
|
@ -41,7 +41,7 @@ class RewardsPage extends React.PureComponent {
|
|||
<div className="card__content">
|
||||
<Link onClick={doAuth} button="primary" label="Become Verified" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
|
|
|
@ -5,7 +5,7 @@ export const _selectState = state => state.wallet || {};
|
|||
|
||||
export const selectBalance = createSelector(
|
||||
_selectState,
|
||||
state => state.balance || 0
|
||||
state => 0 //state.balance || 0
|
||||
);
|
||||
|
||||
export const selectTransactions = createSelector(
|
||||
|
|
Loading…
Add table
Reference in a new issue