2021-06-22 18:00:52 +03:00
|
|
|
import React, { useEffect, useState } from 'react';
|
2021-06-21 17:41:26 +03:00
|
|
|
import { Link } from 'react-router-dom';
|
2021-06-16 17:51:25 +03:00
|
|
|
import style from './Calendar.module.css';
|
|
|
|
import calendarMale from '../../images/medium_male.png';
|
2021-06-17 18:21:48 +03:00
|
|
|
import rectangle from '../../images/rectangle_secondPage.png';
|
|
|
|
import CalendarComponent from './CalendarComponent';
|
2021-06-22 18:00:52 +03:00
|
|
|
import { currentMonth } from './calendarHelper';
|
2021-06-16 17:51:25 +03:00
|
|
|
|
2021-06-30 17:21:55 +03:00
|
|
|
const Calendar = ({ candidateForCalendar }) => {
|
2021-06-22 18:00:52 +03:00
|
|
|
const [month, setMonth] = useState('');
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
setMonth(currentMonth);
|
|
|
|
}, [month]);
|
|
|
|
|
2021-06-30 17:21:55 +03:00
|
|
|
const { name, skillsName } = candidateForCalendar;
|
|
|
|
|
|
|
|
const abbreviatedName = name.substring(0, name.lastIndexOf(' '));
|
|
|
|
|
2021-06-16 17:51:25 +03:00
|
|
|
return (
|
|
|
|
<section className={style.calendar}>
|
|
|
|
<div className="container">
|
|
|
|
<div className="row">
|
|
|
|
<h2 className={style.calendar__title}>
|
2021-06-17 18:21:48 +03:00
|
|
|
Добрый день, <span>Александр !</span>
|
2021-06-16 17:51:25 +03:00
|
|
|
</h2>
|
2021-06-21 12:08:12 +03:00
|
|
|
<div className="col-12 col-xl-12 d-flex justify-content-between align-items-center flex-column flex-sm-row">
|
2021-06-16 17:51:25 +03:00
|
|
|
<div className={style.calendarHeader__info}>
|
|
|
|
<img className={style.calendarHeader__info__img} src={calendarMale} alt="img" />
|
2021-06-30 17:21:55 +03:00
|
|
|
<h3 className={style.calendarHeader__info__name}>{abbreviatedName}</h3>
|
2021-06-16 17:51:25 +03:00
|
|
|
</div>
|
2021-06-17 18:21:48 +03:00
|
|
|
<div className={style.calendarHeader__title}>
|
2021-06-30 17:21:55 +03:00
|
|
|
<h3 className={style.calendarHeader__title__text}>{skillsName} разработчик</h3>
|
2021-06-17 18:21:48 +03:00
|
|
|
<img className={style.calendarHeader__title__img} src={rectangle} alt="img" />
|
|
|
|
</div>
|
2021-06-21 17:41:26 +03:00
|
|
|
<div>
|
|
|
|
<Link to="/report">
|
|
|
|
<button className={style.calendarHeader__btn}>Заполнить отчет за день</button>
|
|
|
|
</Link>
|
2021-06-17 18:21:48 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="row">
|
2021-06-21 12:08:12 +03:00
|
|
|
<div className="col-12 col-xl-12">
|
2021-06-17 18:21:48 +03:00
|
|
|
<CalendarComponent />
|
|
|
|
<p className={style.calendarFooter__text}>
|
2021-06-22 18:00:52 +03:00
|
|
|
{month} : <span> 60 часов </span>
|
2021-06-17 18:21:48 +03:00
|
|
|
</p>
|
2021-06-16 17:51:25 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Calendar;
|