From 7843bf28605283892f6fb595ba2e93c48cf7fa3e Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 13 Feb 2024 19:23:44 +0100 Subject: [PATCH] Introducing Game questions component --- src/assets/css/components/GameQuestion.scss | 27 +++++++++++++++++++++ src/components/game/GamesQuestions.jsx | 13 ++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/assets/css/components/GameQuestion.scss create mode 100644 src/components/game/GamesQuestions.jsx diff --git a/src/assets/css/components/GameQuestion.scss b/src/assets/css/components/GameQuestion.scss new file mode 100644 index 0000000..bb151fb --- /dev/null +++ b/src/assets/css/components/GameQuestion.scss @@ -0,0 +1,27 @@ +.game-question { + @apply p-8 flex gap-x-8; + &__cover { + @apply w-1/2 h-auto object-contain object-center; + } + + h2 { + @apply text-5xl py-8; + } + .question { + @apply text-xl max-w-xl; + } + &__answer-buttons-container { + @apply flex items-center gap-4 flex-wrap mt-12; + } + &__answer-button { + @apply bg-neutral-100 border-none + rounded-full flex flex-col justify-center items-center shrink-0 + w-fit h-auto + p-6; + + img { + @apply h-16 w-16 block object-contain object-center; + } + aspect-ratio: 1/1; + } +} diff --git a/src/components/game/GamesQuestions.jsx b/src/components/game/GamesQuestions.jsx new file mode 100644 index 0000000..9ec09c9 --- /dev/null +++ b/src/components/game/GamesQuestions.jsx @@ -0,0 +1,13 @@ +import React from "react"; + +export default function GameQuestions({ blocks }) { + if (!blocks) return null; + + return ( + <> + {blocks.map((block, id) => ( +
{block.attrs.objectBehaviourDescription}
+ ))} + + ); +}