Commit 3052a1ed authored by Jiwon Yoon's avatar Jiwon Yoon
Browse files

Merge branch 'DH6' into develop0718

parents de41c36d dfd1731e
...@@ -6,7 +6,8 @@ import { RequireAuth } from "./auth/RequireAuth"; ...@@ -6,7 +6,8 @@ import { RequireAuth } from "./auth/RequireAuth";
import { SurveyForm } from "./commons"; import { SurveyForm } from "./commons";
import { Home } from "./home"; import { Home } from "./home";
import { Profile } from "./profile"; import { Profile } from "./profile";
import { EditSurvey } from "./survey"; import { EditResponseButton } from "./survey";
import { EditSurvey } from "./survey/EditSurvey";
export const SurveyRouter = () => { export const SurveyRouter = () => {
return ( return (
...@@ -16,8 +17,11 @@ export const SurveyRouter = () => { ...@@ -16,8 +17,11 @@ export const SurveyRouter = () => {
<Route index element={<Home />} /> <Route index element={<Home />} />
<Route path="login" element={<Login />} /> <Route path="login" element={<Login />} />
<Route path="signup" element={<SignUp />} /> <Route path="signup" element={<SignUp />} />
<Route path="surveys/edit/:surveyId" element={<EditSurvey />} /> <Route path="surveys/edit/" element={<EditResponseButton />}>
<Route path="surveys/:surveyId" element={<SurveyForm />} /> <Route path=":surveyId" element={<EditSurvey />} />
<Route path=":surveyId/response" element />
</Route>
<Route path="survey" element={<SurveyForm />} />
<Route <Route
path="profile" path="profile"
element={ element={
......
import React from "react";
import { Outlet, useNavigate, useParams } from "react-router-dom";
export const EditResponseButton = () => {
let { surveyId } = useParams<{ surveyId: string }>();
const navigate = useNavigate();
function editButtonClick(e: React.MouseEvent<HTMLButtonElement>) {
navigate(`/surveys/edit/${surveyId}`);
}
return (
<div>
<div className="flex place-content-center">
<button
className="text-xl m-3 underline decoration-4"
onClick={editButtonClick}
>
설문지 수정
</button>
<button
className="text-xl m-3 underline"
/*onClick={}*/
>
응답결과
</button>
</div>
<Outlet />
</div>
);
};
export { EditSurvey } from "./EditSurvey"; export { EditResponseButton } from "./EditResponseButton";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment