scroll top on component mount
This commit is contained in:
parent
9adc3194ab
commit
67ea922811
|
|
@ -1,4 +1,4 @@
|
|||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { useGame } from "../../hooks/useGame";
|
||||
|
||||
import sucessIcon from "../../assets/img/icons/behaviour-type-success.svg";
|
||||
|
|
@ -7,6 +7,9 @@ import { useUser } from "../../hooks/useUser";
|
|||
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();
|
||||
|
||||
|
|
@ -19,7 +22,7 @@ export default function GameAnwerExplanation({ questionId }) {
|
|||
contextGameDatas.gameObjects[questionId].attrs.objectBehaviourDescription ??
|
||||
"Pas d'explication pour cette question";
|
||||
const objectPictureUrl = contextGameDatas.gameObjects[questionId].attrs.objectPictureUrl;
|
||||
|
||||
|
||||
return (
|
||||
<div className='modal-content-container answer-explanation-container'>
|
||||
<div className='modal-content-container__content'>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user