diff --git a/webapp/src/components/GoBack.jsx b/webapp/src/components/GoBack.jsx index bd90ef0f..856368a5 100644 --- a/webapp/src/components/GoBack.jsx +++ b/webapp/src/components/GoBack.jsx @@ -6,8 +6,8 @@ import { useNavigate } from "react-router"; export default function GoBack() { const {t} = useTranslation(); const navigate = useNavigate(); - return - diff --git a/webapp/src/pages/Results.jsx b/webapp/src/pages/Results.jsx index 6ab60e96..3d8b1267 100644 --- a/webapp/src/pages/Results.jsx +++ b/webapp/src/pages/Results.jsx @@ -1,17 +1,27 @@ -import React from "react"; +import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Button, Flex, Box, Heading, Center } from "@chakra-ui/react"; import { useNavigate, useLocation } from "react-router-dom"; import UserStatistics from "../components/statistics/UserStatistics"; +import LateralMenu from '../components/menu/LateralMenu'; +import MenuButton from '../components/menu/MenuButton'; export default function Results() { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const location = useLocation(); const navigate = useNavigate(); const correctAnswers = location.state?.correctAnswers || 0; + const [isMenuOpen, setIsMenuOpen] = useState(false); + + const changeLanguage = async (selectedLanguage) => { + await i18n.changeLanguage(selectedLanguage); + }; return (
+ setIsMenuOpen(true)} /> + setIsMenuOpen(false)} changeLanguage={changeLanguage} isDashboard={false}/> + {t("common.results")} {`Correct answers: ${correctAnswers}`} diff --git a/webapp/src/pages/Statistics.jsx b/webapp/src/pages/Statistics.jsx index 7d20002e..92ace61f 100644 --- a/webapp/src/pages/Statistics.jsx +++ b/webapp/src/pages/Statistics.jsx @@ -1,4 +1,4 @@ -import { Box, Center, Heading, Stack, StackDivider, Table, Tbody, Text, +import { Box, Center, Heading, Stack, Table, Tbody, Text, Td, Th, Thead, Tr, CircularProgress} from "@chakra-ui/react"; import React, {useEffect, useState} from "react"; import { useTranslation } from "react-i18next"; @@ -80,9 +80,7 @@ export default function Statistics() { t={t} errorWhere={"error.statistics.top"}/> {t("common.statistics.title")} - } minH="50vh" - p="1rem" backgroundColor="whiteAlpha.900" shadow="1.25em" - boxShadow="md" rounded="1rem" alignItems={"center"} data-testid={"leaderboard-component"}> + {retrievedData ? @@ -111,8 +109,8 @@ export default function Statistics() { : } + -
);