Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
survey
Commits
f3c4f117
Commit
f3c4f117
authored
Jul 20, 2022
by
jang dong hyeok
Browse files
profile의 card 클릭했을 때 수정,결과창으로 넘어가기
parent
3052a1ed
Changes
5
Show whitespace changes
Inline
Side-by-side
frontend/src/SurveyRouter.tsx
View file @
f3c4f117
...
...
@@ -6,7 +6,7 @@ import { RequireAuth } from "./auth/RequireAuth";
import
{
SurveyForm
}
from
"
./commons
"
;
import
{
Home
}
from
"
./home
"
;
import
{
Profile
}
from
"
./profile
"
;
import
{
EditRes
ponse
Button
}
from
"
./survey
"
;
import
{
EditRes
ult
Button
}
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
=
{
<
EditRes
ponse
Button
/>
}
>
<
Route
path
=
"surveys/edit/"
element
=
{
<
EditRes
ult
Button
/>
}
>
<
Route
path
=
":surveyId"
element
=
{
<
EditSurvey
/>
}
/>
<
Route
path
=
":surveyId/res
ponse
"
element
/>
<
Route
path
=
":surveyId/res
ult
"
element
/>
</
Route
>
<
Route
path
=
"survey"
element
=
{
<
SurveyForm
/>
}
/>
<
Route
...
...
frontend/src/profile/MySurveyCard.tsx
View file @
f3c4f117
...
...
@@ -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
>
);
};
frontend/src/survey/EditRes
ponse
Button.tsx
→
frontend/src/survey/EditRes
ult
Button.tsx
View file @
f3c4f117
import
React
from
"
react
"
;
import
{
Outlet
,
useNavigate
,
useParams
}
from
"
react-router-dom
"
;
export
const
EditRes
ponse
Button
=
()
=>
{
export
const
EditRes
ult
Button
=
()
=>
{
let
{
surveyId
}
=
useParams
<
{
surveyId
:
string
}
>
();
const
navigate
=
useNavigate
();
...
...
frontend/src/survey/Result.tsx
0 → 100644
View file @
f3c4f117
import
React
from
"
react
"
;
frontend/src/survey/index.tsx
View file @
f3c4f117
export
{
EditRes
ponse
Button
}
from
"
./EditRes
ponse
Button
"
;
export
{
EditRes
ult
Button
}
from
"
./EditRes
ult
Button
"
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment