// @flow import React, { useState } from 'react'; import { FormField, Form } from 'component/common/form'; import Button from 'component/button'; import analytics from 'analytics'; import { EMAIL_REGEX } from 'constants/email'; import I18nMessage from 'component/i18nMessage'; type Props = { errorMessage: ?string, isPending: boolean, addUserEmail: string => void, syncEnabled: boolean, setSync: boolean => void, balance: number, }; function UserEmailNew(props: Props) { const { errorMessage, isPending, addUserEmail, setSync } = props; const [newEmail, setEmail] = useState(''); const [formSyncEnabled, setFormSyncEnabled] = useState(true); const valid = newEmail.match(EMAIL_REGEX); function handleSubmit() { setSync(formSyncEnabled); addUserEmail(newEmail); analytics.emailProvidedEvent(); } return (

{__('Sign In to LBRY')}

{__('Create a new account or sign in.')}

setEmail(e.target.value)} /> {!IS_WEB && ( {__('Sync balance and preferences across devices.')}{' '}