App.js 1.72 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
13
import AdminPage from "./pages/AdminPage";
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
26
          <Route path="/home" component={HomePage} />
          <Route path="/schedule/edit" component={ScheduleEditPage} />
          <Route path="/schedule" component={SchedulePage} />
27
28
29
30
31
          <Route path="/todo" component={ToDoPage} />
          <Route path="/studyplan/edit" component={StudyPlanEditPage} />
          <Route path="/studyplan/:" component={StudyPlanPage} />
          <Route path="/studyplan" component={StudyPlanListPage} />
          <Route path="/subject/edit" component={SubjectEditPage} />
Kim, Subin's avatar
Kim, Subin committed
32
          <PrivateRoute path="/admin" component={AdminPage} role="admin" />
Kim, Subin's avatar
Kim, Subin committed
33
34

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

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