guild_front/src/components/Candidate/Candidate.js

27 lines
672 B
JavaScript
Raw Normal View History

2021-05-26 13:35:57 +03:00
import React from 'react';
2021-05-26 15:59:00 +03:00
import { useParams, useHistory } from 'react-router-dom';
import { candidatesList } from '../Home/sections/Description';
2021-05-26 13:35:57 +03:00
import classes from './Candidate.module.scss';
const Candidate = () => {
2021-05-26 15:59:00 +03:00
const history = useHistory();
const { id: candidateId } = useParams();
const currentCandidate = candidatesList.find((el) => el.id === Number(candidateId));
2021-05-26 13:35:57 +03:00
return (
<div className={classes.wrapper}>
2021-05-26 15:59:00 +03:00
<button style={{ margin: '60px' }} onClick={() => history.push('/')}>
Home
</button>
<h1>
2021-05-26 13:35:57 +03:00
Candidate name: <span>{currentCandidate.name}</span>
</h1>
</div>
);
};
export default Candidate;