App.js 1.02 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
7
8
9
import HomePage from "./pages/HomePage";
import SchedulePage from "./pages/SchedulePage";
import ScheduleEditPage from "./pages/ScheduleEditPage";
import AdminPage from "./pages/AdminPage";
import PrivateRoute from "./components/PrivateRoute";
import Err from "./pages/ErrorPage";
Kim, Subin's avatar
Kim, Subin committed
10
11
12

function App() {
  return (
Kim, Subin's avatar
Kim, Subin committed
13
    <Router basename={process.env.PUBLIC_URL}>
Kim, Subin's avatar
Kim, Subin committed
14
15
16
      <div className="mx-auto" style={{ width: "400px" }}>
        <Switch>
          <Route exact path="/" component={Err} />
17
          <Route path="/signup" component={SignupPage} />
Kim, Subin's avatar
Kim, Subin committed
18
19
20
          <Route path="/home" component={HomePage} />
          <Route path="/schedule/edit" component={ScheduleEditPage} />
          <Route path="/schedule" component={SchedulePage} />
Kim, Subin's avatar
Kim, Subin committed
21
22
23
          <PrivateRoute path="/admin" component={AdminPage} role="admin" />
        </Switch>
      </div>
Kim, Subin's avatar
Kim, Subin committed
24
    </Router>
Kim, Subin's avatar
Kim, Subin committed
25
26
27
  );
}

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