Commit f3c4f117 authored by jang dong hyeok's avatar jang dong hyeok
Browse files

profile의 card 클릭했을 때 수정,결과창으로 넘어가기

parent 3052a1ed
...@@ -6,7 +6,7 @@ import { RequireAuth } from "./auth/RequireAuth"; ...@@ -6,7 +6,7 @@ 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 { EditResponseButton } from "./survey"; import { EditResultButton } from "./survey";
import { EditSurvey } from "./survey/EditSurvey"; import { EditSurvey } from "./survey/EditSurvey";
export const SurveyRouter = () => { export const SurveyRouter = () => {
...@@ -17,9 +17,9 @@ export const SurveyRouter = () => { ...@@ -17,9 +17,9 @@ 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/" element={<EditResponseButton />}> <Route path="surveys/edit/" element={<EditResultButton />}>
<Route path=":surveyId" element={<EditSurvey />} /> <Route path=":surveyId" element={<EditSurvey />} />
<Route path=":surveyId/response" element /> <Route path=":surveyId/result" element />
</Route> </Route>
<Route path="survey" element={<SurveyForm />} /> <Route path="survey" element={<SurveyForm />} />
<Route <Route
......
...@@ -45,31 +45,32 @@ export const MySurveyCard = ({ data }: Props) => { ...@@ -45,31 +45,32 @@ export const MySurveyCard = ({ data }: Props) => {
} }
return ( return (
<div className="w-52 h-60 rounded border-2"> <div className="w-52 h-60 rounded border-2 hover:border-2 hover:border-themeColor">
<div className="h-32 p-5"> <button className="w-full" onClick={editSurvey}>
<div className="h-36 p-5">
<p className="text-gray-700"> <p className="text-gray-700">
{data.comment ? data.comment : "설명없는 설문조사"} {data.comment ? data.comment : "설명없는 설문조사"}
</p> </p>
</div> </div>
<div className="flex flex-col px-5 py-3">
<div className="h-12"> <div className="flex flex-col h-12 place-items-center">
<button type="button" onClick={goSurvey}>
<p className="font-bold"> <p className="font-bold">
{data.title ? data.title : "제목없는 설문조사"} {data.title ? data.title : "제목없는 설문조사"}
</p> </p>
</button>
<p className="text-gray-500 text-sm"> <p className="text-gray-500 text-sm">
{data.updatedAt?.substring(0, 10)} {data.updatedAt?.substring(0, 10)}
</p> </p>
</div> </div>
</button>
<div className="flex justify-end pt-1"> <div className="flex justify-end pt-1">
<button {/*<button
type="button" type="button"
className="bg-themeColor rounded text-white py-1 px-1.5 mr-1" className="bg-themeColor rounded text-white py-1 px-1.5 mr-1"
onClick={editSurvey} onClick={editSurvey}
> >
수정 수정
</button> </button>*/}
<button <button
type="button" type="button"
className="bg-themeColor rounded text-white py-1 px-1.5 ml-1" className="bg-themeColor rounded text-white py-1 px-1.5 ml-1"
...@@ -79,6 +80,5 @@ export const MySurveyCard = ({ data }: Props) => { ...@@ -79,6 +80,5 @@ export const MySurveyCard = ({ data }: Props) => {
</button> </button>
</div> </div>
</div> </div>
</div>
); );
}; };
import React from "react"; import React from "react";
import { Outlet, useNavigate, useParams } from "react-router-dom"; import { Outlet, useNavigate, useParams } from "react-router-dom";
export const EditResponseButton = () => { export const EditResultButton = () => {
let { surveyId } = useParams<{ surveyId: string }>(); let { surveyId } = useParams<{ surveyId: string }>();
const navigate = useNavigate(); const navigate = useNavigate();
......
import React from "react";
export { EditResponseButton } from "./EditResponseButton"; export { EditResultButton } from "./EditResultButton";
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