displaying behaviour sing on top of cover
This commit is contained in:
parent
dc29df4b54
commit
f2757ad875
|
|
@ -9,7 +9,7 @@ import Loading from "../animations/Loading";
|
|||
export default function GameAnwerExplanation({ questionId }) {
|
||||
useEffect(() => {
|
||||
document.querySelector("dialog").scrollTo(0, 0);
|
||||
},[]);
|
||||
}, []);
|
||||
const { answers, contextGameDatas, setCurrentGameModal, checkIfGameIsComplete } = useGame();
|
||||
const { screensTranslations } = useUser();
|
||||
|
||||
|
|
@ -21,10 +21,11 @@ export default function GameAnwerExplanation({ questionId }) {
|
|||
const answerExplanation =
|
||||
contextGameDatas.gameObjects[questionId].attrs.objectBehaviourDescription ??
|
||||
"Pas d'explication pour cette question";
|
||||
const answerBehaviour = answer.correctAnswer ?? "";
|
||||
const objectPictureUrl = contextGameDatas.gameObjects[questionId].attrs.objectPictureUrl;
|
||||
|
||||
return (
|
||||
<div className='modal-content-container modal-content-container--grided answer-explanation-container'>
|
||||
<div className='modal-content-container modal-content-container--grided answer-explanation-container answer-explanation-container'>
|
||||
<div className='modal-content-container__content'>
|
||||
{answer.userAnsweredCorrectly === true && (
|
||||
<>
|
||||
|
|
@ -70,7 +71,8 @@ export default function GameAnwerExplanation({ questionId }) {
|
|||
className='continue-game cta cta--construction cta--round cta--button-icon cta--next'
|
||||
/>
|
||||
</div>
|
||||
<div className='modal-content-container__cover'>
|
||||
<div
|
||||
className={`modal-content-container__cover modal-content-container__cover--${answerBehaviour}`}>
|
||||
<img src={objectPictureUrl} alt='' />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user