SurveyRouter.tsx 1.17 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";
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/edit/" element={<EditResultButton />}>
21
            <Route path=":surveyId" element={<EditSurvey />} />
22
            <Route path=":surveyId/result" element />
23
          </Route>
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
24
          <Route path="survey" element={<SurveyForm />} />
25
26
27
28
29
30
31
32
          <Route
            path="profile"
            element={
              <RequireAuth>
                <Profile />
              </RequireAuth>
            }
          />
33
34
35
36
37
        </Route>
      </Routes>
    </BrowserRouter>
  );
};