Skip to content

Commit

Permalink
Merge pull request #47 from Arquisoft/Cancio-GeneralFixes
Browse files Browse the repository at this point in the history
Cancio more general fixes
  • Loading branch information
CANCI0 authored Mar 5, 2024
2 parents bb4dad8 + e22f45c commit 3c0d33c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion webapp/src/App.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
11 changes: 3 additions & 8 deletions webapp/src/components/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand All @@ -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';

Expand Down Expand Up @@ -40,14 +42,7 @@ const Login = () => {
return (
<Container component="main" maxWidth="xs" sx={{ marginTop: 4 }}>
{loginSuccess ? (
<div>
<Typography component="h1" variant="h5" sx={{ textAlign: 'center' }}>
Hello {username}!
</Typography>
<Typography component="p" variant="body1" sx={{ textAlign: 'center', marginTop: 2 }}>
Your account was created on {new Date(createdAt).toLocaleDateString()}.
</Typography>
</div>
navigate("/home")
) : (
<div>
<Typography component="h1" variant="h5">
Expand Down
2 changes: 0 additions & 2 deletions webapp/src/pages/Clasico/Clasico.js
Original file line number Diff line number Diff line change
@@ -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 = () => {
Expand Down

0 comments on commit 3c0d33c

Please sign in to comment.