import * as React from 'react'; import { connect } from 'react-redux'; import { Switch, Route, Redirect, withRouter } from 'react-router'; import Paper from 'material-ui/Paper'; import JournalList from './JournalList'; import JournalView from './JournalView'; import JournalFetcher from './JournalFetcher'; import LoginForm from './LoginForm'; import { routeResolver } from './App'; import { store, StoreState, CredentialsType, CredentialsData, fetchCredentials } from './store'; class EteSyncContext 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) { store.dispatch(fetchCredentials(username, password, encryptionPassword, serviceApiUrl)); } render() { if (this.props.credentials.fetching) { return (