Skip to content

Commit

Permalink
Detalles de integrante de grupo arreglado
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 committed Apr 26, 2024
1 parent dfd2533 commit 3329e6f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
7 changes: 5 additions & 2 deletions webapp/src/components/CustomModal/CustomModal.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React from 'react';
import { Button, Modal, ModalOverlay, ModalContent, ModalHeader, ModalCloseButton, ModalBody, ModalFooter, useDisclosure } from '@chakra-ui/react';
import { useNavigate } from 'react-router-dom';
import { useTranslation } from "react-i18next";

const CustomModal = ({ title, text, route }) => {
const { isOpen, onOpen, onClose } = useDisclosure();
const navigate = useNavigate();

const { t } = useTranslation();

return (
<>
<Button onClick={onOpen}>{title}</Button>
Expand All @@ -21,9 +24,9 @@ const CustomModal = ({ title, text, route }) => {

<ModalFooter>
<Button variant='ghost' mr={3} onClick={onClose}>
Cerrar
{t("components.custommodal.close")}
</Button>
<Button colorScheme='blue' onClick={() => navigate(route)}>Jugar</Button>
<Button colorScheme='blue' onClick={() => navigate(route)}>{t("components.custommodal.play")}</Button>
</ModalFooter>
</ModalContent>
</Modal>
Expand Down
7 changes: 6 additions & 1 deletion webapp/src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"components": {
"custommodal": {
"play": "Jugar",
"close": "Cerrar"
},
"footer": {
"copyright": "Copyright 2024 ® Software Architecture Group 1A"
},
Expand Down Expand Up @@ -87,7 +91,8 @@
"playAgain": "Play Again",
"back": "Back to Menu",
"question": "Question",
"time": "Time Remaining:"
"time": "Time Remaining:",
"send": "Send"
},
"config": {
"title": "Settings",
Expand Down
7 changes: 6 additions & 1 deletion webapp/src/locales/es.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"components": {
"custommodal": {
"play": "Jugar",
"close": "Cerrar"
},
"footer": {
"copyright": "Copyright 2024 ® Grupo 1A de Arquitectura del Software"
},
Expand Down Expand Up @@ -87,7 +91,8 @@
"playAgain": "Jugar de nuevo",
"back": "Volver al menú",
"question": "Pregunta",
"time": "Tiempo restante:"
"time": "Tiempo restante:",
"send": "Enviar"
},
"config": {
"title": "Configuración",
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/pages/Calculadora/Calculadora.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const CalculadoraHumana = () => {
{juegoTerminado ? (
<Box textAlign="center">
<Heading as="h2">{t('pages.humancalculator.finished')}</Heading>
<p p={2}>Tu puntuación: {puntuacion}</p>
<p p={2}>{t("pages.humancalculator.score")} {puntuacion}</p>
<Flex flexDirection={"column"}>
<Button onClick={handleRepetirJuego} colorScheme="teal" m={2} data-testid="play-again-button">
{t('pages.humancalculator.playAgain')}
Expand All @@ -198,7 +198,7 @@ const CalculadoraHumana = () => {
/>
<Button mt={3} onClick={() => handleAnswer(Number(valSubmit))} data-testid="submit-button">
{" "}
Enviar{" "}
{t('pages.humancalculator.send')}{" "}
</Button>
<Box textAlign="center" mt={4}>
<p>{t('pages.humancalculator.time')} {Math.floor(tiempoRestante)}</p>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/pages/Clasico/Clasico.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const JuegoPreguntas = () => {
<p>
{t("pages.classic.time")} {Math.floor(tiempoRestante)}
</p>
<p>Puntuación: {puntuacion}</p>
<p>{t("pages.classic.score")} {puntuacion}</p>
<Box w="100%" bg="gray.100" borderRadius="lg" mt={4}>
<Box
bg="teal.500"
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/pages/Social/GroupDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import Nav from "../../components/Nav/Nav.js";
import Footer from "../../components/Footer/Footer.js";
import { useTranslation } from "react-i18next";
import Perfil from "../../components/Profile/Profile.js";
import Profile from "../../components/Profile/Profile.js";


const GroupDetails = () => {
Expand Down Expand Up @@ -55,15 +55,15 @@ const GroupDetails = () => {
};

const redirectToProfile = (member) => {
navigate(`/perfil/${member.username}`);
setUser(member);
};


if(user){
return (
<>
<Nav />
<Perfil username={user} />
<Profile username={user} />
<Button p={"1rem"} mb={"1rem"} onClick={() => setUser("")}>Volver</Button>
<Footer />
</>
Expand Down

0 comments on commit 3329e6f

Please sign in to comment.