App.js 876 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
    <Router basename={process.env.PUBLIC_URL}>
      <Switch>
Kim, Subin's avatar
Kim, Subin committed
13
14
15
16
17
18
19
        <div style={{ width: "400px" }}>
          <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" /> */}
        </div>
Kim, Subin's avatar
Kim, Subin committed
20
21
      </Switch>
    </Router>
Kim, Subin's avatar
Kim, Subin committed
22
23
24
  );
}

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