2017-06-08 23:15:34 +02:00
|
|
|
import React from "react";
|
|
|
|
import Link from "component/link";
|
|
|
|
import { FormRow } from "component/form.js";
|
2017-06-02 02:51:52 +02:00
|
|
|
|
2017-06-09 02:10:53 +02:00
|
|
|
class UserEmailNew extends React.PureComponent {
|
2017-06-02 02:51:52 +02:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
2017-06-08 23:15:34 +02:00
|
|
|
email: "",
|
2017-06-02 02:51:52 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
handleEmailChanged(event) {
|
|
|
|
this.setState({
|
|
|
|
email: event.target.value,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
handleSubmit(event) {
|
|
|
|
event.preventDefault();
|
2017-06-08 23:15:34 +02:00
|
|
|
this.props.addUserEmail(this.state.email);
|
2017-06-02 02:51:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-06-08 23:15:34 +02:00
|
|
|
const { errorMessage, isPending } = this.props;
|
2017-06-02 02:51:52 +02:00
|
|
|
|
2017-06-08 23:15:34 +02:00
|
|
|
return (
|
|
|
|
<form
|
|
|
|
className="form-input-width"
|
|
|
|
onSubmit={event => {
|
|
|
|
this.handleSubmit(event);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<FormRow
|
|
|
|
type="text"
|
|
|
|
label="Email"
|
|
|
|
placeholder="scrwvwls@lbry.io"
|
|
|
|
name="email"
|
|
|
|
value={this.state.email}
|
|
|
|
errorMessage={errorMessage}
|
|
|
|
onChange={event => {
|
|
|
|
this.handleEmailChanged(event);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<div className="form-row-submit">
|
|
|
|
<Link
|
|
|
|
button="primary"
|
|
|
|
label="Next"
|
|
|
|
disabled={isPending}
|
|
|
|
onClick={event => {
|
|
|
|
this.handleSubmit(event);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
);
|
2017-06-02 02:51:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-08 23:15:34 +02:00
|
|
|
export default UserEmailNew;
|