-
- {__(
- 'This account must undergo review before you can participate in the rewards program. Not all users and regions may qualify.'
- )}{' '}
- {__('This can take anywhere from a few hours to several days. Please be patient.')}
-
-
-
- {__(
- 'We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.'
- )}
-
-
- ,
- help_email: SITE_HELP_EMAIL,
- site_name: SITE_NAME,
- }}
- >
- Please review the %rewards_faq% for eligibility, and send us an email to %help_email% if you continue
- to see this message. You can continue to use %site_name% without this feature.
-
- {`${__('Enjoy all the awesome free content in the meantime!')}`}
-
-
- }
- actions={
-
-
-
- }
- />
- );
- }
-
- return null;
- }
-
- renderCustomRewardCode() {
- const { user } = this.props;
- const isNotEligible = !user || !user.primary_email || !user.has_verified_email || !user.is_reward_approved;
- return (
-
- );
- }
-
- renderUnclaimedRewards() {
- const { fetching, rewards, user, daemonSettings, claimed } = this.props;
-
- if (daemonSettings && !daemonSettings.share_usage_data) {
- return (
-
- {__('Rewards Disabled')}
-
- }}>
- Rewards are currently disabled for your account. Turn on diagnostic data sharing, in %settings%, to
- re-enable them.
-
-
-
- );
- } else if (fetching) {
- return ;
- } else if (user === null) {
- return (
- {__('This application is unable to earn rewards due to an authentication failure.')}
- );
- } else if (!rewards || rewards.length <= 0) {
- return (
- }
- />
- );
- }
-
- const isNotEligible = !user || !user.primary_email || !user.has_verified_email || !user.is_reward_approved;
-
- return (
-
- {rewards.map((reward) => (
-
- ))}
- {this.renderCustomRewardCode()}
-
- );
- }
-
- render() {
- return (
-
- {this.renderPageHeader()}
- {this.renderUnclaimedRewards()}
-
-
- );
- }
-}
-
-export default RewardsPage;
diff --git a/ui/page/rewardsVerify/index.js b/ui/page/rewardsVerify/index.js
deleted file mode 100644
index 132b260ae..000000000
--- a/ui/page/rewardsVerify/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import { connect } from 'react-redux';
-import { selectUser } from 'redux/selectors/user';
-import RewardsVerifyPage from './view';
-
-const select = state => ({
- user: selectUser(state),
-});
-
-export default connect(select, null)(RewardsVerifyPage);
diff --git a/ui/page/rewardsVerify/view.jsx b/ui/page/rewardsVerify/view.jsx
deleted file mode 100644
index 772096104..000000000
--- a/ui/page/rewardsVerify/view.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-// @flow
-import React from 'react';
-import UserVerify from 'component/userVerify';
-import Page from 'component/page';
-import { useHistory } from 'react-router-dom';
-
-type Props = {
- user: ?User,
-};
-
-function RewardsVerifyPage(props: Props) {
- const { user } = props;
- const { goBack } = useHistory();
- const rewardsApproved = user && user.is_reward_approved;
-
- React.useEffect(() => {
- if (rewardsApproved) {
- goBack();
- }
- }, [rewardsApproved]);
-
- return (
-
- goBack()} />
-
- );
-}
-
-export default RewardsVerifyPage;
diff --git a/ui/page/youtubeSync/index.js b/ui/page/youtubeSync/index.js
deleted file mode 100644
index 6163f9fcc..000000000
--- a/ui/page/youtubeSync/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { connect } from 'react-redux';
-import { selectYoutubeChannels } from 'redux/selectors/user';
-import { doUserFetch } from 'redux/actions/user';
-import CreatorDashboardPage from './view';
-
-const select = state => ({
- youtubeChannels: selectYoutubeChannels(state),
-});
-
-export default connect(select, {
- doUserFetch,
-})(CreatorDashboardPage);
diff --git a/ui/page/youtubeSync/view.jsx b/ui/page/youtubeSync/view.jsx
deleted file mode 100644
index 69e26a614..000000000
--- a/ui/page/youtubeSync/view.jsx
+++ /dev/null
@@ -1,216 +0,0 @@
-// @flow
-import { SITE_NAME, DOMAIN } from 'config';
-import * as PAGES from 'constants/pages';
-import SUPPORTED_LANGUAGES from 'constants/supported_languages';
-import React from 'react';
-import Page from 'component/page';
-import Button from 'component/button';
-import Card from 'component/common/card';
-import I18nMessage from 'component/i18nMessage';
-import { Form, FormField } from 'component/common/form';
-import { INVALID_NAME_ERROR } from 'constants/claim';
-import { isNameValid } from 'util/lbryURI';
-import { Lbryio } from 'lbryinc';
-import { useHistory } from 'react-router';
-import YoutubeTransferStatus from 'component/youtubeTransferStatus';
-import Nag from 'component/common/nag';
-import { getDefaultLanguage, sortLanguageMap } from 'util/default-languages';
-
-const STATUS_TOKEN_PARAM = 'status_token';
-const ERROR_MESSAGE_PARAM = 'error_message';
-const NEW_CHANNEL_PARAM = 'new_channel';
-
-type Props = {
- youtubeChannels: ?Array<{ transfer_state: string, sync_status: string }>,
- doUserFetch: () => void,
- inSignUpFlow?: boolean,
- doToggleInterestedInYoutubeSync: () => void,
-};
-
-export default function YoutubeSync(props: Props) {
- const { youtubeChannels, doUserFetch, inSignUpFlow = false, doToggleInterestedInYoutubeSync } = props;
- const {
- location: { search, pathname },
- push,
- replace,
- } = useHistory();
- const urlParams = new URLSearchParams(search);
- const statusToken = urlParams.get(STATUS_TOKEN_PARAM);
- const errorMessage = urlParams.get(ERROR_MESSAGE_PARAM);
- const newChannelParam = urlParams.get(NEW_CHANNEL_PARAM);
- const [channel, setChannel] = React.useState('');
- const [language, setLanguage] = React.useState(getDefaultLanguage());
- const [nameError, setNameError] = React.useState(undefined);
- const [acknowledgedTerms, setAcknowledgedTerms] = React.useState(false);
- const [addingNewChannel, setAddingNewChannel] = React.useState(newChannelParam);
- const hasYoutubeChannels = youtubeChannels && youtubeChannels.length > 0;
-
- React.useEffect(() => {
- const urlParamsInEffect = new URLSearchParams(search);
- if (!urlParamsInEffect.get('reset_scroll')) {
- urlParamsInEffect.append('reset_scroll', 'youtube');
- }
-
- replace(`?${urlParamsInEffect.toString()}`);
- }, [pathname, search]);
-
- React.useEffect(() => {
- if (statusToken && !hasYoutubeChannels) {
- doUserFetch();
- }
- }, [statusToken, hasYoutubeChannels, doUserFetch]);
-
- React.useEffect(() => {
- if (!newChannelParam) {
- setAddingNewChannel(false);
- }
- }, [newChannelParam]);
-
- function handleCreateChannel() {
- Lbryio.call('yt', 'new', {
- type: 'sync',
- immediate_sync: true,
- channel_language: language,
- desired_lbry_channel_name: `@${channel}`,
- return_url: `https://${DOMAIN}/$/${inSignUpFlow ? PAGES.AUTH : PAGES.YOUTUBE_SYNC}`,
- }).then((ytAuthUrl) => {
- // react-router isn't needed since it's a different domain
- window.location.href = ytAuthUrl;
- });
- }
-
- function handleChannelChange(e) {
- const { value } = e.target;
- setChannel(value);
- if (!isNameValid(value)) {
- setNameError(INVALID_NAME_ERROR);
- } else {
- setNameError();
- }
- }
-
- function handleNewChannel() {
- urlParams.append('new_channel', 'true');
- push(`${pathname}?${urlParams.toString()}`);
- setAddingNewChannel(true);
- }
-
- const Wrapper = (props: { children: any }) => {
- return inSignUpFlow ? (
- <>{props.children}>
- ) : (
-
- {props.children}
-
- );
- };
-
- return (
-
-
- {hasYoutubeChannels && !addingNewChannel ? (
-
- ) : (
-
-
-
-
- @
-
-
-
-
- setLanguage(event.target.value)}
- value={language}
- >
- {sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
-
- ))}
-
- setAcknowledgedTerms(!acknowledgedTerms)}
- label={
-
- ),
- faq: (
-
- ),
- site_name: SITE_NAME,
- }}
- >
- I want to sync my content to %site_name% and the LBRY network and agree to %terms%. I have also
- read and understand %faq%.
-
- }
- />
-
-
-
-
- {inSignUpFlow && !errorMessage && (
-
-
- ,
- }}
- >
- This will verify you are an active YouTuber. Channel names cannot be changed once chosen, please be
- extra careful. Additional instructions will be emailed to you after you verify your email on the
- next page. %learn_more%.
-
-
-
- }
- nag={errorMessage && }
- />
- )}
-
-
- );
-}