From a26693f94a8527b4f23a50518891bbbd51faae1b Mon Sep 17 00:00:00 2001 From: Z1chi Date: Wed, 25 Jan 2023 17:17:57 +0300 Subject: [PATCH] =?UTF-8?q?fixs,=20=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D1=81?= =?UTF-8?q?=D1=82=D0=B5=D0=B9=D1=82=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D1=8B=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D0=B8,=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=B0=D0=BB=20=D0=BD=D0=B0=20=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=20=D0=B4=D0=B0=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useRequest.js | 0 src/pages/CalendarPage.js | 11 -- src/pages/FormPage/FormPage.js | 8 +- src/pages/FormPage/formPage.scss | 302 ++++++++++++++--------------- src/pages/ViewReport/ViewReport.js | 29 ++- 5 files changed, 170 insertions(+), 180 deletions(-) delete mode 100644 src/hooks/useRequest.js delete mode 100644 src/pages/CalendarPage.js diff --git a/src/hooks/useRequest.js b/src/hooks/useRequest.js deleted file mode 100644 index e69de29b..00000000 diff --git a/src/pages/CalendarPage.js b/src/pages/CalendarPage.js deleted file mode 100644 index 98c183ea..00000000 --- a/src/pages/CalendarPage.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import { useNavigate } from 'react-router-dom'; -import { WithLogout } from '../hoc/withLogout'; -import Calendar from '../components/Calendar/Calendar'; - -const CalendarPage = () => { - - return ; -}; - -export default CalendarPage; diff --git a/src/pages/FormPage/FormPage.js b/src/pages/FormPage/FormPage.js index cd4a676d..1598701f 100644 --- a/src/pages/FormPage/FormPage.js +++ b/src/pages/FormPage/FormPage.js @@ -18,6 +18,7 @@ import {currentCandidate, selectCurrentCandidate} from '../../redux/outstaffingS import './formPage.scss' import {apiRequest} from "../../api/request"; +import {LogoutButton} from "../../components/LogoutButton/LogoutButton"; @@ -42,7 +43,9 @@ const FormPage = () => { } return ( - +
+ +
@@ -53,6 +56,7 @@ const FormPage = () => { Вернуться к кандидату
+
@@ -92,7 +96,7 @@ const FormPage = () => {
- +
) }; diff --git a/src/pages/FormPage/formPage.scss b/src/pages/FormPage/formPage.scss index 4d7171c5..bab80318 100644 --- a/src/pages/FormPage/formPage.scss +++ b/src/pages/FormPage/formPage.scss @@ -1,176 +1,174 @@ .form-page { - &__arrow { - display: flex; - justify-content: flex-start; - align-items: center; - margin-top: 80px; - margin-left: -32px; - cursor: pointer; + font-family: "GT Eesti Pro Display", sans-serif; - &-img { - cursor: pointer; - } + &__arrow { + display: flex; + justify-content: flex-start; + align-items: center; + cursor: pointer; + + &-img { + cursor: pointer; + } + } + + &__candidate { + margin-top: 60px; + margin-left: 48px; + display: flex; + } + + &__back { + margin-top: 80px; + padding: 0 20px; + display: flex; + justify-content: space-between; + &-to-candidate { + margin-left: 40px; + margin-right: 120px; + font-size: 1.8em; + font-weight: 100; + line-height: 36px; + } + } + + + &__avatar { + img { + width: 61px; + height: 61px; } - &__candidate { - margin-top: 60px; - margin-left: 48px; - display: flex; + margin-right: 16px; + } + + &__position { + color: #000000; + font-size: 22px; + font-weight: 700; + line-height: 36px; + } + + &__selected { + span { + color: #000000; + font-size: 10px; + font-weight: 300; + line-height: 22.38px; } - &__back-to-candidate { - margin-left: 40px; - margin-right: 120px; - font-family: 'GT Eesti Pro Display'; - font-size: 1.8em; - font-weight: 100; - line-height: 36px; + img { + width: 152px; + margin-right: 18px; } + } - &__avatar { - img { - width: 61px; - height: 61px; - } - margin-right: 16px; - } - - &__position { - color: #000000; - font-family: "GT Eesti Pro Display"; - font-size: 22px; - font-weight: 700; - line-height: 36px; - } - - &__selected { - span { - color: #000000; - font-family: "GT Eesti Pro Display"; - font-size: 10px; - font-weight: 300; - line-height: 22.38px; - } - - img { - width: 152px; - margin-right: 18px; - } - } - - &__interview { - display: flex; - justify-content: center; - align-items: center; - } - - &__form { - width: 45%; - } - - &__separator { - width: 10%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - } - - &__line { - width: 3px; - height: 135px; - background-color: #e4f1f6; - margin-bottom: 26px; - } - - &__option { - color: #000000; - font-family: "GT Eesti Pro Display"; - font-size: 18px; - font-weight: 400; - font-style: normal; - letter-spacing: normal; - line-height: 36px; - text-align: center; - font-style: normal; - letter-spacing: normal; - line-height: normal; - } - - &__telegram { - width: 35%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - - &-text { - width: 225px; - color: #000000; - font-family: "GT Eesti Pro Display"; - font-size: 18px; - font-weight: 400; - font-style: normal; - letter-spacing: normal; - line-height: 33px; - text-align: center; - font-style: normal; - letter-spacing: normal; - margin-bottom: 29px; - } + &__interview { + display: flex; + justify-content: center; + align-items: center; + } + + &__form { + width: 45%; + } + + &__separator { + width: 10%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + } + + &__line { + width: 3px; + height: 135px; + background-color: #e4f1f6; + margin-bottom: 26px; + } + + &__option { + color: #000000; + font-size: 18px; + font-weight: 400; + font-style: normal; + letter-spacing: normal; + text-align: center; + line-height: normal; + } + + &__telegram { + width: 35%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + &-text { + width: 225px; + color: #000000; + font-size: 18px; + font-weight: 400; + font-style: normal; + letter-spacing: normal; + line-height: 33px; + text-align: center; + margin-bottom: 29px; } + } } -.form-page + .logout-button{ - top: 0px !important; - right: 2.5rem; +.form-page + .logout-button { + top: 0 !important; + right: 2.5rem; } .form-page footer { - margin-top: 6rem !important; + margin-top: 6rem !important; } @media (max-width: 991px) { - .form-page { - &__separator { - width: 20% - } - - &__telegram { - width: 25%; - } + .form-page { + &__separator { + width: 20% } + + &__telegram { + width: 25%; + } + } } @media (max-width: 767px) { - .form-page { - &__interview { - flex-direction: column; + .form-page { + &__interview { + flex-direction: column; - form { - margin-top: 48px; - } - } - - &__separator { - display: none; - } - - &__telegram { - margin-top: 5rem; - margin-bottom: 2rem; - } - - &__arrow-img { - display: none; - } - - form label { - line-height: initial; - } - - &__selected img { - width: 100px; - } + form { + margin-top: 48px; + } } + + &__separator { + display: none; + } + + &__telegram { + margin-top: 5rem; + margin-bottom: 2rem; + } + + &__arrow-img { + display: none; + } + + form label { + line-height: initial; + } + + &__selected img { + width: 100px; + } + } } \ No newline at end of file diff --git a/src/pages/ViewReport/ViewReport.js b/src/pages/ViewReport/ViewReport.js index 7a601274..25d026f9 100644 --- a/src/pages/ViewReport/ViewReport.js +++ b/src/pages/ViewReport/ViewReport.js @@ -1,9 +1,8 @@ import React, {useEffect, useState} from 'react' import {Link} from "react-router-dom"; -import {useRequest} from "../../hooks/useRequest"; + import {useSelector} from "react-redux"; import {getReportDate} from "../../redux/reportSlice"; -import SVG from 'react-inlinesvg' import {Loader} from "../../components/Loader/Loader" import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader"; @@ -13,6 +12,7 @@ import arrow from "../../images/right-arrow.png"; import arrowSwitchDate from "../../images/arrowViewReport.png"; import './viewReport.scss' +import {apiRequest} from "../../api/request"; export const ViewReport = () => { const getCreatedDate = (day) => { @@ -26,25 +26,24 @@ export const ViewReport = () => { return `${yyyy}-${mm}-${dd}` } }; - const {apiRequest} = useRequest(); const reportDate = useSelector(getReportDate); const [taskText, setTaskText] = useState([]); - const [difficulties, setDifficulties] = useState([]) - const [tomorrowTask, setTomorrowTask] = useState([]) + const [difficulties, setDifficulties] = useState([]); + const [tomorrowTask, setTomorrowTask] = useState([]); const [totalHours, setTotalHours] = useState(0); - const [reportDay] = useState(new Date (getCreatedDate(reportDate))) - const [currentDay] = useState(new Date ()) - const [loader, setLoader] = useState(false) + const [reportDay] = useState(new Date (getCreatedDate(reportDate))); + const [currentDay] = useState(new Date ()); + const [loader, setLoader] = useState(false); function getReportFromDate(day) { - setLoader(true) - setTaskText([]) - setDifficulties([]) - setTomorrowTask([]) + setLoader(true); + setTaskText([]); + setDifficulties([]); + setTomorrowTask([]); apiRequest(`reports/find-by-date?user_card_id=${localStorage.getItem('cardId')}&date=${day}`) .then(res => { - let spendTime = 0 + let spendTime = 0; for (const item of res) { if(item.difficulties) { setDifficulties(prevArray => [...prevArray, item.difficulties]) @@ -57,14 +56,14 @@ export const ViewReport = () => { hours: task.hours_spent, task: task.task, id: task.id - } + }; if(task.hours_spent) { spendTime += Number(task.hours_spent) } setTaskText(prevArray => [...prevArray, taskInfo]) }) } - setTotalHours(spendTime) + setTotalHours(spendTime); setLoader(false) }) }