From 6fa4bf8bdd5ce6d47a2766e3b1bd1d851a946030 Mon Sep 17 00:00:00 2001 From: Alex Stan Date: Sun, 2 Jun 2024 09:46:38 +0300 Subject: [PATCH] Added animations --- app/components/question_component.tsx | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/app/components/question_component.tsx b/app/components/question_component.tsx index f0fae3e..82454fb 100644 --- a/app/components/question_component.tsx +++ b/app/components/question_component.tsx @@ -2,6 +2,7 @@ import { ReactComponentElement, ReactNode } from "react"; import { AnswerType, Question } from "../lib/question"; import { SessionState } from "../lib/session"; import { CheckCircleIcon, XCircleIcon } from "@heroicons/react/24/outline"; +import { Button, Transition } from "@headlessui/react"; const QuestionView = ({ question, setState, state }: { question: Question, setState: any, state: SessionState }) => { @@ -35,7 +36,14 @@ const QuestionView = ({ question, setState, state }: { question: Question, setSt

{question && question.text}

- {question && state.opened[ question.id ] ? ( +

{question.answer}

@@ -56,7 +64,7 @@ const QuestionView = ({ question, setState, state }: { question: Question, setSt
-
) : ()} + +
)