fixed code

This commit is contained in:
Hope87
2021-06-29 17:58:15 +03:00
parent 8e607ee21f
commit 800dc0f48c
10 changed files with 106 additions and 77 deletions

View File

@ -12,6 +12,11 @@ const ReportPage = lazy(() => import('./pages/ReportFormPage.js'));
const App = () => {
const [isAuth, setIsAuth] = useState(true);
const [candidates, setCandidates] = useState([]);
const getCandidate = (candidateArr) => {
setCandidates(candidateArr);
};
return (
<Router>
@ -19,10 +24,10 @@ const App = () => {
{isAuth ? (
<Switch>
<Route path="/" exact>
<HomePage />
<HomePage getCandidate={getCandidate} />
</Route>
<Route path="/candidate/:id">
<CandidatePage />
<CandidatePage candidatesArr={candidates} />
</Route>
<Route path="/calendar">
<CalendarPage />