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
dfd1731e
Commit
dfd1731e
authored
Jul 18, 2022
by
jang dong hyeok
Browse files
수정페이지 UI 및 route 연결
parent
8b8c6f9c
Changes
4
Show whitespace changes
Inline
Side-by-side
frontend/src/SurveyRouter.tsx
View file @
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,7 +17,10 @@ export const SurveyRouter = () => {
...
@@ -16,7 +17,10 @@ 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
=
":surveyId"
element
=
{
<
EditSurvey
/>
}
/>
<
Route
path
=
":surveyId/response"
element
/>
</
Route
>
<
Route
path
=
"survey"
element
=
{
<
SurveyForm
/>
}
/>
<
Route
path
=
"survey"
element
=
{
<
SurveyForm
/>
}
/>
<
Route
<
Route
path
=
"profile"
path
=
"profile"
...
...
frontend/src/apis/baseUrl.ts
View file @
dfd1731e
frontend/src/survey/EditResponseButton.tsx
0 → 100644
View file @
dfd1731e
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
>
);
};
frontend/src/survey/index.tsx
View file @
dfd1731e
export
{
Edit
Survey
}
from
"
./Edit
Survey
"
;
export
{
Edit
ResponseButton
}
from
"
./Edit
ResponseButton
"
;
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