SurveyRouter.tsx 1.23 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
import { SurveyForm } from "./commons";
7
import { Home } from "./home";
8
import { Profile } from "./profile";
9
import { EditResultButton } from "./survey";
10
import { EditSurvey } from "./survey/EditSurvey";
jang dong hyeok's avatar
.    
jang dong hyeok committed
11
import { ResultSurvey } from "./survey/ResultSurvey";
12
13
14
15
16
17
18
19
20

export const SurveyRouter = () => {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<App />}>
          <Route index element={<Home />} />
          <Route path="login" element={<Login />} />
          <Route path="signup" element={<SignUp />} />
jang dong hyeok's avatar
jang dong hyeok committed
21
22
          <Route path="surveys/:surveyId/" element={<EditResultButton />}>
            <Route path="edit" element={<EditSurvey />} />
jang dong hyeok's avatar
.    
jang dong hyeok committed
23
            <Route path="result" element={<ResultSurvey />} />
24
          </Route>
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
25
          <Route path="survey" element={<SurveyForm />} />
26
27
28
29
30
31
32
33
          <Route
            path="profile"
            element={
              <RequireAuth>
                <Profile />
              </RequireAuth>
            }
          />
34
35
36
37
38
        </Route>
      </Routes>
    </BrowserRouter>
  );
};