import React, { Component } from 'react' import { connect } from 'react-redux' import { withRouter } from 'react-router' import { Redirect, Route, Switch } from 'react-router-dom' import OauthBotFlow from '../components/oauth-bot-flow' import OauthCallback from '../components/oauth-callback' import OauthFlow from '../components/oauth-flow' import Servers from '../components/servers' import ServerLanding from '../components/servers/ServerLanding' import Pages, { Error404, Landing } from '../pages' class _AppRouter extends Component { render() { const isLoggedIn = this.props.user.get('isLoggedIn') if (!this.props.ready) { return null } return ( {isLoggedIn === true ? ( // YES LOGGED IN } /> ) : ( // NOT LOGGED IN [ , } />, ] )} {/* GENERAL ROUTES */} (isLoggedIn ? : )} /> ) } } export default withRouter(connect(({ appState, user }) => ({ ready: appState.ready, user }))(_AppRouter))