diff --git a/src/components/Calendar/Calendar.js b/src/components/Calendar/Calendar.js index 1e4dbf20..3c414f38 100644 --- a/src/components/Calendar/Calendar.js +++ b/src/components/Calendar/Calendar.js @@ -1,92 +1,64 @@ -import React, { useEffect, useState } from 'react' -import { useDispatch, useSelector } from 'react-redux' -import { selectCurrentCandidate, auth } from '../../redux/outstaffingSlice' -import { Link, useHistory, useParams } from 'react-router-dom' -import calendarMale from '../../images/medium_male.png' -import rectangle from '../../images/rectangle_secondPage.png' -import CalendarComponent from './CalendarComponent' -import { currentMonth } from './calendarHelper' -import { Footer } from '../Footer/Footer' +import React, {useEffect, useState} from 'react' +import {useSelector} from 'react-redux' +import {selectCurrentCandidate} from '../../redux/outstaffingSlice' +import {Link} from 'react-router-dom' -import { fetchReportList } from '../../server/server' -import { getRole } from '../../redux/roleSlice' +import CalendarComponent from './CalendarComponent' +import {currentMonth} from './calendarHelper' +import {Footer} from '../Footer/Footer' + +import rectangle from '../../images/rectangle_secondPage.png' import './calendar.scss' -const getDateParamString = ({ paramName, value }) => { - return value ? `${paramName}=${value}` : '' -} +const Calendar = ({onSelect}) => { -const Calendar = ({ onSelect }) => { - const dispatch = useDispatch() - const candidateForCalendar = useSelector(selectCurrentCandidate) - const role = useSelector(getRole) - const { userId } = useParams() - const [month, setMonth] = useState('') - const [fromDate, setFromDate] = useState(null) - const [toDate, setToDate] = useState(null) + const candidateForCalendar = useSelector(selectCurrentCandidate); - const history = useHistory() - - // useEffect(() => { - // fetchReportList({ - // link: `${ - // process.env.REACT_APP_API_URL - // }/api/reports/index?user_id=${userId}${getDateParamString({ - // paramName: 'fromDate', - // value: fromDate - // })}${getDateParamString({ - // paramName: 'toDate', - // value: toDate - // })}`, - // history, - // role, - // logout: () => {} - // }) - // }, []) + const [month, setMonth] = useState(''); useEffect(() => { setMonth(currentMonth) - }, [month]) + }, [month]); - const { name, skillsName, photo } = candidateForCalendar + const {name, skillsName, photo} = candidateForCalendar; - const abbreviatedName = name && name.substring(0, name.lastIndexOf(' ')) + const abbreviatedName = name && name.substring(0, name.lastIndexOf(' ')); return ( -
-
-

- Добрый день, Александр ! -

-
-
- img -

{abbreviatedName}

-
-
-

{skillsName} разработчик

- img -
-
- - - +
+
+

+ Добрый день, Александр ! +

+
+
+ img +

{abbreviatedName}

+
+
+

{skillsName} разработчик

+ img +
+
+ + + +
-
-
-
- -

- {month} : 60 часов -

+
+
+ +

+ {month} : 60 часов +

+
-
-
+