import React from "react"; import { BusyMessage } from "component/common"; import RewardListClaimed from "component/rewardListClaimed"; import RewardTile from "component/rewardTile"; import SubHeader from "component/subHeader"; import Link from "component/link"; class RewardsPage extends React.PureComponent { /* Below is broken for users who have claimed all rewards. It can safely be disabled since we fetch all rewards after authentication, but should be re-enabled once fixed. */ // componentDidMount() { // this.fetchRewards(this.props); // } // // componentWillReceiveProps(nextProps) { // this.fetchRewards(nextProps); // } // // fetchRewards(props) { // const { fetching, rewards, fetchRewards } = props; // // if (!fetching && (!rewards || !rewards.length)) { // fetchRewards(); // } // } renderPageHeader() { const { doAuth, navigate, user } = this.props; if (user && !user.is_reward_approved) { if ( !user.primary_email || !user.has_verified_email || !user.is_identity_verified ) { return (

{__("Humans Only")}

{__("Rewards are for human beings only.")} {" "} {__( "You'll have to prove you're one of us before you can claim any rewards." )}

); } else { return (

{__( "This account must undergo review before you can participate in the rewards program." )} {" "} {__( "This can take anywhere from several minutes to several days." )}

{__( "We apologize for this inconvenience, but have added this additional step to prevent fraud." )}

{__("If you continue to see this message, send us an email to help@lbry.io.") + " " + __("Please enjoy free content in the meantime!")}

navigate("/discover")} button="primary" label="Return Home" />

); } } } renderUnclaimedRewards() { const { fetching, rewards, user } = this.props; 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 (
{__("There are no rewards available at this time, please check back later.")}
); } else { return (
{rewards.map(reward => )}
); } } render() { return (
{this.renderPageHeader()} {this.renderUnclaimedRewards()} {}
); } } export default RewardsPage;