import React from 'react'; import { Form, FormRow, Submit } from 'component/form.js'; class UserFieldNew extends React.PureComponent { constructor(props) { super(props); this.state = { phone: '', email: '', }; } handleChanged(event, fieldType) { this.setState({ [fieldType]: event.target.value, }); } handleSubmit() { const { email, phone } = this.state; if (phone) { this.props.addUserPhone(phone); } else { this.props.addUserEmail(email); } } render() { const { cancelButton, errorMessage, isPending, fieldType } = this.props; return fieldType === 'phone' ? (

{__( 'Enter your phone number and we will send you a verification code. We will not share your phone number with third parties.' )}

{ this.handleChanged(event, 'phone'); }} />
{cancelButton}
) : (

{__("We'll let you know about LBRY updates, security issues, and great new content.")}

{__("We'll never sell your email, and you can unsubscribe at any time.")}

{ this.handleChanged(event, 'email'); }} />
{cancelButton}
); } } export default UserFieldNew;