deletion of redundant files, semicolon and small fixes

This commit is contained in:
Stachu 2023-03-16 19:06:03 +01:00
parent 25d65b2db4
commit ed2ba3ebdc
3 changed files with 23 additions and 24 deletions

View File

@ -1,6 +1,5 @@
import { TruckId } from "./Truck"; import { TruckId } from "./Truck";
import { AppContext } from './AppContext'; import React, {useEffect} from 'react';
import React, {useContext, useEffect, useState} from 'react';
import { ButtonShowCorrectAnswer } from "./GetImageAndQuestion"; import { ButtonShowCorrectAnswer } from "./GetImageAndQuestion";
export let EndCacheId = ""; export let EndCacheId = "";
export let EndCorrectAnswer = ""; export let EndCorrectAnswer = "";
@ -8,7 +7,6 @@ export let EndCorrectAnswer = "";
const FetchData = ({isClick,score,setIsClick,setScore,navigate}) => { const FetchData = ({isClick,score,setIsClick,setScore,navigate}) => {
useEffect(() => { useEffect(() => {
fetch(`/random-question?fire-truck=${TruckId}`) fetch(`/random-question?fire-truck=${TruckId}`)
.then(res => res.json()) .then(res => res.json())
@ -16,12 +14,13 @@ const FetchData = ({isClick,score,setIsClick,setScore,navigate}) => {
if(isClick){ if(isClick){
const propertValuesObjectFromDb = Object.values(dataQuestion); const propertValuesObjectFromDb = Object.values(dataQuestion);
EndCorrectAnswer = propertValuesObjectFromDb[1]; EndCorrectAnswer = propertValuesObjectFromDb[1];
EndCacheId = propertValuesObjectFromDb[0]; EndCacheId = propertValuesObjectFromDb[0];
} }
}) })
}) });
@ -40,7 +39,13 @@ const FetchData = ({isClick,score,setIsClick,setScore,navigate}) => {
export const QuizGetQuestion = ({score,isClick,setScore,setIsClick,navigate}) => { export const QuizGetQuestion = ({score,isClick,setScore,setIsClick,navigate}) => {
return ( return (
<FetchData score = {score} isClick = {isClick} setScore = {setScore} setIsClick = {setIsClick} navigate = {navigate}/> <FetchData
score = {score}
isClick = {isClick}
setScore = {setScore}
setIsClick = {setIsClick}
navigate = {navigate}
/>
) )
} }

View File

@ -48,7 +48,7 @@ const Result = () => {
textColor : 'black' , textColor : 'black' ,
trailColor : '#c6c4c4' , trailColor : '#c6c4c4' ,
backgroundColor : '#d42436' , backgroundColor : '#d42436' ,
} ) } />; } ) } />
</div> </div>
<h3 className='textDependsEndScore'>{{endScore}/10 < 9 ? "Jesteś szybki.. ale pożar jest szybszy" : "Brawo udało ci się ugasić pożar !!!"}</h3> <h3 className='textDependsEndScore'>{{endScore}/10 < 9 ? "Jesteś szybki.. ale pożar jest szybszy" : "Brawo udało ci się ugasić pożar !!!"}</h3>

View File

@ -1,6 +0,0 @@
const Player = ({ url }) => {
const audio = new Audio(url);
const play = audio.play();
};
export default Player;