import * as React from 'react'; import Container from './widgets/Container'; import ExternalLink from './widgets/ExternalLink'; import SyncGate from './SyncGate'; import LoginForm from './components/LoginForm'; import { store, CredentialsType } from './store'; import { fetchCredentials } from './store/actions'; import * as C from './constants'; class Root extends React.Component { props: { credentials: CredentialsType; }; constructor(props: any) { super(props); this.onFormSubmit = this.onFormSubmit.bind(this); } onFormSubmit(username: string, password: string, encryptionPassword: string, serviceApiUrl?: string) { serviceApiUrl = serviceApiUrl ? serviceApiUrl : C.serviceApiBase; store.dispatch(fetchCredentials(username, password, encryptionPassword, serviceApiUrl)); } render() { if (this.props.credentials.value === null) { const style = { isSafe: { textDecoration: 'none', display: 'block', }, divider: { margin: '30px 0', color: '#00000025', } }; return (

Please Log In


); } return ( ); } } export default Root;