import React from "react"; import lbryio from "lbryio.js"; import ModalPage from "component/modal-page.js"; import Auth from "component/auth"; import Link from "component/link"; export class AuthOverlay extends React.Component { constructor(props) { super(props); this.state = { showNoEmailConfirm: false, }; } componentWillReceiveProps(nextProps) { if (this.props.isShowing && !this.props.isPending && !nextProps.isShowing) { setTimeout(() => this.props.openWelcomeModal(), 1); } } onEmailSkipClick() { this.setState({ showNoEmailConfirm: true }); } onEmailSkipConfirm() { this.props.userEmailDecline(); } render() { if (!lbryio.enabled) { return null; } const { isPending, isShowing, hasEmail } = this.props; if (isShowing) { return (

LBRY Early Access

{isPending ? "" :
{!hasEmail && this.state.showNoEmailConfirm ?

{__( "If you continue without an email, you will be ineligible to earn free LBC rewards, as well as unable to receive security related communications." )}

{ this.onEmailSkipConfirm(); }} label={__("Continue without email")} />
: { hasEmail ? this.onEmailSkipConfirm() : this.onEmailSkipClick(); }} label={ hasEmail ? __("Skip for now") : __("Do I have to?") } />}
}
); } return null; } } export default AuthOverlay;