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
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";
8
9
import LoginPage from "./pages/LoginPage";
import SignupPage from "./pages/SignupPage";
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}>
14
15
16
17
18
19
20
21
22
23
24
      <div className="mx-auto" style={{ width: "400px" }}>
        <Switch>
          <Route exact path="/" component={LoginPage} />
          <Route path="/signup" component={SignupPage} />
          <Route path="/home" component={HomePage} />
          <Route path="/schedule/edit" component={ScheduleEditPage} />
          <Route path="/schedule" component={SchedulePage} />
          <PrivateRoute path="/admin" component={AdminPage} role="admin" />
        </Switch>
      </div>

Kim, Subin's avatar
Kim, Subin committed
25
    </Router>
Kim, Subin's avatar
Kim, Subin committed
26
27
28
  );
}

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