{"size": 1250, "ext": "js", "max_stars_repo_path": "src/App.js", "max_stars_repo_name": "JoeyR84/newCompCard", "max_stars_repo_stars_event_min_datetime": "2019-09-24T01:18:07.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-24T01:18:07.000Z", "max_issues_repo_path": "src/App.js", "max_issues_repo_name": "JoeyR84/newCompCard", "max_issues_repo_issues_event_min_datetime": "2021-05-10T05:21:27.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-21T02:32:50.000Z", "max_forks_repo_path": "src/App.js", "max_forks_repo_name": "JoeyR84/newCompCard", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 25.5102040816, "max_line_length": 52, "alphanum_fraction": 0.6144}
import React from "react";
import { Router } from "@reach/router";
import styled from "styled-components";

import { AUTH_TOKEN } from "./constants";
// pages
import Layout from "./components/layout/Layout";
import Login from "./pages/Login";
import RouteList from "./pages/RouteList";
import Route from "./pages/Route";
import Home from "./pages/Home";
import Signature from "./pages/Signature";
import Signup from "./pages/Signup";
import ProfilePage from "./pages/ProfilePage";
import AdminDashboard from "./pages/AdminDashboard";
import NotFound from "./pages/NotFound";

function App() {
  const auth = localStorage.getItem(AUTH_TOKEN);

  return (
    <Layout>
      {auth ? (
        <StyledRouter>
          <NotFound default />
          <Home path="/" />
          <RouteList path="routes" />
          <Route path="route" />
          <Signature path="signature" />
          <ProfilePage path="profile" />
          <AdminDashboard path="dashboard" />
        </StyledRouter>
      ) : (
        <StyledRouter>
          <NotFound default />
          <Login path="/" />
          <Signup path="signup" />
        </StyledRouter>
      )}
    </Layout>
  );
}

export default App;

const StyledRouter = styled(Router)`
  height: 100%;
`;
