diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index 8ae9176..a3fc084 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import { Box, useTheme } from "@mui/material"; +import {Box, useMediaQuery, useTheme} from "@mui/material"; import { useQuestionsStore } from "@root/quizData/store" import { getQuestionById } from "@root/quizData/actions"; @@ -46,6 +46,7 @@ const QUESTIONS_MAP: any = { export const Question = ({ questions }: QuestionProps) => { const { settings } = useQuestionsStore() + const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(650)); const [currentQuestion, setCurrentQuestion] = useState(); const [showContactForm, setShowContactForm] = useState(false); const [showResultForm, setShowResultForm] = useState(false); @@ -71,14 +72,14 @@ export const Question = ({ questions }: QuestionProps) => { const QuestionComponent = QUESTIONS_MAP[currentQuestion.type as Exclude]; - const theme = useTheme(); + return ( {!showContactForm && !showResultForm && (