2023-01-10 18:48:02 +03:00
|
|
|
import React from 'react'
|
2023-01-13 13:02:48 +03:00
|
|
|
import {useDispatch, useSelector} from 'react-redux'
|
|
|
|
import {useParams, useNavigate} from 'react-router-dom'
|
2021-11-30 17:00:58 +03:00
|
|
|
import SVG from 'react-inlinesvg'
|
2021-07-03 17:37:30 +03:00
|
|
|
|
2023-01-25 16:50:36 +03:00
|
|
|
import {WithLogout} from '../../hoc/withLogout'
|
2023-01-17 22:14:05 +03:00
|
|
|
|
|
|
|
import Form from '../../components/Form/Form'
|
|
|
|
import {Footer} from '../../components/Footer/Footer'
|
|
|
|
|
|
|
|
import arrow from '../../images/right-arrow.png'
|
|
|
|
import rectangle from '../../images/rectangle_secondPage.png'
|
|
|
|
import telegramIcon from '../../images/telegram-icon.svg'
|
|
|
|
|
|
|
|
import {LEVELS, SKILLS} from '../../constants/constants'
|
|
|
|
|
|
|
|
import {currentCandidate, selectCurrentCandidate} from '../../redux/outstaffingSlice'
|
2021-08-18 15:56:24 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
import './formPage.scss'
|
2023-01-20 16:20:06 +03:00
|
|
|
import {apiRequest} from "../../api/request";
|
2023-01-25 17:17:57 +03:00
|
|
|
import {LogoutButton} from "../../components/LogoutButton/LogoutButton";
|
2023-01-17 22:14:05 +03:00
|
|
|
|
|
|
|
|
2021-08-18 15:56:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
const FormPage = () => {
|
2023-01-10 18:48:02 +03:00
|
|
|
const params = useParams();
|
2023-01-13 13:02:48 +03:00
|
|
|
const navigate = useNavigate();
|
2023-01-10 18:48:02 +03:00
|
|
|
const dispatch = useDispatch();
|
|
|
|
const candidate = useSelector(selectCurrentCandidate);
|
2023-01-16 15:24:08 +03:00
|
|
|
|
|
|
|
|
2021-08-18 15:56:24 +03:00
|
|
|
|
2023-01-13 13:02:48 +03:00
|
|
|
const goBack = () => {
|
|
|
|
navigate(-1)
|
|
|
|
};
|
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
if (!candidate.id) {
|
2023-01-16 15:30:04 +03:00
|
|
|
apiRequest('/profile', {
|
2023-01-16 15:24:08 +03:00
|
|
|
params: Number(params.id)
|
|
|
|
})
|
|
|
|
.then((el) => dispatch(currentCandidate(el)))
|
2021-11-30 17:00:58 +03:00
|
|
|
}
|
2021-08-18 15:56:24 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
return (
|
2023-01-25 17:17:57 +03:00
|
|
|
<div className='container'>
|
|
|
|
|
|
|
|
|
2023-01-13 13:02:48 +03:00
|
|
|
<div className='form-page'>
|
|
|
|
<div className='form-page__back'>
|
|
|
|
<div className='form-page__arrow' onClick={goBack}>
|
|
|
|
<div className='form-page__arrow-img'>
|
|
|
|
<img src={arrow} alt=''/>
|
|
|
|
</div>
|
|
|
|
<div className='form-page__back-to-candidate'>
|
|
|
|
<span>Вернуться к кандидату</span>
|
|
|
|
</div>
|
2021-11-30 17:00:58 +03:00
|
|
|
</div>
|
2023-01-25 17:17:57 +03:00
|
|
|
<LogoutButton />
|
2021-11-30 17:00:58 +03:00
|
|
|
</div>
|
2023-01-13 13:02:48 +03:00
|
|
|
<div className='form-page__candidate'>
|
|
|
|
<div className='form-page__avatar'>
|
|
|
|
<img src={candidate.photo} alt='candidate avatar'/>
|
|
|
|
</div>
|
|
|
|
<div className='form-page__candidate-info'>
|
|
|
|
<div className='form-page__position'>
|
2021-11-30 17:00:58 +03:00
|
|
|
<span>
|
|
|
|
{candidate.specification} {SKILLS[candidate.position_id]},{' '}
|
|
|
|
{LEVELS[candidate.level]}
|
|
|
|
</span>
|
2023-01-13 13:02:48 +03:00
|
|
|
</div>
|
|
|
|
<div className='form-page__selected'>
|
|
|
|
<img src={rectangle} alt='rectangle'/>
|
|
|
|
<span>Выбранный кандидат</span>
|
|
|
|
</div>
|
2021-11-30 17:00:58 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-01-13 13:02:48 +03:00
|
|
|
<div className='form-page__interview'>
|
|
|
|
<div className='form-page__form'>
|
|
|
|
<Form/>
|
|
|
|
</div>
|
|
|
|
<div className='form-page__separator'>
|
|
|
|
<div className='form-page__line'></div>
|
|
|
|
<div className='form-page__option'>или</div>
|
2021-08-18 15:56:24 +03:00
|
|
|
</div>
|
2023-01-13 13:02:48 +03:00
|
|
|
<div className='form-page__telegram'>
|
|
|
|
<div className='form-page__telegram-text'>
|
|
|
|
Заявка на собеседование через телеграм
|
|
|
|
</div>
|
|
|
|
<div className='form-page__telegram-icon'>
|
|
|
|
<a href='https://t.me/st0kir' target='_blank' rel="noreferrer">
|
|
|
|
<SVG src={telegramIcon}/>
|
|
|
|
</a>
|
|
|
|
</div>
|
2021-08-18 15:56:24 +03:00
|
|
|
</div>
|
2021-11-30 17:00:58 +03:00
|
|
|
</div>
|
2023-01-13 13:02:48 +03:00
|
|
|
<Footer/>
|
2021-08-18 15:56:24 +03:00
|
|
|
</div>
|
2023-01-25 17:17:57 +03:00
|
|
|
</div>
|
2021-11-30 17:00:58 +03:00
|
|
|
)
|
2023-01-10 18:48:02 +03:00
|
|
|
};
|
2021-07-03 17:37:30 +03:00
|
|
|
|
2021-11-30 17:00:58 +03:00
|
|
|
export default FormPage
|