2017-06-08 23:15:34 +02:00
|
|
|
import React from "react";
|
2017-12-07 19:07:30 +01:00
|
|
|
import { CreditAmount } from "component/common";
|
2017-09-11 03:25:24 +02:00
|
|
|
import { Form, FormRow, Submit } 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,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-09-11 03:25:24 +02:00
|
|
|
handleSubmit() {
|
|
|
|
const { email } = this.state;
|
|
|
|
this.props.addUserEmail(email);
|
2017-06-02 02:51:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-12-07 19:07:30 +01:00
|
|
|
const { cancelButton, errorMessage, isPending, rewardAmount } = this.props;
|
2017-06-02 02:51:52 +02:00
|
|
|
|
2017-06-08 23:15:34 +02:00
|
|
|
return (
|
2017-12-07 19:07:30 +01:00
|
|
|
<div>
|
2017-08-26 05:21:26 +02:00
|
|
|
<p>
|
2017-12-07 19:07:30 +01:00
|
|
|
Let us know your email and you'll receive{" "}
|
|
|
|
<CreditAmount amount={rewardAmount} label="LBC" />, the blockchain
|
|
|
|
token used by LBRY.
|
2017-08-26 05:21:26 +02:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{__(
|
2017-12-07 19:07:30 +01:00
|
|
|
"We'll also let you know about LBRY updates, security issues, and great new content."
|
2017-08-26 05:21:26 +02:00
|
|
|
)}
|
|
|
|
</p>
|
2017-12-07 19:07:30 +01:00
|
|
|
<p>
|
|
|
|
{__("We'll never sell your email, and you can unsubscribe at any time.")}
|
|
|
|
</p>
|
|
|
|
<Form onSubmit={this.handleSubmit.bind(this)}>
|
|
|
|
<FormRow
|
|
|
|
type="text"
|
|
|
|
label="Email"
|
|
|
|
placeholder="youremail@example.org"
|
|
|
|
name="email"
|
|
|
|
value={this.state.email}
|
|
|
|
errorMessage={errorMessage}
|
|
|
|
onChange={event => {
|
|
|
|
this.handleEmailChanged(event);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<div className="form-row-submit">
|
|
|
|
<Submit label="Submit" disabled={isPending} />
|
|
|
|
{cancelButton}
|
|
|
|
</div>
|
|
|
|
</Form>
|
|
|
|
</div>
|
2017-06-08 23:15:34 +02:00
|
|
|
);
|
2017-06-02 02:51:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-08 23:15:34 +02:00
|
|
|
export default UserEmailNew;
|