diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index 3c2bb574..0b8e69aa 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -33,58 +33,60 @@ const AddUser = () => { }; return ( - - - REGÍSTRATE - - setUsername(e.target.value)} - sx={{ width: '50vh', marginBottom: 2, backgroundColor: '#FFFFFF'}} - /> - setEmail(e.target.value)} - sx={{ width: '50vh', marginBottom: 2, backgroundColor: '#FFFFFF'}} - /> - setPassword(e.target.value)} - sx={{ width: '50vh', marginBottom: 2, backgroundColor: '#FFFFFF' }} - /> + +
+ + REGÍSTRATE + + setUsername(e.target.value)} + sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} + /> + setEmail(e.target.value)} + sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} + /> + setPassword(e.target.value)} + sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} + /> - - - {error && ( - setError('')} message={`Error: ${error}`} /> - )} - - ); + + + {error && ( + setError('')} + message={`Error: ${error}`}/> + )} +
+
+); }; export default AddUser; diff --git a/webapp/src/components/GameConfiguration.js b/webapp/src/components/GameConfiguration.js index b9619e6b..31dc2dd5 100644 --- a/webapp/src/components/GameConfiguration.js +++ b/webapp/src/components/GameConfiguration.js @@ -55,60 +55,63 @@ const GameConfiguration = () => { return ( - - Configuración de la partida - - + + Personaliza tu partida + + - - - - {error && ( - setError('')} message={`Error: ${error}`} /> - )} + inputProps={{ + inputMode: 'numeric', + pattern: '[0-9]*', + min: 1, + max: 30, + }} + /> + + + + {error && ( + setError('')} + message={`Error: ${error}`}/> + )} + - ); +); }; export default GameConfiguration; diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 571456c5..21214930 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -55,52 +55,50 @@ const Login = () => { }; return ( - - {loginSuccess ? ( - null - - ) : ( -
- - INICIA SESIÓN - - setUsername(e.target.value)} - sx={{ width: '50vh', marginBottom: 2, backgroundColor: '#FFFFFF'}} - /> - setPassword(e.target.value)} - sx={{ width: '50vh', marginBottom: 2, backgroundColor: '#FFFFFF'}} - /> - - - {error && ( - setError('')} message={`Error: ${error}`} /> + + {loginSuccess ? ( + null + + ) : ( +
+ + Inicia sesión + + setUsername(e.target.value)} + sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} + /> + setPassword(e.target.value)} + sx={{ marginBottom: 4, backgroundColor: '#FFFFFF'}} + /> + + + {error && ( + setError('')} message={`Error: ${error}`} /> + )} +
)} -
- )} - +
); }; diff --git a/webapp/src/components/fragments/NavigationBar.js b/webapp/src/components/fragments/NavigationBar.js index d2ff705a..7501f2db 100644 --- a/webapp/src/components/fragments/NavigationBar.js +++ b/webapp/src/components/fragments/NavigationBar.js @@ -1,9 +1,10 @@ // src/components/NavigationBar.js import React, { useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; -import { AppBar, Button, Grid } from '@mui/material'; +import { AppBar, Toolbar, IconButton, Menu, MenuItem, Grid, Button, Hidden} from '@mui/material'; import Tooltip from '@mui/material/Tooltip'; import { useUser } from '../UserContext'; +import MenuIcon from '@mui/icons-material/Menu'; const NavigationBar = () => { @@ -15,6 +16,16 @@ const NavigationBar = () => { const isHiddenRoute = location.pathname === '/' || location.pathname === '/App' || location.pathname === '/Game'; + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + + const handleMenu = (event) => { + setAnchorEl(event.currentTarget); + }; + + const handleClose = () => { + setAnchorEl(null); + }; const showHome = () => { if (usernameGlobal === 'admin') { @@ -51,44 +62,63 @@ const NavigationBar = () => { } return ( - - - {/* Columna izquierda */} - - - - - - - - - - - - - - {/* Columna derecha */} - - - - - - - - - - - + + + + + + + Inicio + Historial de Juegos + Ranking + Perfil + Cerrar Sesión + + + + + + + + + + + + + + + + + + + + + + + + ); }; diff --git a/webapp/src/components/fragments/NavigationBar_Game.js b/webapp/src/components/fragments/NavigationBar_Game.js index 07317052..977b7303 100644 --- a/webapp/src/components/fragments/NavigationBar_Game.js +++ b/webapp/src/components/fragments/NavigationBar_Game.js @@ -1,20 +1,30 @@ import React, {useCallback, useState} from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; -import { AppBar, Button, Grid } from '@mui/material'; -import { useUser } from '../UserContext'; +import { AppBar, Toolbar, IconButton, Menu, MenuItem, Grid, Button, Hidden} from '@mui/material'; +import MenuIcon from '@mui/icons-material/Menu'; import axios from 'axios'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; const NavigationBar_Game = () => { const [error, setError] = useState(''); - const { usernameGlobal, setUsernameGlobal } = useUser(); const navigate = useNavigate(); const location = useLocation(); const isHiddenRoute = location.pathname !== '/Game' ; + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + + const handleMenu = (event) => { + setAnchorEl(event.currentTarget); + }; + + const handleClose = () => { + setAnchorEl(null); + }; + const showHome = useCallback(async () => { try { @@ -32,14 +42,33 @@ const NavigationBar_Game = () => { return ( - - {/* Columna izquierda */} - - - - + + + + + + Inicio + + + + + + + ); };