From 5ffcafedef5005111bcc11c3a2bf068e57e299d6 Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 28 Apr 2024 20:41:56 +0200 Subject: [PATCH 01/10] feat: modified top ten so it has number of played games into account --- .../en2b/quizapi/statistics/StatisticsRepository.java | 11 +++++++++++ .../en2b/quizapi/statistics/StatisticsService.java | 5 +---- .../statistics/dtos/StatisticsResponseDto.java | 6 ++++-- .../mappers/StatisticsResponseDtoMapper.java | 3 ++- .../quizapi/statistics/StatisticsServiceTest.java | 8 ++++---- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsRepository.java b/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsRepository.java index c3ed50ee..67a9fe29 100644 --- a/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsRepository.java +++ b/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsRepository.java @@ -4,10 +4,21 @@ import org.springframework.data.jpa.repository.Query; import java.util.Optional; +import java.util.List; public interface StatisticsRepository extends JpaRepository { @Query(value = "SELECT * FROM Statistics WHERE user_id = ?1", nativeQuery = true) Optional findByUserId(Long userId); + //Query that gets the top ten ordered by statistics -> statistics.getCorrectRate() * statistics.getTotal() / 9L + @Query(value = "SELECT *, \n" + + " CASE \n" + + " WHEN total = 0 THEN 0 \n" + + " ELSE (correct * 100.0 / NULLIF(total, 0)) * total \n" + + " END AS points \n" + + "FROM Statistics \n" + + "ORDER BY points DESC LIMIT 10 ", nativeQuery = true) + List findTopTen(); + } diff --git a/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsService.java b/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsService.java index a4839924..70fe8c16 100644 --- a/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsService.java +++ b/api/src/main/java/lab/en2b/quizapi/statistics/StatisticsService.java @@ -47,10 +47,7 @@ public StatisticsResponseDto getStatisticsForUser(Authentication authentication) } public List getTopTenStatistics(){ - List all = new ArrayList<>(statisticsRepository.findAll()); - all.sort(Comparator.comparing(Statistics::getCorrectRate).reversed()); - List topTen = all.stream().limit(10).toList(); - return topTen.stream().map(statisticsResponseDtoMapper).collect(Collectors.toList()); + return statisticsRepository.findTopTen().stream().map(statisticsResponseDtoMapper).collect(Collectors.toList()); } } diff --git a/api/src/main/java/lab/en2b/quizapi/statistics/dtos/StatisticsResponseDto.java b/api/src/main/java/lab/en2b/quizapi/statistics/dtos/StatisticsResponseDto.java index f0503def..a6a4401e 100644 --- a/api/src/main/java/lab/en2b/quizapi/statistics/dtos/StatisticsResponseDto.java +++ b/api/src/main/java/lab/en2b/quizapi/statistics/dtos/StatisticsResponseDto.java @@ -18,8 +18,10 @@ public class StatisticsResponseDto { private Long wrong; private Long total; private UserResponseDto user; - @JsonProperty("correct_rate") - private Long correctRate; + @JsonProperty("percentage") + private Long percentage; + @JsonProperty("points") + private Long points; @JsonProperty("finished_games") private Long finishedGames; diff --git a/api/src/main/java/lab/en2b/quizapi/statistics/mappers/StatisticsResponseDtoMapper.java b/api/src/main/java/lab/en2b/quizapi/statistics/mappers/StatisticsResponseDtoMapper.java index 0d6652eb..f509b7b2 100644 --- a/api/src/main/java/lab/en2b/quizapi/statistics/mappers/StatisticsResponseDtoMapper.java +++ b/api/src/main/java/lab/en2b/quizapi/statistics/mappers/StatisticsResponseDtoMapper.java @@ -21,8 +21,9 @@ public StatisticsResponseDto apply(Statistics statistics) { .right(statistics.getCorrect()) .wrong(statistics.getWrong()) .total(statistics.getTotal()) + .percentage(statistics.getCorrectRate()) .user(userResponseDtoMapper.apply(statistics.getUser())) - .correctRate(statistics.getCorrectRate()) + .points(statistics.getCorrectRate() * statistics.getTotal() ) .finishedGames(statistics.getFinishedGames()) .build(); } diff --git a/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java b/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java index cdbfdd7d..43512e6a 100644 --- a/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java +++ b/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java @@ -86,7 +86,7 @@ public void setUp(){ .right(5L) .wrong(5L) .total(10L) - .correctRate(50L) + .points(50L) .user(defaultUserResponseDto) .finishedGames(1L) .build(); @@ -105,7 +105,7 @@ public void setUp(){ .right(7L) .wrong(3L) .total(10L) - .correctRate(70L) + .points(70L) .user(defaultUserResponseDto) .finishedGames(1L) .build(); @@ -131,7 +131,7 @@ public void getStatisticsForUserTestEmpty(){ .right(0L) .wrong(0L) .total(0L) - .correctRate(0L) + .points(0L) .finishedGames(0L) .user(defaultUserResponseDto).build() , result); @@ -172,7 +172,7 @@ public void getTopTenStatisticsTestWhenThereAreNotTenAndAreEqual(){ .right(5L) .wrong(5L) .total(10L) - .correctRate(50L) + .points(50L) .user(defaultUserResponseDto) .finishedGames(1L) .build(); From 16ca59e609ce5c4f69eb5a05b4df45b6d847079d Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 28 Apr 2024 20:46:59 +0200 Subject: [PATCH 02/10] test: top 10 v2 --- .../quizapi/statistics/StatisticsServiceTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java b/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java index 43512e6a..7b5fd7d1 100644 --- a/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java +++ b/api/src/test/java/lab/en2b/quizapi/statistics/StatisticsServiceTest.java @@ -86,7 +86,8 @@ public void setUp(){ .right(5L) .wrong(5L) .total(10L) - .points(50L) + .percentage(50L) + .points(500L) .user(defaultUserResponseDto) .finishedGames(1L) .build(); @@ -105,7 +106,8 @@ public void setUp(){ .right(7L) .wrong(3L) .total(10L) - .points(70L) + .points(700L) + .percentage(70L) .user(defaultUserResponseDto) .finishedGames(1L) .build(); @@ -132,6 +134,7 @@ public void getStatisticsForUserTestEmpty(){ .wrong(0L) .total(0L) .points(0L) + .percentage(0L) .finishedGames(0L) .user(defaultUserResponseDto).build() , result); @@ -152,7 +155,7 @@ public void getCorrectRateTotalZero(){ @Test public void getTopTenStatisticsTestWhenThereAreNotTen(){ - when(statisticsRepository.findAll()).thenReturn(List.of(defaultStatistics2, defaultStatistics1)); + when(statisticsRepository.findTopTen()).thenReturn(List.of(defaultStatistics2, defaultStatistics1)); List result = statisticsService.getTopTenStatistics(); Assertions.assertEquals(List.of(defaultStatisticsResponseDto2,defaultStatisticsResponseDto1), result); } @@ -172,11 +175,12 @@ public void getTopTenStatisticsTestWhenThereAreNotTenAndAreEqual(){ .right(5L) .wrong(5L) .total(10L) - .points(50L) + .points(500L) + .percentage(50L) .user(defaultUserResponseDto) .finishedGames(1L) .build(); - when(statisticsRepository.findAll()).thenReturn(List.of(defaultStatistics1, defaultStatistics3)); + when(statisticsRepository.findTopTen()).thenReturn(List.of(defaultStatistics1, defaultStatistics3)); List result = statisticsService.getTopTenStatistics(); Assertions.assertEquals(List.of(defaultStatisticsResponseDto1,defaultStatisticsResponseDto3), result); } From e60e6e004473335481cd657ba41e332e59d9d022 Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 28 Apr 2024 20:49:32 +0200 Subject: [PATCH 03/10] feat: size for username and password --- api/src/main/java/lab/en2b/quizapi/auth/dtos/RegisterDto.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/src/main/java/lab/en2b/quizapi/auth/dtos/RegisterDto.java b/api/src/main/java/lab/en2b/quizapi/auth/dtos/RegisterDto.java index 05abfd5f..43947764 100644 --- a/api/src/main/java/lab/en2b/quizapi/auth/dtos/RegisterDto.java +++ b/api/src/main/java/lab/en2b/quizapi/auth/dtos/RegisterDto.java @@ -3,6 +3,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -19,10 +20,12 @@ public class RegisterDto { private String email; @NonNull @NotBlank + @Size(min = 3, max = 20, message = "Username must be between 3 and 20 characters") @Schema(description = "Username used for registering", example = "example user" ) private String username; @NonNull @NotBlank + @Size(min = 6, max = 20, message = "Password must be between 6 and 20 characters") @Schema(description = "Password used for registering", example = "password" ) private String password; } From cb68c401bbb739a635a395eda74d4510702bf6d2 Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 28 Apr 2024 21:36:51 +0200 Subject: [PATCH 04/10] feat: new user statistics --- webapp/public/locales/en/translation.json | 1 + webapp/public/locales/es/translation.json | 5 +- .../components/statistics/UserStatistics.jsx | 2 +- webapp/src/pages/Statistics.jsx | 66 ++++++++++++------- 4 files changed, 48 insertions(+), 26 deletions(-) diff --git a/webapp/public/locales/en/translation.json b/webapp/public/locales/en/translation.json index 9196de2f..3bd09ec6 100644 --- a/webapp/public/locales/en/translation.json +++ b/webapp/public/locales/en/translation.json @@ -72,6 +72,7 @@ "wrongAnswers": "Wrong", "totalAnswers": "Total", "percentage": "Rate", + "points": "Points", "empty": "Currently, there are no statistics saved", "texts": { "personalRight": "{{right, number}} correct answers", diff --git a/webapp/public/locales/es/translation.json b/webapp/public/locales/es/translation.json index c0fa406e..0b17fb8b 100644 --- a/webapp/public/locales/es/translation.json +++ b/webapp/public/locales/es/translation.json @@ -67,10 +67,11 @@ "statistics": { "position": "Posición", "username": "Nombre", - "rightAnswers": "Respuestas correctas", - "wrongAnswers": "Respuestas falladas", + "rightAnswers": "Correctas", + "wrongAnswers": "Falladas", "totalAnswers": "En total", "percentage": "Acierto", + "points": "Puntos", "empty": "Actualmente, no hay estadísticas guardadas", "texts": { "personalRight": "{{right, number}} respuestas correctas", diff --git a/webapp/src/components/statistics/UserStatistics.jsx b/webapp/src/components/statistics/UserStatistics.jsx index a87457b4..300d6ca0 100644 --- a/webapp/src/components/statistics/UserStatistics.jsx +++ b/webapp/src/components/statistics/UserStatistics.jsx @@ -27,7 +27,7 @@ export default function UserStatistics() { value: request.data.wrong, }, ], - rate: request.data.correct_rate + rate: request.data.percentage }); setRetrievedData(true); } else { diff --git a/webapp/src/pages/Statistics.jsx b/webapp/src/pages/Statistics.jsx index 92ace61f..8bd88c0b 100644 --- a/webapp/src/pages/Statistics.jsx +++ b/webapp/src/pages/Statistics.jsx @@ -1,5 +1,7 @@ -import { Box, Center, Heading, Stack, Table, Tbody, Text, - Td, Th, Thead, Tr, CircularProgress} from "@chakra-ui/react"; +import { + Box, Center, Heading, Stack, Table, Tbody, Text, + Td, Th, Thead, Tr, CircularProgress, AccordionItem, Accordion, AccordionButton, AccordionIcon, AccordionPanel, Flex +} from "@chakra-ui/react"; import React, {useEffect, useState} from "react"; import { useTranslation } from "react-i18next"; import GoBack from "components/GoBack"; @@ -46,14 +48,41 @@ export default function Statistics() { const formatTopTen = () => { return topTen.map((element, counter) => { - return - {counter + 1} - {element.user.username} - {element.right} - {element.wrong} - {element.total} - {element.correct_rate}% - + return + + + + {counter + 1} + {element.user.username} + {element.points} + + + + + + + + + + + + + + + + + + + + + + +
{t("statistics.rightAnswers")}{t("statistics.wrongAnswers")}{t("statistics.totalAnswers")}{t("statistics.percentage")}
{element.right}{element.wrong}{element.total}{element.percentage}%
+
+
+ + + }); } useEffect(() => { @@ -89,26 +118,17 @@ export default function Statistics() { { topTen.length === 0 ? {t("statistics.empty")} : - - - - - - - - - - - +
{t("statistics.position")}{t("statistics.username")}{t("statistics.rightAnswers")}{t("statistics.wrongAnswers")}{t("statistics.totalAnswers")}{t("statistics.percentage")}
- {formatTopTen()} + + {formatTopTen()} +
} : } - From f7b5f89ee17758774cc8360ebd3d5b5f18da210c Mon Sep 17 00:00:00 2001 From: jjgancfer Date: Sun, 28 Apr 2024 21:52:11 +0200 Subject: [PATCH 05/10] feat: replaced table for a list --- .../components/statistics/UserStatistics.jsx | 218 +++++++++--------- webapp/src/pages/Statistics.jsx | 61 +++-- 2 files changed, 146 insertions(+), 133 deletions(-) diff --git a/webapp/src/components/statistics/UserStatistics.jsx b/webapp/src/components/statistics/UserStatistics.jsx index 300d6ca0..b4922379 100644 --- a/webapp/src/components/statistics/UserStatistics.jsx +++ b/webapp/src/components/statistics/UserStatistics.jsx @@ -1,109 +1,109 @@ -import { Box, Flex, Heading, Stack, Text, CircularProgress } from "@chakra-ui/react"; -import { HttpStatusCode } from "axios"; -import ErrorMessageAlert from "components/ErrorMessageAlert"; -import AuthManager from "components/auth/AuthManager"; -import React, { useCallback, useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { Cell, Pie, PieChart } from "recharts"; - -export default function UserStatistics() { - const { t } = useTranslation(); - const [userData, setUserData] = useState(null); - const [retrievedData, setRetrievedData] = useState(false); - const [errorMessage, setErrorMessage] = useState(null); - - const getData = useCallback(async () => { - try { - const request = await new AuthManager().getAxiosInstance().get(process.env.REACT_APP_API_ENDPOINT + "/statistics/personal"); - if (request.status === HttpStatusCode.Ok) { - setUserData({ - raw: [ - { - name: t("statistics.texts.personalRight"), - value: request.data.right, - }, - { - name: t("statistics.texts.personalWrong"), - value: request.data.wrong, - }, - ], - rate: request.data.percentage - }); - setRetrievedData(true); - } else { - throw request; - } - } catch (error) { - let errorType; - switch (error.response ? error.response.status : null) { - case 400: - errorType = { type: t("error.validation.type"), message: t("error.validation.message") }; - break; - case 404: - errorType = { type: t("error.notFound.type"), message: t("error.notFound.message") }; - break; - default: - errorType = { type: t("error.unknown.type"), message: t("error.unknown.message") }; - break; - } - setErrorMessage(errorType); - } - }, [t, setErrorMessage, setRetrievedData, setUserData]); - - useEffect(() => { - if (!retrievedData) { - getData(); - } - }, [retrievedData, getData]); - - return ( - - {retrievedData ? ( - - - - {t("common.statistics.personal")} - - - - - - {t("statistics.rightAnswers")} - - - {t("statistics.texts.personalRight", { right: userData.raw[0].value })} - - - - - {t("statistics.wrongAnswers")} - - - {t("statistics.texts.personalWrong", { wrong: userData.raw[1].value })} - - - - - {t("statistics.percentage")} - - - {t("statistics.texts.personalRate", { rate: userData.rate })} - - - - - - - - - - - - - - ) : ( - - )} - - ); -} +import { Box, Flex, Heading, Stack, Text, CircularProgress } from "@chakra-ui/react"; +import { HttpStatusCode } from "axios"; +import ErrorMessageAlert from "components/ErrorMessageAlert"; +import AuthManager from "components/auth/AuthManager"; +import React, { useCallback, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Cell, Pie, PieChart } from "recharts"; + +export default function UserStatistics() { + const { t } = useTranslation(); + const [userData, setUserData] = useState(null); + const [retrievedData, setRetrievedData] = useState(false); + const [errorMessage, setErrorMessage] = useState(null); + + const getData = useCallback(async () => { + try { + const request = await new AuthManager().getAxiosInstance().get(process.env.REACT_APP_API_ENDPOINT + "/statistics/personal"); + if (request.status === HttpStatusCode.Ok) { + setUserData({ + raw: [ + { + name: t("statistics.texts.personalRight"), + value: request.data.right, + }, + { + name: t("statistics.texts.personalWrong"), + value: request.data.wrong, + }, + ], + rate: request.data.percentage + }); + setRetrievedData(true); + } else { + throw request; + } + } catch (error) { + let errorType; + switch (error.response ? error.response.status : null) { + case 400: + errorType = { type: t("error.validation.type"), message: t("error.validation.message") }; + break; + case 404: + errorType = { type: t("error.notFound.type"), message: t("error.notFound.message") }; + break; + default: + errorType = { type: t("error.unknown.type"), message: t("error.unknown.message") }; + break; + } + setErrorMessage(errorType); + } + }, [t, setErrorMessage, setRetrievedData, setUserData]); + + useEffect(() => { + if (!retrievedData) { + getData(); + } + }, [retrievedData, getData]); + + return ( + + {retrievedData ? ( + + + + {t("common.statistics.personal")} + + + + + + {t("statistics.rightAnswers")} + + + {t("statistics.texts.personalRight", { right: userData.raw[0].value })} + + + + + {t("statistics.wrongAnswers")} + + + {t("statistics.texts.personalWrong", { wrong: userData.raw[1].value })} + + + + + {t("statistics.percentage")} + + + {t("statistics.texts.personalRate", { rate: userData.rate })} + + + + + + + + + + + + + + ) : ( + + )} + + ); +} diff --git a/webapp/src/pages/Statistics.jsx b/webapp/src/pages/Statistics.jsx index 8bd88c0b..384ab804 100644 --- a/webapp/src/pages/Statistics.jsx +++ b/webapp/src/pages/Statistics.jsx @@ -1,6 +1,23 @@ import { - Box, Center, Heading, Stack, Table, Tbody, Text, - Td, Th, Thead, Tr, CircularProgress, AccordionItem, Accordion, AccordionButton, AccordionIcon, AccordionPanel, Flex + Box, + Center, + Heading, + Stack, + Table, + Tbody, + Text, + Td, + Th, + Thead, + Tr, + CircularProgress, + AccordionItem, + Accordion, + AccordionButton, + AccordionIcon, + AccordionPanel, + Flex, + List, ListItem, ListIcon, UnorderedList } from "@chakra-ui/react"; import React, {useEffect, useState} from "react"; import { useTranslation } from "react-i18next"; @@ -8,10 +25,10 @@ import GoBack from "components/GoBack"; import AuthManager from "components/auth/AuthManager"; import { HttpStatusCode } from "axios"; import ErrorMessageAlert from "components/ErrorMessageAlert"; -import UserStatistics from "components/statistics/UserStatistics"; import { FaChartBar } from 'react-icons/fa'; import MenuButton from '../components/menu/MenuButton'; import LateralMenu from '../components/menu/LateralMenu'; +import {MdCheckCircle, MdClear, MdPercent} from "react-icons/md"; export default function Statistics() { const { t, i18n } = useTranslation(); @@ -48,10 +65,10 @@ export default function Statistics() { const formatTopTen = () => { return topTen.map((element, counter) => { - return + return - + {counter + 1} {element.user.username} {element.points} @@ -60,24 +77,20 @@ export default function Statistics() { - - - - - - - - - - - - - - - - - -
{t("statistics.rightAnswers")}{t("statistics.wrongAnswers")}{t("statistics.totalAnswers")}{t("statistics.percentage")}
{element.right}{element.wrong}{element.total}{element.percentage}%
+ + + + {t("statistics.texts.personalRight", {right: element.right})} + + + + {t("statistics.texts.personalWrong", {wrong: element.wrong})} + + + + {t("statistics.texts.personalRate", {rate: element.percentage})} + +
@@ -104,7 +117,7 @@ export default function Statistics() { setIsMenuOpen(true)}/> setIsMenuOpen(false)} changeLanguage={changeLanguage} isDashboard={false}/> - + From 8386efe257f98e2f154472fa56ffe3ed32c0dfb2 Mon Sep 17 00:00:00 2001 From: jjgancfer Date: Sun, 28 Apr 2024 21:54:51 +0200 Subject: [PATCH 06/10] chore: add a minimum width for the panel --- webapp/src/pages/Statistics.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/src/pages/Statistics.jsx b/webapp/src/pages/Statistics.jsx index 384ab804..28ac456d 100644 --- a/webapp/src/pages/Statistics.jsx +++ b/webapp/src/pages/Statistics.jsx @@ -122,7 +122,8 @@ export default function Statistics() { t={t} errorWhere={"error.statistics.top"}/> {t("common.statistics.title")} - + {retrievedData ? From 7182771d7a9b22f4ce1357d434d05641116ff27b Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 28 Apr 2024 21:58:24 +0200 Subject: [PATCH 07/10] test: removed user statistics --- webapp/src/tests/Statistics.test.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/webapp/src/tests/Statistics.test.js b/webapp/src/tests/Statistics.test.js index 5f0e5134..2c3c6d76 100644 --- a/webapp/src/tests/Statistics.test.js +++ b/webapp/src/tests/Statistics.test.js @@ -34,11 +34,6 @@ describe("Statistics", () => { expect(screen.getByTestId("leaderboard-spinner")).toBeEnabled(); }); - test("the user statistics component is rendered", () => { - render(); - expect(screen.getByTestId("user-statistics")).toBeEnabled(); - }) - describe("a petition is made requesting the top ten", () => { const authManager = new AuthManager(); let mockAxios; From ba15f013038498a4617a81d837d215fbbd476438 Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 28 Apr 2024 21:58:31 +0200 Subject: [PATCH 08/10] feat: KIWIIIIIIIIIII --- webapp/src/pages/Statistics.jsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/webapp/src/pages/Statistics.jsx b/webapp/src/pages/Statistics.jsx index 28ac456d..2d28691a 100644 --- a/webapp/src/pages/Statistics.jsx +++ b/webapp/src/pages/Statistics.jsx @@ -6,18 +6,13 @@ import { Table, Tbody, Text, - Td, - Th, - Thead, - Tr, CircularProgress, AccordionItem, Accordion, AccordionButton, AccordionIcon, AccordionPanel, - Flex, - List, ListItem, ListIcon, UnorderedList + Flex, ListItem, ListIcon, UnorderedList } from "@chakra-ui/react"; import React, {useEffect, useState} from "react"; import { useTranslation } from "react-i18next"; @@ -71,7 +66,7 @@ export default function Statistics() { {counter + 1} {element.user.username} - {element.points} + {element.points} 🥝 From a25056ed5164543988317e76fce35df12715cf91 Mon Sep 17 00:00:00 2001 From: jjgancfer Date: Sun, 28 Apr 2024 22:06:57 +0200 Subject: [PATCH 09/10] chore: change width prop --- webapp/src/pages/Statistics.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/pages/Statistics.jsx b/webapp/src/pages/Statistics.jsx index 28ac456d..b44e6f2b 100644 --- a/webapp/src/pages/Statistics.jsx +++ b/webapp/src/pages/Statistics.jsx @@ -122,7 +122,7 @@ export default function Statistics() { t={t} errorWhere={"error.statistics.top"}/> {t("common.statistics.title")} - {retrievedData ? From 7132d4181fa0504277990a4355b7348844df2ec8 Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 28 Apr 2024 22:12:27 +0200 Subject: [PATCH 10/10] feat: max width --- webapp/src/pages/Statistics.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/src/pages/Statistics.jsx b/webapp/src/pages/Statistics.jsx index 6db522fe..74bacf1d 100644 --- a/webapp/src/pages/Statistics.jsx +++ b/webapp/src/pages/Statistics.jsx @@ -66,7 +66,7 @@ export default function Statistics() { {counter + 1} {element.user.username} - {element.points} 🥝 + {element.points} {element.user.username !== 'Dario G. Mori'? '🥝': '🍌' } @@ -108,16 +108,16 @@ export default function Statistics() { return (
+ justifyContent={"center"} alignItems={"center"} bgImage={'/background.svg'} > setIsMenuOpen(true)}/> setIsMenuOpen(false)} changeLanguage={changeLanguage} isDashboard={false}/> - + + t={t} errorWhere={"error.statistics.top"} /> {t("common.statistics.title")} - {retrievedData ?