SurveyRouter.tsx 1.03 KB
Newer Older
1
2
3
4
import React from "react";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import App from "./App";
import { Login, SignUp } from "./auth";
5
import { RequireAuth } from "./auth/RequireAuth";
6
7
import { SurveyForm } from "./commons";
import { CreateSurveyForm } from "./CreateSurveyForm";
8
import { Home } from "./home";
9
import { Profile } from "./profile";
10
import { CreateSurvey } from "./survey";
11
12
13
14
15
16
17
18
19

export const SurveyRouter = () => {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<App />}>
          <Route index element={<Home />} />
          <Route path="login" element={<Login />} />
          <Route path="signup" element={<SignUp />} />
20
          <Route path="surveys/create" element={<CreateSurvey />} />
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
21
          <Route path="survey" element={<SurveyForm />} />
22
23
24
25
26
27
28
29
          <Route
            path="profile"
            element={
              <RequireAuth>
                <Profile />
              </RequireAuth>
            }
          />
30
31
32
33
34
        </Route>
      </Routes>
    </BrowserRouter>
  );
};