Merge pull request #2779 from lbryio/tvBalanceAndRewards
Enables wallet and rewards
This commit is contained in:
commit
c3a70ad12d
5 changed files with 25 additions and 39 deletions
|
@ -124,7 +124,7 @@
|
||||||
"husky": "^0.14.3",
|
"husky": "^0.14.3",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||||
"lbry-redux": "lbryio/lbry-redux#1af092ce2cb507d9a41711b864874c0bd76935ae",
|
"lbry-redux": "lbryio/lbry-redux#f4413a8ab4928a9487274568bb72e440c45875be",
|
||||||
"lbryinc": "lbryio/lbryinc#1ce266b3c52654190b955e9c869b8e302aa5c585",
|
"lbryinc": "lbryio/lbryinc#1ce266b3c52654190b955e9c869b8e302aa5c585",
|
||||||
"lint-staged": "^7.0.2",
|
"lint-staged": "^7.0.2",
|
||||||
"localforage": "^1.7.1",
|
"localforage": "^1.7.1",
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classnames from 'classnames';
|
|
||||||
import RewardSummary from 'component/rewardSummary';
|
import RewardSummary from 'component/rewardSummary';
|
||||||
import RewardTotal from 'component/rewardTotal';
|
import RewardTotal from 'component/rewardTotal';
|
||||||
import Page from 'component/page';
|
import Page from 'component/page';
|
||||||
import UnsupportedOnWeb from 'component/common/unsupported-on-web';
|
|
||||||
import UserEmail from 'component/userEmail';
|
import UserEmail from 'component/userEmail';
|
||||||
import InvitePage from 'page/invite';
|
import InvitePage from 'page/invite';
|
||||||
|
|
||||||
const AccountPage = () => (
|
const AccountPage = () => (
|
||||||
<Page>
|
<Page>
|
||||||
{/* @if TARGET='web' */}
|
|
||||||
<UserEmail />
|
|
||||||
{/* @endif */}
|
|
||||||
<UnsupportedOnWeb />
|
|
||||||
<div className={classnames({ 'card--disabled': IS_WEB })}>
|
|
||||||
<div className="columns">
|
<div className="columns">
|
||||||
<UserEmail />
|
<UserEmail />
|
||||||
<div>
|
<div>
|
||||||
|
@ -22,7 +15,6 @@ const AccountPage = () => (
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<InvitePage />
|
<InvitePage />
|
||||||
</div>
|
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import Button from 'component/button';
|
||||||
import Page from 'component/page';
|
import Page from 'component/page';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { rewards as REWARD_TYPES } from 'lbryinc';
|
import { rewards as REWARD_TYPES } from 'lbryinc';
|
||||||
import UnsupportedOnWeb from 'component/common/unsupported-on-web';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
doAuth: () => void,
|
doAuth: () => void,
|
||||||
|
@ -29,10 +28,9 @@ class RewardsPage extends PureComponent<Props> {
|
||||||
renderPageHeader() {
|
renderPageHeader() {
|
||||||
const { user, daemonSettings } = this.props;
|
const { user, daemonSettings } = this.props;
|
||||||
|
|
||||||
if (user && !user.is_reward_approved && daemonSettings && daemonSettings.share_usage_data) {
|
if (user && !user.is_reward_approved && ((daemonSettings && daemonSettings.share_usage_data) || IS_WEB)) {
|
||||||
if (!user.primary_email || !user.has_verified_email || !user.is_identity_verified) {
|
if (!user.primary_email || !user.has_verified_email || !user.is_identity_verified) {
|
||||||
return (
|
return (
|
||||||
!IS_WEB && (
|
|
||||||
<section className="card card--section">
|
<section className="card card--section">
|
||||||
<h2 className="card__title">{__('Rewards Approval to Earn Credits (LBC)')}</h2>
|
<h2 className="card__title">{__('Rewards Approval to Earn Credits (LBC)')}</h2>
|
||||||
<p className="card__subtitle">
|
<p className="card__subtitle">
|
||||||
|
@ -44,7 +42,6 @@ class RewardsPage extends PureComponent<Props> {
|
||||||
|
|
||||||
<Button navigate="/$/auth?redirect=rewards" button="primary" label="Prove Humanity" />
|
<Button navigate="/$/auth?redirect=rewards" button="primary" label="Prove Humanity" />
|
||||||
</section>
|
</section>
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -86,7 +83,7 @@ class RewardsPage extends PureComponent<Props> {
|
||||||
renderUnclaimedRewards() {
|
renderUnclaimedRewards() {
|
||||||
const { fetching, rewards, user, daemonSettings, claimed } = this.props;
|
const { fetching, rewards, user, daemonSettings, claimed } = this.props;
|
||||||
|
|
||||||
if (daemonSettings && !daemonSettings.share_usage_data) {
|
if (!IS_WEB && daemonSettings && !daemonSettings.share_usage_data) {
|
||||||
return (
|
return (
|
||||||
<section className="card card--section">
|
<section className="card card--section">
|
||||||
<h2 className="card__title">{__('Disabled')}</h2>
|
<h2 className="card__title">{__('Disabled')}</h2>
|
||||||
|
@ -141,7 +138,6 @@ class RewardsPage extends PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
{IS_WEB && <UnsupportedOnWeb />}
|
|
||||||
{this.renderPageHeader()}
|
{this.renderPageHeader()}
|
||||||
{this.renderUnclaimedRewards()}
|
{this.renderUnclaimedRewards()}
|
||||||
{<RewardListClaimed />}
|
{<RewardListClaimed />}
|
||||||
|
|
|
@ -4,17 +4,13 @@ import WalletSend from 'component/walletSend';
|
||||||
import WalletAddress from 'component/walletAddress';
|
import WalletAddress from 'component/walletAddress';
|
||||||
import TransactionListRecent from 'component/transactionListRecent';
|
import TransactionListRecent from 'component/transactionListRecent';
|
||||||
import Page from 'component/page';
|
import Page from 'component/page';
|
||||||
import UnsupportedOnWeb from 'component/common/unsupported-on-web';
|
|
||||||
|
|
||||||
const WalletPage = () => (
|
const WalletPage = () => (
|
||||||
<Page>
|
<Page>
|
||||||
<UnsupportedOnWeb />
|
|
||||||
<div className={IS_WEB && 'card--disabled'}>
|
|
||||||
<WalletBalance />
|
<WalletBalance />
|
||||||
<WalletSend />
|
<WalletSend />
|
||||||
<WalletAddress />
|
<WalletAddress />
|
||||||
<TransactionListRecent />
|
<TransactionListRecent />
|
||||||
</div>
|
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -322,7 +322,9 @@ export function doDaemonReady() {
|
||||||
|
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
dispatch(doFetchDaemonSettings());
|
dispatch(doFetchDaemonSettings());
|
||||||
|
// @endif
|
||||||
dispatch(doBalanceSubscribe());
|
dispatch(doBalanceSubscribe());
|
||||||
|
// @if TARGET='app'
|
||||||
dispatch(doFetchFileInfosAndPublishedClaims());
|
dispatch(doFetchFileInfosAndPublishedClaims());
|
||||||
if (!selectIsUpgradeSkipped(state)) {
|
if (!selectIsUpgradeSkipped(state)) {
|
||||||
dispatch(doCheckUpgradeAvailable());
|
dispatch(doCheckUpgradeAvailable());
|
||||||
|
|
Loading…
Reference in a new issue