Fixed report page
This commit is contained in:
parent
fb0ce999f6
commit
21fe443d05
@ -132,6 +132,8 @@
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
&__form {
|
||||
|
@ -27,8 +27,8 @@ export const ProfileCalendarComponent = React.memo(
|
||||
const [currentDay] = useState(moment());
|
||||
const [calendar, setCalendar] = useState([]);
|
||||
const [month, setMonth] = useState("");
|
||||
const [dayReport, setDayReport] = useState("");
|
||||
const [shortReport, setShortReport] = useState(false);
|
||||
const [dayTest, setDayTest] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
setCalendar(calendarHelper(value));
|
||||
@ -148,7 +148,7 @@ export const ProfileCalendarComponent = React.memo(
|
||||
dispatch(setReportDate(day));
|
||||
dispatch(setSendRequest(true));
|
||||
setShortReport(true);
|
||||
setDayTest(day);
|
||||
setDayReport(day);
|
||||
}}
|
||||
key={day}
|
||||
className={dayStyles(day)}
|
||||
@ -171,9 +171,13 @@ export const ProfileCalendarComponent = React.memo(
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<Link to={correctRoute(dayTest)}>
|
||||
|
||||
{shortReport && (
|
||||
<Link to={correctRoute(dayReport)}>
|
||||
<button className="calendar__btn">Посмотреть подробнее</button>
|
||||
</Link>
|
||||
)}
|
||||
|
||||
{shortReport && <ShortReport />}
|
||||
</div>
|
||||
);
|
||||
|
@ -18,7 +18,7 @@ import "./shortReport.scss";
|
||||
export const ShortReport = ({}) => {
|
||||
const reportDate = useSelector(getReportDate);
|
||||
|
||||
const sendTest = useSelector(getSendRequest);
|
||||
const sendReport = useSelector(getSendRequest);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const [taskText, setTaskText] = useState([]);
|
||||
@ -26,7 +26,6 @@ export const ShortReport = ({}) => {
|
||||
const [tomorrowTask, setTomorrowTask] = useState([]);
|
||||
const [totalHours, setTotalHours] = useState(0);
|
||||
const [loader, setLoader] = useState(false);
|
||||
const [reportDay] = useState(new Date(getCreatedDate(reportDate)));
|
||||
|
||||
function getReportFromDate(day) {
|
||||
setLoader(true);
|
||||
@ -39,7 +38,6 @@ export const ShortReport = ({}) => {
|
||||
"cardId"
|
||||
)}&date=${day}`
|
||||
).then((res) => {
|
||||
console.log(res);
|
||||
let spendTime = 0;
|
||||
for (const item of res) {
|
||||
if (item.difficulties) {
|
||||
@ -66,14 +64,14 @@ export const ShortReport = ({}) => {
|
||||
});
|
||||
}
|
||||
|
||||
if (sendTest) {
|
||||
if (sendReport) {
|
||||
dispatch(setSendRequest(false));
|
||||
getReportFromDate(getCreatedDate(reportDate));
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="viewReport__info">
|
||||
<div className="viewReport__info short-report">
|
||||
<h2 className="viewReport__title">
|
||||
Ваши отчеты - <span>просмотр отчета за день</span>
|
||||
</h2>
|
||||
|
@ -0,0 +1,3 @@
|
||||
.short-report {
|
||||
margin-bottom: 30px;
|
||||
}
|
Loading…
Reference in New Issue
Block a user