handling object class depending on answeerr type
This commit is contained in:
parent
eed0314be7
commit
e5eca230fe
|
|
@ -11,10 +11,18 @@ export default function GameObjects({ blocks }) {
|
|||
<>
|
||||
{blocks.map((block, id) => {
|
||||
const hasAnswered = answers && answers[id]?.userAnswer;
|
||||
|
||||
return (
|
||||
<img
|
||||
className={`lhoist-blocks-focus-object ${
|
||||
hasAnswered ? "lhoist-blocks-focus-object--inactive" : ""
|
||||
} ${
|
||||
hasAnswered && answers[id]?.userAnsweredCorrectly === true
|
||||
? "lhoist-blocks-focus-object--answered-correctly"
|
||||
: hasAnswered &&
|
||||
answers[id]?.userAnsweredCorrectly === false
|
||||
? "lhoist-blocks-focus-object--answered-incorrectly"
|
||||
: "lhoist-blocks-focus-object--unanswered"
|
||||
}`}
|
||||
style={{
|
||||
height: `${block.attrs.objectScale}%`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user