mirror of
https://github.com/originalmk/skrytka-app.git
synced 2024-11-20 10:28:50 +00:00
test commit., delete unnecessary file.
This commit is contained in:
parent
0d4754b755
commit
00ae400e0d
@ -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>
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
Loading…
Reference in New Issue
Block a user