From 77297f7ff97be158387503192354043bcae324c0 Mon Sep 17 00:00:00 2001 From: Aaron McAdam Date: Mon, 5 Aug 2024 22:45:02 +0100 Subject: [PATCH] responsive styles for the quiz --- src/components/quiz.tsx | 76 +++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/src/components/quiz.tsx b/src/components/quiz.tsx index 00a531b..635a7e8 100644 --- a/src/components/quiz.tsx +++ b/src/components/quiz.tsx @@ -123,44 +123,46 @@ export function Quiz() { const gridColCount = currentQuestion?.options.length % 3 === 0 ? 3 : 2; return ( -
- {quizState.result ? ( - - ) : currentQuestion ? ( -
- { - setQuizState((prevState) => ({ - ...prevState, - currentIndex: questionIndex, - })); - }} - /> -

- {currentQuestion.title} -

-
- {currentQuestion.options.map((o, i) => { - const isOptionSelected = currentQuestion.response === o; - - return ( - handleOptionClick(o)} - isSelected={isOptionSelected} - display={o.display} - value={o.value} - /> - ); - })} +
+
+ {quizState.result ? ( + + ) : currentQuestion ? ( +
+ { + setQuizState((prevState) => ({ + ...prevState, + currentIndex: questionIndex, + })); + }} + /> +

+ {currentQuestion.title} +

+
+ {currentQuestion.options.map((o, i) => { + const isOptionSelected = currentQuestion.response === o; + + return ( + handleOptionClick(o)} + isSelected={isOptionSelected} + display={o.display} + value={o.value} + /> + ); + })} +
-
- ) : null} + ) : null} +
); }