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
34c9b310
Commit
34c9b310
authored
Jul 20, 2022
by
Lee SeoYeon
Browse files
버튼 크기 조정
parent
6d47b858
Changes
7
Show whitespace changes
Inline
Side-by-side
frontend/src/commons/ACheckboxForm.tsx
View file @
34c9b310
...
@@ -7,10 +7,10 @@ type Props = {
...
@@ -7,10 +7,10 @@ type Props = {
export
const
ACheckboxForm
=
({
element
}:
Props
)
=>
{
export
const
ACheckboxForm
=
({
element
}:
Props
)
=>
{
return
(
return
(
<
div
className
=
"flex w-full gap-
4
justify-around my-3"
>
<
div
className
=
"flex w-full gap-
2
justify-around my-3"
>
{
element
.
content
.
choices
.
map
((
choice
)
=>
(
{
element
.
content
.
choices
.
map
((
choice
)
=>
(
<
div
>
<
div
>
<
input
className
=
"mr-2"
type
=
"checkbox"
/>
<
input
className
=
"mr-2
w-4 h-4
"
type
=
"checkbox"
/>
<
label
className
=
"text-lg"
>
{
choice
.
text
}
</
label
>
<
label
className
=
"text-lg"
>
{
choice
.
text
}
</
label
>
</
div
>
</
div
>
))
}
))
}
...
...
frontend/src/commons/ADateForm.tsx
0 → 100644
View file @
34c9b310
import
React
from
"
react
"
;
export
const
ADateForm
=
()
=>
{
return
(
<
div
>
<
input
type
=
"date"
></
input
>
</
div
>
);
};
frontend/src/commons/ADropdownForm.tsx
View file @
34c9b310
...
@@ -7,8 +7,8 @@ type Props = {
...
@@ -7,8 +7,8 @@ type Props = {
export
const
ADropdownForm
=
({
element
}:
Props
)
=>
{
export
const
ADropdownForm
=
({
element
}:
Props
)
=>
{
return
(
return
(
<
div
className
=
"flex flex-col container w-4/5 h-auto
items-center
m-3 py-3"
>
<
div
className
=
"flex flex-col container w-4/5 h-auto m
b
-3 py-3"
>
<
select
className
=
"py-2 hover:bg-themeColor bg-gray-200 rounded "
>
<
select
className
=
"py-2
w-48
hover:bg-themeColor bg-gray-200 rounded "
>
{
element
.
content
.
choices
.
map
((
choice
)
=>
(
{
element
.
content
.
choices
.
map
((
choice
)
=>
(
<
option
>
{
choice
.
text
}
</
option
>
<
option
>
{
choice
.
text
}
</
option
>
))
}
))
}
...
...
frontend/src/commons/AFileForm.tsx
0 → 100644
View file @
34c9b310
import
React
from
"
react
"
;
import
{
FileType
}
from
"
../types
"
;
type
Props
=
{
element
:
FileType
;
};
export
const
AFileForm
=
({
element
}:
Props
)
=>
{
return
(
<
div
className
=
"flex w-full gap-4 justify-around my-3"
>
{
/* {element.content.choices.map((choice) => (
<div>
<input className="mr-2"></input>
<label className="text-lg">{choice.text}</label>
</div>
))} */
}
</
div
>
);
};
frontend/src/commons/AQuestion.tsx
View file @
34c9b310
import
React
,
{
useState
}
from
"
react
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
BasicQuestionType
,
SurveyType
}
from
"
../types
"
;
import
{
BasicQuestionType
,
SurveyType
}
from
"
../types
"
;
import
{
ACheckboxForm
}
from
"
./ACheckbox
"
;
import
{
ACheckboxForm
}
from
"
./ACheckboxForm
"
;
import
{
ADropdownForm
}
from
"
./ADropdown
"
;
import
{
ADateForm
}
from
"
./ADateForm
"
;
import
{
ADropdownForm
}
from
"
./ADropdownForm
"
;
import
{
AEssayForm
}
from
"
./AEssayForm
"
;
import
{
AEssayForm
}
from
"
./AEssayForm
"
;
import
{
AFileForm
}
from
"
./AFileForm
"
;
// import { AMatrixForm } from "./AMatrixForm";
import
{
ARadioForm
}
from
"
./ARadioForm
"
;
import
{
ARadioForm
}
from
"
./ARadioForm
"
;
import
{
ARatingForm
}
from
"
./ARatingForm
"
;
type
PropsType
=
{
type
PropsType
=
{
question
:
BasicQuestionType
;
question
:
BasicQuestionType
;
};
};
export
const
AQuestion
=
({
question
}:
PropsType
)
=>
{
export
const
AQuestion
=
({
question
}:
PropsType
)
=>
{
function
getContent
(
question
:
BasicQuestionType
)
{
function
getContent
(
question
:
BasicQuestionType
)
{
switch
(
question
.
type
)
{
switch
(
question
.
type
)
{
...
@@ -20,16 +25,14 @@ export const AQuestion = ({ question }: PropsType) => {
...
@@ -20,16 +25,14 @@ export const AQuestion = ({ question }: PropsType) => {
return
<
ACheckboxForm
element
=
{
question
}
/>;
return
<
ACheckboxForm
element
=
{
question
}
/>;
case
"
dropdown
"
:
case
"
dropdown
"
:
return
<
ADropdownForm
element
=
{
question
}
/>;
return
<
ADropdownForm
element
=
{
question
}
/>;
// case "file":
case
"
file
"
:
// return <AFileForm element={element} currentId={currentId} />;
return
<
AFileForm
element
=
{
question
}
/>;
// case "rating":
case
"
rating
"
:
// return (
return
<
ARatingForm
element
=
{
question
}
/>;
// <ARatingForm
case
"
date
"
:
// handleQuestion={handleQuestion}
return
<
ADateForm
/>;
// element={element}
// case "matrix":
// currentId={currentId}
// return <AMatrixForm />;
// />
// );
default
:
default
:
return
<></>;
return
<></>;
}
}
...
@@ -38,9 +41,9 @@ export const AQuestion = ({ question }: PropsType) => {
...
@@ -38,9 +41,9 @@ export const AQuestion = ({ question }: PropsType) => {
return
(
return
(
<
div
className
=
"flex flex-col container w-4/5 h-auto border-2 border-themeColor items-center m-3 py-3"
>
<
div
className
=
"flex flex-col container w-4/5 h-auto border-2 border-themeColor items-center m-3 py-3"
>
<
div
className
=
"flex flexgi-row h-16 w-full place-content-between items-center"
>
<
div
className
=
"flex flexgi-row h-16 w-full place-content-between items-center"
>
<
div
className
=
"text-xl font-bold ml-6 w-1/2"
>
질문
</
div
>
<
div
className
=
"text-xl font-bold ml-6 w-1/2"
>
{
question
.
title
}
</
div
>
</
div
>
</
div
>
<
div
className
=
"
border
w-11/12 my-3"
>
내용
</
div
>
<
div
className
=
"w-11/12 my-3"
>
{
question
.
comment
}
</
div
>
{
getContent
(
question
)
}
{
getContent
(
question
)
}
</
div
>
</
div
>
);
);
...
...
frontend/src/commons/ARadioForm.tsx
View file @
34c9b310
...
@@ -7,11 +7,11 @@ type Props = {
...
@@ -7,11 +7,11 @@ type Props = {
export
const
ARadioForm
=
({
element
}:
Props
)
=>
{
export
const
ARadioForm
=
({
element
}:
Props
)
=>
{
return
(
return
(
<
div
className
=
"flex w-full gap-
4
justify-around my-3"
>
<
div
className
=
"flex w-full gap-
2
justify-around my-3"
>
{
element
.
content
.
choices
.
map
((
choice
)
=>
(
{
element
.
content
.
choices
.
map
((
choice
)
=>
(
<
div
>
<
div
>
<
input
className
=
"mr-2"
type
=
"radio"
></
input
>
<
input
className
=
"mr-2
w-4 h-4
"
type
=
"radio"
></
input
>
<
label
className
=
"text-lg"
>
{
choice
.
value
}
</
label
>
<
label
className
=
"text-lg"
>
{
choice
.
text
}
</
label
>
</
div
>
</
div
>
))
}
))
}
</
div
>
</
div
>
...
...
frontend/src/commons/ARatingForm.tsx
0 → 100644
View file @
34c9b310
import
React
from
"
react
"
;
import
{
RatingType
}
from
"
../types
"
;
type
Props
=
{
element
:
RatingType
;
};
export
const
ARatingForm
=
({
element
}:
Props
)
=>
{
return
(
<
div
className
=
"flex w-full gap-4 justify-around my-3"
>
{
element
.
content
.
choices
.
map
((
choice
)
=>
(
<
div
>
<
input
className
=
"mr-2"
></
input
>
<
label
className
=
"text-lg"
>
{
choice
.
text
}
</
label
>
</
div
>
))
}
</
div
>
);
};
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