From a44ccbcda996765e0d8b839cb756f12a031d20f4 Mon Sep 17 00:00:00 2001 From: UO288559 Date: Tue, 16 Apr 2024 09:57:20 +0200 Subject: [PATCH 1/6] Login adaptable. --- webapp/src/components/Login.js | 86 +++++++++++++++++----------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 2b3d7c6c..ac39c4c7 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -51,50 +51,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}`} /> + )} +
)} -
- )} - +
); }; From e1f33f38e06c9658561c7f77322c0b173d0a93d8 Mon Sep 17 00:00:00 2001 From: UO288559 Date: Tue, 16 Apr 2024 10:38:51 +0200 Subject: [PATCH 2/6] NavigationBar adaptable. --- .../src/components/fragments/NavigationBar.js | 88 +++++++++++++------ 1 file changed, 60 insertions(+), 28 deletions(-) diff --git a/webapp/src/components/fragments/NavigationBar.js b/webapp/src/components/fragments/NavigationBar.js index 5fd3e8dd..049f2fe2 100644 --- a/webapp/src/components/fragments/NavigationBar.js +++ b/webapp/src/components/fragments/NavigationBar.js @@ -1,8 +1,9 @@ // 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 { useUser } from '../UserContext'; +import MenuIcon from '@mui/icons-material/Menu'; const NavigationBar = () => { @@ -14,6 +15,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 = () => { navigate("/PantallaInicio") @@ -41,33 +52,54 @@ const NavigationBar = () => { return null; // Si no estás en / o /App, no muestra la barra de navegación } - return ( - - - {/* Columna izquierda */} - - - - - - {/* Columna derecha */} - - - - - - - ); + return ( + + + + + + + Inicio + Historial de Juegos + Ranking + Cerrar Sesión + + + + + + + + + + + + + + + ); }; export default NavigationBar; \ No newline at end of file From 3bdc3d894b731c3c536daad62ed4ebbfb5860829 Mon Sep 17 00:00:00 2001 From: UO288559 Date: Tue, 16 Apr 2024 10:44:56 +0200 Subject: [PATCH 3/6] NavigationBar_Game adaptable. --- .../fragments/NavigationBar_Game.js | 51 +++++++++++++++---- 1 file changed, 40 insertions(+), 11 deletions(-) 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 + + + + + + + ); }; From 63e3aaee62f84b46ec15d5a9055e2a23f355c5db Mon Sep 17 00:00:00 2001 From: UO288559 Date: Tue, 16 Apr 2024 10:54:02 +0200 Subject: [PATCH 4/6] GameConfiguration adaptable. --- webapp/src/components/GameConfiguration.js | 95 +++++++++++----------- 1 file changed, 49 insertions(+), 46 deletions(-) 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; From 18eae40f68132f0e399e342368aefb1640ba36a3 Mon Sep 17 00:00:00 2001 From: UO288559 Date: Tue, 16 Apr 2024 12:10:38 +0200 Subject: [PATCH 5/6] Registro adaptable. --- webapp/src/components/AddUser.js | 102 ++++++++++++++++--------------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index 6cd1b394..93eb675c 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -31,56 +31,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; From c470be3100a85f50b51a9076ae32512f945afae8 Mon Sep 17 00:00:00 2001 From: UO288559 Date: Tue, 16 Apr 2024 12:15:20 +0200 Subject: [PATCH 6/6] =?UTF-8?q?A=C3=B1adido=20bot=C3=B3n=20perfil=20al=20m?= =?UTF-8?q?en=C3=BA=20desplegable=20del=20=20Nav.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/src/components/fragments/NavigationBar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/src/components/fragments/NavigationBar.js b/webapp/src/components/fragments/NavigationBar.js index 049f2fe2..57f1071e 100644 --- a/webapp/src/components/fragments/NavigationBar.js +++ b/webapp/src/components/fragments/NavigationBar.js @@ -74,6 +74,7 @@ const NavigationBar = () => { Inicio Historial de Juegos Ranking + Perfil Cerrar Sesión