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