- {question.map(({ questionId, title, type, essential }, questionIndex) => (
-
- {(draggable) => {
- let transform = draggable.draggableProps.style?.transform;
-
- if (transform) {
- transform = transform.replace(/([0-9]+px)/, "0px");
- draggable.draggableProps.style = {
- ...draggable.draggableProps.style,
- transform,
- };
- }
-
- return (
- onClickQuestion(questionIndex)}
- onMouseOver={() => onMouseOverQuestion(questionIndex)}
- onMouseOut={() => onMouseOutQuestion()}
- {...draggable.draggableProps}
- ref={draggable.innerRef}
- >
-
- {showDragIndicator(questionIndex) ? : null}
-
- {focus === `q${questionIndex}` && (
- <>
-
- onInputQuestionTitle(e.currentTarget.value, questionIndex)}
- value={question[questionIndex].title}
- placeholder="질문"
- />
- {
- const isQuestionType = (str: string): str is QuestionType =>
- str === "checkbox" || str === "multiple" || str === "paragraph";
-
- if (isQuestionType(questionType))
- onClickSetQuestionType(questionType, questionIndex);
- }}
- items={QUESTION_TYPE_LIST}
- defaultValue="선택해주세요"
- />
-
-
-
-
-
-
- onClickAddQuestion(questionIndex)}
- icon="add"
- size="21px"
- custom="margin-right: 12px;"
- />
- onClickCopyQuestion(questionIndex)}
- icon="copy"
- size="18px"
- custom="margin-right: 12px;"
- />
- onClickDeleteQuestion(questionIndex)}
- icon="trashcan"
- size="18px"
- custom="margin-right: 12px;"
- />
-
- 필수
- onClickChangeQuestionEssential(questionIndex)}
+ {checkApiSuccess() &&
+ question.map(({ questionId, title, type, essential }, questionIndex) => (
+
+ {(draggable) => {
+ let transform = draggable.draggableProps.style?.transform;
+
+ if (transform) {
+ transform = transform.replace(/([0-9]+px)/, "0px");
+ draggable.draggableProps.style = {
+ ...draggable.draggableProps.style,
+ transform,
+ };
+ }
+
+ return (
+ onClickQuestion(questionIndex)}
+ onMouseOver={() => onMouseOverQuestion(questionIndex)}
+ onMouseOut={() => onMouseOutQuestion()}
+ {...draggable.draggableProps}
+ ref={draggable.innerRef}
+ >
+
+ {showDragIndicator(questionIndex) ? : null}
+
+ {focus === `q${questionIndex}` && (
+ <>
+
+ onInputQuestionTitle(e.currentTarget.value, questionIndex)}
+ value={question[questionIndex].title}
+ placeholder="질문"
/>
-
-
- >
- )}
- {focus !== `q${questionIndex}` && (
- <>
- {title}
-
- >
- )}
-
- );
- }}
-
- ))}
+
{
+ const isQuestionType = (str: string): str is QuestionType =>
+ str === "checkbox" || str === "multiple" || str === "paragraph";
+
+ if (isQuestionType(questionType))
+ onClickSetQuestionType(questionType, questionIndex);
+ }}
+ items={QUESTION_TYPE_LIST}
+ defaultValue="선택해주세요"
+ />
+
+
+
+
+
+
+ onClickAddQuestion(questionIndex)}
+ icon="add"
+ size="21px"
+ custom="margin-right: 12px;"
+ />
+ onClickCopyQuestion(questionIndex)}
+ icon="copy"
+ size="18px"
+ custom="margin-right: 12px;"
+ />
+ onClickDeleteQuestion(questionIndex)}
+ icon="trashcan"
+ size="18px"
+ custom="margin-right: 12px;"
+ />
+
+ 필수
+ onClickChangeQuestionEssential(questionIndex)}
+ />
+
+
+ >
+ )}
+ {focus !== `q${questionIndex}` && (
+ <>
+ {title}
+
+ >
+ )}
+
+ );
+ }}
+
+ ))}
{droppable.placeholder}
)}