diff --git a/webapp/src/App.js b/webapp/src/App.js index 1eb7038f..fb249232 100644 --- a/webapp/src/App.js +++ b/webapp/src/App.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import Authenticate from './pages/Authenticate/Authenticate.js'; import Home from './pages/Home/Home.js'; import Clasico from './pages/Clasico/Clasico.js'; diff --git a/webapp/src/components/Login/Login.js b/webapp/src/components/Login/Login.js index 6c89c8ee..7ff7e05d 100644 --- a/webapp/src/components/Login/Login.js +++ b/webapp/src/components/Login/Login.js @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import axios from 'axios'; import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; +import {useNavigate} from "react-router-dom"; const Login = () => { const [username, setUsername] = useState(''); @@ -10,6 +11,7 @@ const Login = () => { const [loginSuccess, setLoginSuccess] = useState(false); const [createdAt, setCreatedAt] = useState(''); const [openSnackbar, setOpenSnackbar] = useState(false); + const navigate = useNavigate(); const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; @@ -40,14 +42,7 @@ const Login = () => { return ( {loginSuccess ? ( -
- - Hello {username}! - - - Your account was created on {new Date(createdAt).toLocaleDateString()}. - -
+ navigate("/home") ) : (
diff --git a/webapp/src/pages/Clasico/Clasico.js b/webapp/src/pages/Clasico/Clasico.js index 6bd7fb15..a45fdead 100644 --- a/webapp/src/pages/Clasico/Clasico.js +++ b/webapp/src/pages/Clasico/Clasico.js @@ -1,10 +1,8 @@ import React, { useState, useEffect } from "react"; import "./Clasico.css"; -import Preguntas from "../../components/Preguntas"; import Nav from '../../components/Nav/Nav.js'; import { Link } from 'react-router-dom'; import Footer from "../../components/Footer/Footer.js"; -import axios from 'axios'; const JuegoPreguntas = () => {