App.js 802 Bytes
Newer Older
1
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
Kim, Subin's avatar
Kim, Subin committed
2
3
4
5
6
7
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
8
9
10

function App() {
  return (
Kim, Subin's avatar
Kim, Subin committed
11
12
13
14
15
16
17
18
19
    <Router basename={process.env.PUBLIC_URL}>
      <Switch>
        <Route path="/" component={Err} />
        <Route path="/home" component={HomePage} />
        <Route path="/schedule/edit" component={ScheduleEditPage} />
        <Route path="/schedule" component={SchedulePage} />
        <PrivateRoute path="/admin" component={AdminPage} role="admin" />
      </Switch>
    </Router>
Kim, Subin's avatar
Kim, Subin committed
20
21
22
  );
}

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