website: Switch to likert style labelling

This commit is contained in:
Adrian Cowan
2023-01-23 21:51:17 +11:00
parent 274d03c5f0
commit 007773a3f5
19 changed files with 481 additions and 519 deletions
+4 -2
View File
@@ -12,6 +12,7 @@ export const CreateTask = ({
isEditable,
isDisabled,
onReplyChanged,
onValidityChanged,
}: TaskSurveyProps<{ text: string }>) => {
const cardColor = useColorModeValue("gray.50", "gray.800");
const titleColor = useColorModeValue("gray.800", "gray.300");
@@ -20,11 +21,12 @@ export const CreateTask = ({
const textChangeHandler = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
const text = event.target.value;
const isTextBlank = !text || /^\s*$/.test(text) ? true : false;
onReplyChanged({ text });
if (!isTextBlank) {
onReplyChanged({ content: { text }, state: "VALID" });
onValidityChanged("VALID");
setInputText(text);
} else {
onReplyChanged({ content: { text }, state: "INVALID" });
onValidityChanged("INVALID");
setInputText("");
}
};