{"size": 1075, "ext": "js", "max_stars_repo_path": "src/App.js", "max_stars_repo_name": "nareshNishad/Hacker-news-clone", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/App.js", "max_issues_repo_name": "nareshNishad/Hacker-news-clone", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/App.js", "max_forks_repo_name": "nareshNishad/Hacker-news-clone", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.4318181818, "max_line_length": 138, "alphanum_fraction": 0.5525581395}
import {
  Route,
  BrowserRouter as Router,
  Switch,
  Redirect,
} from "react-router-dom";

import style from "./App.module.css";
import Main from "./component/Main";
import Login from "./component/Login";
import Register from "./component/Register";
const setting = {
  type: "story",
  dateRange: "all",
  sort: "byPopularity",
  query: "",
  page: 0,
};
function App() {
  return (
    <div className={style.app}>
      <div className={style.container}>
        <Router>
          <Switch>
            <Route
              exact
              path="/query=:query?/sort=:sort/page=:page/dateRange=:dateRange/type=:type"
            >
              <Main />
            </Route>
            <Route exact path="/login" component={Login} />
            <Route exact path="/register" component={Register} />
            <Redirect
              to={`/query=${setting.query}/sort=${setting.sort}/page=${setting.page}/dateRange=${setting.dateRange}/type=${setting.type}`}
            />
          </Switch>
        </Router>
      </div>
    </div>
  );
}

export default App;
