finished home page

This commit is contained in:
Hope87
2021-05-26 15:59:00 +03:00
parent f772d1c0fa
commit e5c8aa5f43
6 changed files with 97 additions and 32 deletions

View File

@ -1,23 +1,24 @@
import React from 'react';
import { NavLink } from 'react-router-dom';
// import PhotoBlock from './PhotoBlock';
// import { candidatesList } from '../Home/Home'
import { useParams, useHistory } from 'react-router-dom';
import { candidatesList } from '../Home/sections/Description';
import classes from './Candidate.module.scss';
const Candidate = () => {
// const { id: candidateId } = useParams();
// const currentCandidate = candidatesList.find((el) => el.id === Number(candidateId));
const history = useHistory();
const { id: candidateId } = useParams();
const currentCandidate = candidatesList.find((el) => el.id === Number(candidateId));
return (
<div className={classes.wrapper}>
<NavLink to="/">Home</NavLink>
{/* <h1>
<button style={{ margin: '60px' }} onClick={() => history.push('/')}>
Home
</button>
<h1>
Candidate name: <span>{currentCandidate.name}</span>
</h1>
<PhotoBlock /> */}
</div>
);
};