{"size": 901, "ext": "js", "max_stars_repo_path": "app/domains/App/index.js", "max_stars_repo_name": "RomanBednyakov/react-redux-boilerplate-2018", "max_stars_repo_stars_event_min_datetime": "2018-09-18T11:36:13.000Z", "max_stars_repo_stars_event_max_datetime": "2018-09-18T11:36:13.000Z", "max_issues_repo_path": "app/domains/App/index.js", "max_issues_repo_name": "RomanBednyakov/react-redux-boilerplate-2018", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/domains/App/index.js", "max_forks_repo_name": "RomanBednyakov/react-redux-boilerplate-2018", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.5, "max_line_length": 66, "alphanum_fraction": 0.5205327414}
import React from "react";
import { Route, Switch, Redirect } from "react-router-dom";
import "./app.scss";
import { connect } from "react-redux";
import { calendarSelectors } from "../../redux/modules/calendar";
import Home from "../home/index";

const mapStateToProps = state => {
  return {
    isAuth: calendarSelectors.getIsAuth(state)
  };
};
class App extends React.Component {
  render() {
    return (
      <Switch>
        <Route path="/home" component={Home} />
        <Route
          path="/*"
          render={() => {
            if (this.props.isAuth === true) {
              return <Redirect to="/home" />;
            } else if (this.props.isAuth === false) {
              return <Redirect to="/home" />;
            }
            return <div />;
          }}
        />
      </Switch>
    );
  }
}
export default connect(mapStateToProps)(App);
