// @flow import * as MODALS from 'constants/modal_types'; import React from 'react'; import Button from 'component/button'; import SettingsRow from 'component/settingsRow'; import { withRouter } from 'react-router'; import { FormField } from 'component/common/form'; type Props = { setSyncEnabled: (boolean) => void, syncEnabled: boolean, verifiedEmail: ?string, history: { push: (string) => void }, location: UrlLocation, getSyncError: ?string, disabled: boolean, openModal: (string, any) => void, }; function SyncToggle(props: Props) { const { verifiedEmail, openModal, syncEnabled, disabled } = props; return ( openModal(MODALS.SYNC_ENABLE, { mode: syncEnabled ? 'disable' : 'enable' })} disabled={disabled || !verifiedEmail} helper={ disabled ? __("To enable Sync, close LBRY completely and check 'Remember Password' during wallet unlock.") : null } /> {!verifiedEmail && (

{__('An email address is required to sync your account.')}

)}
); } export default withRouter(SyncToggle);