test commit., delete unnecessary file.

This commit is contained in:
Stachu 2023-02-26 22:19:51 +01:00
parent 0d4754b755
commit 00ae400e0d
3 changed files with 20 additions and 45 deletions

View File

@ -2,7 +2,7 @@ import Truck from './components/Truck';
import { Route, Routes } from 'react-router-dom';
import App from './App';
import NotFound from './components/NotFound'
import Quiz from './components/Quiz';
import QuizGame from './components/QuizGame';
import Result from './components/Result';
import AppProvider from './components/AppContext';
@ -16,7 +16,7 @@ const AppRoutes = () => {
<Route path='/' element={<App />} />
<Route path='/:id' element={<Truck />} />
<Route path='*' element={<NotFound />} />
<Route path='/:id/:id' element={<Quiz />} />
<Route path='/:id/:id' element={<QuizGame />} />
<Route path="/result" element={<AppProvider><Result />
</AppProvider>} />
</Routes>

View File

@ -4,12 +4,28 @@ import React, {useContext} from 'react';
import { AppContext } from './AppContext';
import {Link} from 'react-router-dom';
import {useState, useEffect} from 'react';
import FooterQuiz from './FooterQuiz';
const BottomFPage = () => {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
const url = '/osp-units?prefix=Gdańsk';
useEffect(() => {
fetch(url)
.then((response) => {
if(!response.ok){
throw new Error(
`PROBLEM ${response.status}`
)
}
return response;
})
.then(data => console.log(data))
.catch(err => console.log(err.message))
}, []);
const {unitOsp} = useContext(AppContext);

View File

@ -1,41 +0,0 @@
import React, {useState} from 'react';
import {useNavigate} from 'react-router-dom';
import QuizGame from './QuizGame';
const Quiz = () => {
const [isPopUpActive, setIsPopUpActive] = useState(false);
const navigate = useNavigate();
const PopUp = () => {
return (
<div className="quizContainer">
<div className="popup">
<h1 className='startQuizText'>Zacznij Quiz !</h1>
<div className="twoButton">
<button onClick={() => setIsPopUpActive(false)} className='startQuizBtn'>Start</button>
<button onClick = {() => navigate(-1)} className='backSiteQuizBtn'>Wróc do poprzedniej strony</button>
</div>
</div>
</div>
)
}
return (
isPopUpActive ? <PopUp/> : <QuizGame/>
)
}
export default Quiz;