lbry-desktop/ui/js/page/email.js

37 lines
1 KiB
JavaScript
Raw Normal View History

2017-03-30 19:06:06 -04:00
import React from 'react';
import lbryio from '../lbryio.js';
import {getLocal, setLocal} from '../utils.js';
2017-04-10 08:32:40 -04:00
import {FormField} from '../component/form.js'
2017-03-30 19:06:06 -04:00
import {Link} from '../component/link.js'
import rewards from '../rewards.js';
2017-03-30 19:06:06 -04:00
2017-04-01 02:30:32 -04:00
const EmailPage = React.createClass({
2017-03-30 19:06:06 -04:00
handleSubmit: function(event) {
2017-04-01 02:30:32 -04:00
if (event !== undefined) {
2017-03-30 19:06:06 -04:00
event.preventDefault();
}
if (!this.state.email) {
2017-04-10 08:32:40 -04:00
this._emailField.showRequiredError();
2017-03-30 19:06:06 -04:00
}
},
componentWillMount: function() {
this._getRewardType();
},
render: function() {
return (
<main>
<section className="card">
<h1>Verify your Email Address</h1>
2017-03-30 19:06:06 -04:00
<form onSubmit={this.handleSubmit}>
<section><label>Email <FormField ref={(field) => { this._emailField = field }} type="text" name="email" value={this.state.email} /></label></section>
<div><Link button="primary" label="Submit" onClick={this.handleSubmit} /></div>
</form>
</section>
</main>
);
}
});
2017-04-01 02:30:32 -04:00
export default EmailPage;