From d31e1a917e6400c604624191aaa35a9dc7ece60e Mon Sep 17 00:00:00 2001 From: alegarman2002 <116609314+alegarman2002@users.noreply.github.com> Date: Thu, 14 Mar 2024 01:50:34 +0100 Subject: [PATCH 1/2] Fixed problems for deploy removing unused lines --- webapp/src/components/FirstGame.js | 6 +----- webapp/src/components/Menu.js | 8 ++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/webapp/src/components/FirstGame.js b/webapp/src/components/FirstGame.js index d9ca0222..6778016b 100644 --- a/webapp/src/components/FirstGame.js +++ b/webapp/src/components/FirstGame.js @@ -1,10 +1,8 @@ -import React, { useState, useEffect } from 'react'; +import React from 'react'; import { Container, Typography } from '@mui/material'; import './FirstGame.css'; -import { CircularProgressbar } from 'react-circular-progressbar'; import 'react-circular-progressbar/dist/styles.css'; import axios from 'axios'; -import { json } from 'react-router-dom'; import { useNavigate, useLocation } from 'react-router-dom'; @@ -17,7 +15,6 @@ const Quiz = () => { var questions = useLocation().state.questions; const [currentQuestionIndex, setCurrentQuestionIndex] = React.useState(0); - const [selectedOption, setSelectedOption] = React.useState(null); const [isCorrect, setIsCorrect] = React.useState(null); const esperar = (ms) => { @@ -73,7 +70,6 @@ const Quiz = () => { const checkAnswer = async (option) => { getQuestions() setIsCorrect(option === questions[currentQuestionIndex].correctAnswer); - setSelectedOption(option); const botonIncorrecta = document.getElementById('option-' + questions[currentQuestionIndex].options.indexOf(option)) if (!isCorrect) { diff --git a/webapp/src/components/Menu.js b/webapp/src/components/Menu.js index 59b05e16..d10ac752 100644 --- a/webapp/src/components/Menu.js +++ b/webapp/src/components/Menu.js @@ -1,20 +1,16 @@ -import React, { useState, useEffect } from 'react'; -import { Container, Typography } from '@mui/material'; +import React, { useState } from 'react'; +import { Container } from '@mui/material'; import './FirstGame.css'; import 'react-circular-progressbar/dist/styles.css'; import axios from 'axios'; -import { json } from 'react-router-dom'; import { useNavigate } from 'react-router-dom'; // Importa useHistory const apiEndpoint = 'http://localhost:8007'; -var jsonApi = '' var isApiCalledRef = false; -const DatosContext = React.createContext(); - var questions = [] function secureRandomNumber(max) { From 8574d17390070780e6946ca58aa64b823c5f73c5 Mon Sep 17 00:00:00 2001 From: alegarman2002 <116609314+alegarman2002@users.noreply.github.com> Date: Thu, 14 Mar 2024 01:53:45 +0100 Subject: [PATCH 2/2] Fixed unused elements from index --- webapp/src/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/webapp/src/index.js b/webapp/src/index.js index 0e09a394..60f9bc4b 100644 --- a/webapp/src/index.js +++ b/webapp/src/index.js @@ -5,11 +5,8 @@ import App from './App'; import reportWebVitals from './reportWebVitals'; import { - createBrowserRouter, - RouterProvider, Route, Routes, - useNavigate, MemoryRouter as Router } from "react-router-dom";