Merge branch 'profileCalendar' into profilePage

# Conflicts:
#	src/components/ProfileCalendar/ProfileCalendar.js
This commit is contained in:
Дмитрий Савенко 2023-01-16 21:17:29 +03:00
commit 8be95f8ea7

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import {useSelector} from 'react-redux' import {useDispatch, useSelector} from 'react-redux'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import moment from "moment"; import moment from "moment";
@ -11,11 +11,12 @@ import {ProfileHeader} from "../ProfileHeader/ProfileHeader";
import {useRequest} from "../../hooks/useRequest"; import {useRequest} from "../../hooks/useRequest";
import { getProfileInfo } from '../../redux/outstaffingSlice' import { getProfileInfo } from '../../redux/outstaffingSlice'
import {setReportDate} from "../../redux/reportSlice";
import './profileCalendar.scss' import './profileCalendar.scss'
export const ProfileCalendar = () => { export const ProfileCalendar = () => {
const dispatch = useDispatch();
const profileInfo = useSelector(getProfileInfo); const profileInfo = useSelector(getProfileInfo);
const [month, setMonth] = useState(''); const [month, setMonth] = useState('');
const [reports, setReports] = useState([]); const [reports, setReports] = useState([]);
@ -60,7 +61,9 @@ export const ProfileCalendar = () => {
<p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p> <p className='summary__name'>{profileInfo.fio} {profileInfo.specification}</p>
</div> </div>
<Link to='/report'> <Link to='/report'>
<button className="calendar__btn">Заполнить отчет за день</button> <button className="calendar__btn" onClick={() => {
dispatch(setReportDate(''))
}}>Заполнить отчет за день</button>
</Link> </Link>
</div> </div>
<div className='row'> <div className='row'>