App.js 1.95 KB
Newer Older
1
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
Kim, Subin's avatar
Kim, Subin committed
2
3
import LoginPage from "./pages/LoginPage";
import SignupPage from "./pages/SignupPage";
Kim, Subin's avatar
Kim, Subin committed
4
5
6
import HomePage from "./pages/HomePage";
import SchedulePage from "./pages/SchedulePage";
import ScheduleEditPage from "./pages/ScheduleEditPage";
7
8
9
10
11
import ToDoPage from "./pages/ToDoPage";
import StudyPlanListPage from "./pages/StudyPlanListPage";
import StudyPlanPage from "./pages/StudyPlanPage";
import StudyPlanEditPage from "./pages/StudyPlanEditPage";
import SubjectEditPage from "./pages/SubjectEditPage";
Kim, Subin's avatar
Kim, Subin committed
12
import AdminPage from "./pages/Admin/AdminPage";
Kim, Subin's avatar
Kim, Subin committed
13
import PrivateRoute from "./components/PrivateRoute";
Kim, Subin's avatar
Kim, Subin committed
14
import ErrorPage from "./pages/ErrorPage";
Kim, Subin's avatar
Kim, Subin committed
15
16
17

function App() {
  return (
Kim, Subin's avatar
Kim, Subin committed
18
    <Router basename={process.env.PUBLIC_URL}>
19
      <div id="box" className="container position-relative vh-100 mx-sm-auto">
Kim, Subin's avatar
Kim, Subin committed
20
        <Switch>
Kim, Subin's avatar
Kim, Subin committed
21
22
          <Route exact path="/" component={LoginPage} />
          <Route path="/login" component={LoginPage} />
23
          <Route path="/signup" component={SignupPage} />
Kim, Subin's avatar
Kim, Subin committed
24
25
          <Route path="/home" component={HomePage} />
          <Route path="/schedule/edit" component={ScheduleEditPage} />
Kim, Subin's avatar
Kim, Subin committed
26
          <Route path="/schedule/:date" component={SchedulePage} />
Kim, Subin's avatar
Kim, Subin committed
27
          <Route path="/todo/:date" component={ToDoPage} />
28
29
30
          <Route path="/studyplan/edit" component={StudyPlanEditPage} />
          <Route path="/studyplan/:" component={StudyPlanPage} />
          <Route path="/studyplan" component={StudyPlanListPage} />
31
          <Route path="/subject/edit/:subjectId" component={SubjectEditPage} />
32
          <Route path="/subject/edit" component={SubjectEditPage} />
Kim, Subin's avatar
Kim, Subin committed
33
          <Route path="/admin/edit" component={ScheduleEditPage} />
Kim, Subin's avatar
Kim, Subin committed
34
35
          <Route path="/admin" component={AdminPage} />
          {/* <PrivateRoute path="/admin" component={AdminPage} role="admin" /> */}
Kim, Subin's avatar
Kim, Subin committed
36
37

          <Route component={ErrorPage} />
Kim, Subin's avatar
Kim, Subin committed
38
39
        </Switch>
      </div>
Kim, Subin's avatar
Kim, Subin committed
40
    </Router>
Kim, Subin's avatar
Kim, Subin committed
41
42
43
  );
}

Kim, Subin's avatar
Kim, Subin committed
44
export default App;