first commit

This commit is contained in:
Hope87
2021-05-26 13:35:57 +03:00
parent 21a43fbd61
commit f772d1c0fa
29 changed files with 737 additions and 62 deletions

View File

@ -1,25 +1,28 @@
import logo from './logo.svg';
import './App.css';
import React, { Suspense, lazy } from 'react'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import 'bootstrap/dist/css/bootstrap.min.css'
function App() {
const AuthPage = lazy(() => import('./pages/AuthPage'))
const HomePage = lazy(() => import('./pages/HomePage'))
const CandidatePage = lazy(() => import('./pages/CandidatePage'))
const App = () => {
const isAuth = true
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
<Router>
<Suspense fallback={<div>Loading...</div>}>
{isAuth ? (
<Switch>
<Route path="/" exact component={HomePage} />
<Route path="/candidate/:id" component={CandidatePage} />
<Route compoent={<div>Not found page</div>} />
</Switch>
) : (
<Route path="/" exact component={AuthPage} />
)}
</Suspense>
</Router>
)
}
export default App;
export default App