guild_front/src/App.js

41 lines
1.5 KiB
JavaScript
Raw Normal View History

2021-08-04 13:04:05 +03:00
import React, { Suspense, lazy } from 'react'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import 'bootstrap/dist/css/bootstrap.min.css'
import './fonts/stylesheet.css'
import { ProtectedRoute } from './components/ProtectedRoute/ProtectedRoute';
2021-08-04 13:04:05 +03:00
const AuthPageForDevelopers = lazy(() =>
import('./pages/AuthPageForDevelopers')
)
const AuthPageForPartners = lazy(() => import('./pages/AuthPageForPartners'))
const HomePage = lazy(() => import('./pages/HomePage'))
const CandidatePage = lazy(() => import('./pages/CandidatePage'))
const CalendarPage = lazy(() => import('./pages/CalendarPage'))
const ReportPage = lazy(() => import('./pages/ReportFormPage.js'))
const FormPage = lazy(() => import('./pages/FormPage.js'))
2021-05-26 13:35:57 +03:00
const App = () => {
return (
2021-05-26 13:35:57 +03:00
<Router>
<Suspense fallback={<div>Loading...</div>}>
2021-08-04 13:04:05 +03:00
<Switch>
<Route path='/auth' exact>
2021-07-02 16:02:47 +03:00
{/* <AuthPageForPartners /> */}
<AuthPageForDevelopers />
2021-05-31 18:23:25 +03:00
</Route>
2021-08-04 13:04:05 +03:00
<ProtectedRoute path='/' exact component={HomePage} />
<ProtectedRoute path='/candidate/:id' component={CandidatePage} />
<ProtectedRoute path='/calendar' component={CalendarPage} />
<ProtectedRoute path='/form' component={FormPage} />
<ProtectedRoute path='/report' component={ReportPage} />
<Route>
<div>Page not found</div>
</Route>
</Switch>
2021-05-26 13:35:57 +03:00
</Suspense>
</Router>
2021-08-04 13:04:05 +03:00
)
}
2021-08-04 13:04:05 +03:00
export default App