// @flow import React from 'react'; import { Form, FormField } from 'component/common/form'; import Button from 'component/button'; import Card from 'component/common/card'; import { setSavedPassword } from 'util/saved-passwords'; import usePersistedState from 'effects/use-persisted-state'; import I18nMessage from 'component/i18nMessage'; type Props = { getSync: ((any, boolean) => void, ?string) => void, getSyncIsPending: boolean, email: string, passwordError: boolean, signOut: () => void, handleSyncComplete: (any, boolean) => void, }; function SyncPassword(props: Props) { const { getSync, getSyncIsPending, email, signOut, passwordError, handleSyncComplete } = props; const [password, setPassword] = React.useState(''); const [rememberPassword, setRememberPassword] = usePersistedState(true); function handleSubmit() { getSync((error, hasDataChanged) => { handleSyncComplete(error, hasDataChanged); if (!error) { setSavedPassword(password, rememberPassword); } }, password); } return (
setPassword(e.target.value)} /> setRememberPassword(!rememberPassword)} />

, email: