{"size": 2853, "ext": "js", "max_stars_repo_path": "src/App.js", "max_stars_repo_name": "MikeMcmanus95/TryCatch", "max_stars_repo_stars_event_min_datetime": "2019-11-20T15:53:20.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-03T22:58:07.000Z", "max_issues_repo_path": "src/App.js", "max_issues_repo_name": "MikeMcmanus95/TryCatch", "max_issues_repo_issues_event_min_datetime": "2019-11-20T16:20:56.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-22T09:55:56.000Z", "max_forks_repo_path": "src/App.js", "max_forks_repo_name": "codewars-clone/TryCatch", "max_forks_repo_forks_event_min_datetime": "2019-12-17T23:03:29.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-13T20:32:31.000Z"}
{"max_stars_count": 2, "max_issues_count": 26, "max_forks_count": 3, "avg_line_length": 23.5785123967, "max_line_length": 76, "alphanum_fraction": 0.3673326323}
import React, { Component } from 'react';
import { connect } from 'react-redux';
import {
  SignUp,
  Info,
  Preferences,
  Assets,
  Terms,
  Dashbar,
  Try,
  AwaitList,
  AllCatach,
  Settings,
  Splash,
  ChatRoom,
  SignIn,
} from './client/components/index';
import { Route, Switch } from 'react-router-dom';
import { verifyAuth } from './client/store/reducers/auth';

class App extends Component {
  render() {
    const { isLoggedOut } = this.props;
    return (
      <div className="App">
        {isLoggedOut ? (
          <div>
            <Route path="/signUp" component={SignUp} />
            <Route
              exact
              path="/"
              render={() => (
                <div>
                  <SignIn />{' '}
                  <div id="filler" style={{ backgroundColor: '#2f323b' }} />
                </div>
              )}
            />
          </div>
        ) : (
          <Switch>
            <Route
              exact
              path="/"
              render={() => (
                <div>
                  <Try /> <Dashbar />
                </div>
              )}
            />
            <Route path="/info" component={Info} />
            <Route path="/preferences" component={Preferences} />
            <Route path="/assets" component={Assets} />
            <Route path="/terms" component={Terms} />
            <Route
              path="/try"
              render={() => (
                <div>
                  <Try /> <Dashbar />
                </div>
              )}
            />{' '}
            />
            <Route
              path="/await"
              render={() => (
                <div>
                  <AwaitList /> <Dashbar />
                </div>
              )}
            />{' '}
            />
            <Route
              path="/catch"
              render={() => (
                <div>
                  <AllCatach /> <Dashbar />
                </div>
              )}
            />{' '}
            />
            <Route
              path="/settings"
              render={() => (
                <div>
                  <Settings /> <Dashbar />
                </div>
              )}
            />{' '}
            />
            <Route
              path="/splash"
              render={() => (
                <div>
                  <Splash /> <Dashbar />
                </div>
              )}
            />{' '}
            />
            <Route path="/chat/:id" component={ChatRoom} />
          </Switch>
        )}
      </div>
    );
  }
}
const mapState = state => {
  return {
    isLoggedIn: state.firebase.auth.isLoaded,
    isLoggedOut: state.firebase.auth.isEmpty,
  };
};

const mapDispatch = dispatch => {
  return {
    isVerified: () => dispatch(verifyAuth()),
  };
};

export default connect(mapState, mapDispatch)(App);
