Skip to content

Commit

Permalink
Arreglos test
Browse files Browse the repository at this point in the history
  • Loading branch information
UO277938 committed Apr 25, 2024
1 parent 3eefebc commit 1b8efb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion webapp/src/components/Estilos/juego.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#botonSiguiente{
#botonSiguiente, #botonFinal{
width: 6em;
font-size: 2em;
padding: 0.1em;
Expand Down
13 changes: 7 additions & 6 deletions webapp/src/components/Pages/Juego.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import '../Estilos/juego.css';
import { Container } from '@mui/material';
import Temporizador from '../Temporizador';
import PropTypes from 'prop-types'
import {useNavigate} from 'react-router-dom'

const Juego = ({isLogged, username, numPreguntas}) => {
//La pregunta (string)
Expand All @@ -29,7 +28,7 @@ const Juego = ({isLogged, username, numPreguntas}) => {
const [numRespuestasIncorrectas, setNumRespuestasIncorrectas] = useState(0)
const [disableFinish, setDisableFinish] = useState(false)

const navigate= useNavigate()
//const navigate= useNavigate()

//Variables para la obtencion y modificacion de estadisticas del usuario y de preguntas
const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000';
Expand Down Expand Up @@ -201,7 +200,6 @@ const Juego = ({isLogged, username, numPreguntas}) => {
const clickFinalizar = () => {
updateStats();
setDisableFinish(true)
navigate('/')
}

const handleRestart = () => {
Expand All @@ -225,17 +223,20 @@ const Juego = ({isLogged, username, numPreguntas}) => {
: <h2> CARGANDO... </h2>}
{finishGame ? <>
<h2> PARTIDA FINALIZADA </h2>
<h3> ACERTADAS: {numRespuestasCorrectas} FALLADAS: {numRespuestasIncorrectas} </h3>
<button id="botonSiguiente" className="button" disabled={disableFinish} onClick={() => {clickFinalizar()}} > FINALIZAR PARTIDA</button>
<h2> ACERTADAS: {numRespuestasCorrectas} FALLADAS: {numRespuestasIncorrectas} </h2>
<button id="botonFinal" className="button" disabled={disableFinish} onClick={() => {clickFinalizar()}} > FINALIZAR PARTIDA</button>
</> : <></>}

{ disableFinish ? ( <h2> Comience nueva partida o visite sus estadísticas!!</h2>)
: <></> }
</Container>
);
};

Juego.propTypes = {
isLogged: PropTypes.bool,
username: PropTypes.string,
numPreguntas: PropTypes.number
numPreguntas: PropTypes.number,
}


Expand Down
11 changes: 5 additions & 6 deletions webapp/src/components/Pages/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000
<Navbar.Brand href="/">WIQ 5A</Navbar.Brand>
<Navbar.Toggle aria-controls="responsive-navbar-nav" />
<Navbar.Collapse id="responsive-navbar-nav">
<Nav className="me-auto">
{isLogged &&
<Nav.Link href="stats">Estadísticas</Nav.Link>
}
</Nav>
{ isLogged ? (<Nav className="me-auto">
<Nav.Link href="game">Nueva Partida</Nav.Link>
<Nav.Link href="stats">Estadísticas</Nav.Link>
</Nav>) : <Nav className="me-auto"></Nav>
}
<Nav>
<Nav.Link href={`${apiEndpoint}/api-doc`} target="_blanck">API</Nav.Link>
</Nav>
<Nav>
{isLogged ? (

<Nav.Link onClick={onLogout}>Cerrar sesión</Nav.Link>
) : (
<>
Expand Down

0 comments on commit 1b8efb3

Please sign in to comment.