diff --git a/client/src/AppRoutes.js b/client/src/AppRoutes.js index 3134f7a..997a4dd 100644 --- a/client/src/AppRoutes.js +++ b/client/src/AppRoutes.js @@ -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 = () => { } /> } /> } /> - } /> + } /> } /> diff --git a/client/src/components/BottomFPage.jsx b/client/src/components/BottomFPage.jsx index ccedf61..6648033 100644 --- a/client/src/components/BottomFPage.jsx +++ b/client/src/components/BottomFPage.jsx @@ -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); diff --git a/client/src/components/Quiz.jsx b/client/src/components/Quiz.jsx deleted file mode 100644 index fb19e9e..0000000 --- a/client/src/components/Quiz.jsx +++ /dev/null @@ -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 ( -
-
-

Zacznij Quiz !

- - -
- - - - - -
- -
- -
- - ) - } - - - - - - return ( - isPopUpActive ? : - - ) -} - -export default Quiz;