re-enable rewards

This commit is contained in:
Jeremy Kauffman 2017-05-19 12:17:19 -04:00
parent d6680a7ae5
commit bb16156034
6 changed files with 35 additions and 34 deletions

View file

@ -125,6 +125,10 @@ class ConfirmEmailStage extends React.Component {
}
class WelcomeStage extends React.Component {
static propTypes = {
endAuth: React.PropTypes.func,
}
constructor(props) {
super(props);
@ -169,31 +173,20 @@ class WelcomeStage extends React.Component {
);
}
}
WelcomeStage.propTypes = {
endAuth: React.PropTypes.func,
};
class ErrorStage extends React.Component {
render() {
return (
<section>
<p>An error was encountered that we cannot continue from.</p>
<p>At least we're earning the name beta.</p>
{ this.props.errorText ? <p>Message: {this.props.errorText}</p> : '' }
<Link button="alt" label="Try Reload" onClick={() => { window.location.reload() } } />
</section>
);
}
const ErrorStage = (props) => {
return <section>
<p>An error was encountered that we cannot continue from.</p>
<p>At least we're earning the name beta.</p>
{ this.props.errorText ? <p>Message: {props.errorText}</p> : '' }
<Link button="alt" label="Try Reload" onClick={() => { window.location.reload() } } />
</section>
}
class PendingStage extends React.Component {
render() {
return (
<section>
<p>Preparing for first access <span className="busy-indicator"></span></p>
</section>
);
}
const PendingStage = (props) => {
return <section>
<p>Preparing for first access <span className="busy-indicator"></span></p>
</section>
}
@ -315,9 +308,14 @@ export class AuthOverlay extends React.Component {
return null;
}
const StageContent = this._stages[this.state.stage];
if (!StageContent) {
return <span className="empty">Unknown authentication step.</span>
}
return (
this.state.stage != "welcome" ?
<ModalPage className="modal-page--full" isOpen={true} contentLabel="Authentication" {...this.props}>
<ModalPage className="modal-page--full" isOpen={true} contentLabel="Authentication">
<h1>LBRY Early Access</h1>
<StageContent {...this.state.stageProps} setStage={(stage, stageProps) => { this.setStage(stage, stageProps) }} />
</ModalPage> :

View file

@ -9,15 +9,11 @@ export class Icon extends React.Component {
fixed: React.PropTypes.bool,
}
static defaultProps = {
lines: null
}
render() {
const {fixed, className, ...other} = this.props;
const {fixed, className} = this.props;
const spanClassName = ('icon ' + ('fixed' in this.props ? 'icon-fixed-width ' : '') +
this.props.icon + ' ' + (this.props.className || ''));
return <span className={spanClassName} {... other}></span>
return <span className={spanClassName}></span>
}
}
@ -26,6 +22,10 @@ export class TruncatedText extends React.Component {
lines: React.PropTypes.number,
}
static defaultProps = {
lines: null
}
render() {
return <span className="truncated-text" style={{ WebkitLineClamp: this.props.lines }}>{this.props.children}</span>;
}

View file

@ -14,3 +14,5 @@ export class ModalPage extends React.Component {
);
}
}
export default ModalPage

View file

@ -47,6 +47,7 @@ export class RewardLink extends React.Component {
this.setState({
pending: true
})
rewards.claimReward(this.props.type).then((reward) => {
this.setState({
pending: false,

View file

@ -7,7 +7,7 @@ const lbryio = {
_accessToken: getLocal('accessToken'),
_authenticationPromise: null,
_user : null,
enabled: false
enabled: true
};
const CONNECTION_STRING = 'https://api.lbry.io/';

View file

@ -3,10 +3,10 @@ import ReactDOM from 'react-dom';
import lbry from './lbry.js';
import lbryio from './lbryio.js';
import lighthouse from './lighthouse.js';
import App from './component/app/index.js';
import SplashScreen from './component/splash.js';
import SnackBar from './component/snack-bar.js';
import {AuthOverlay} from './component/auth.js';
import App from 'component/app/index.js';
import SplashScreen from 'component/splash.js';
import SnackBar from 'component/snack-bar.js';
import {AuthOverlay} from 'component/auth.js';
import { Provider } from 'react-redux';
import store from 'store.js';
import {