import * as React from "react"; import { BrowserRouter, Route, Switch } from "react-router-dom"; import * as routes from "../../constants/routes"; import { firebase } from "../../firebase"; import { Account } from "../Account"; import { Home } from "../Home"; import { Landing } from "../Landing"; import { Navigation } from "../Navigation"; import { PasswordForget } from "../PasswordForget"; import { withAuthentication } from "../Session/withAuthentication"; import { SignIn } from "../SignIn"; import { SignUp } from "../SignUp"; class AppComponent extends React.Component { constructor(props: any) { super(props); this.state = { authUser: null }; } componentDidMount() { firebase.auth.onAuthStateChanged(authUser => { authUser ? this.setState(() => ({ authUser })) : this.setState(() => ({ authUser: null })); }); } render() { return (

); } } export const App = withAuthentication(AppComponent);