Fix lint
This commit is contained in:
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import styled from "styled-components";
|
||||
import shortid from "shortid";
|
||||
import { DragDropContext, Droppable } from "react-beautiful-dnd";
|
||||
import { Question } from "."
|
||||
import { Question } from ".";
|
||||
import colors from "@theme/colors";
|
||||
import QuestionList from "./QuestionList";
|
||||
|
||||
@@ -46,7 +46,7 @@ const SignupQuestionsWidget: React.FC<SignupQuestionsWidgetProps> = ({ value, on
|
||||
const onValueChange = (questions: Question[]) => {
|
||||
const newValue = JSON.stringify(questions);
|
||||
onChange(newValue);
|
||||
}
|
||||
};
|
||||
|
||||
const handleNewRowClick = (questions) => () => {
|
||||
const newRow: Question = {
|
||||
@@ -58,7 +58,7 @@ const SignupQuestionsWidget: React.FC<SignupQuestionsWidgetProps> = ({ value, on
|
||||
const newQuestions: Question[] = questions.concat([newRow]);
|
||||
|
||||
onValueChange(newQuestions);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDragEnd = (questions: Question[]) => (result) => {
|
||||
const srcIndex = result.source.index;
|
||||
@@ -68,7 +68,7 @@ const SignupQuestionsWidget: React.FC<SignupQuestionsWidgetProps> = ({ value, on
|
||||
questions.splice(dstIndex, 0, srcCopy);
|
||||
|
||||
onValueChange(questions);
|
||||
}
|
||||
};
|
||||
const questions = JSON.parse(value) as Question[];
|
||||
|
||||
return (
|
||||
@@ -84,7 +84,8 @@ const SignupQuestionsWidget: React.FC<SignupQuestionsWidgetProps> = ({ value, on
|
||||
innerRef={provided.innerRef}
|
||||
questions={questions}
|
||||
onChange={onValueChange}
|
||||
placeholder={provided.placeholder} />
|
||||
placeholder={provided.placeholder}
|
||||
/>
|
||||
)}
|
||||
</Droppable>
|
||||
</DragDropContext>
|
||||
@@ -94,6 +95,6 @@ const SignupQuestionsWidget: React.FC<SignupQuestionsWidgetProps> = ({ value, on
|
||||
</AddQuestionButton>
|
||||
</Widget>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default SignupQuestionsWidget;
|
||||
|
||||
Reference in New Issue
Block a user