From e26b8cc22ebaf058a70051e97cd632a3bbf2b746 Mon Sep 17 00:00:00 2001 From: M1kola Date: Tue, 21 Feb 2023 19:05:04 +0300 Subject: [PATCH] personal area partner with fixes report --- src/App.js | 4 + src/components/Calendar/calendar.scss | 6 + .../Calendar/calendarComponent.scss | 13 +- src/components/Calendar/calendarHelper.js | 3 +- .../ProfileCalendarComponent.js | 26 +- .../ProfileCalendar/profileCalendar.scss | 18 ++ src/components/ProfileHeader/ProfileHeader.js | 65 ++++- src/components/ReportForm/ReportForm.js | 6 +- src/helper.js | 2 +- src/images/arrowCalendar.png | Bin 0 -> 2284 bytes src/images/arrowSelect.png | Bin 0 -> 123 bytes src/images/selectArrow.png | Bin 0 -> 247 bytes .../PartnerAddRequest/PartnerAddRequest.js | 98 ++++++++ .../PartnerAddRequest/partnerAddRequest.scss | 228 ++++++++++++++++++ src/pages/PartnerRequests/PartnerRequests.js | 64 +++++ .../PartnerRequests/partnerRequests.scss | 199 +++++++++++++++ src/pages/Profile/Profile.js | 161 ++++++++----- src/pages/Profile/profile.scss | 13 + src/pages/Summary/Summary.js | 12 +- src/pages/Summary/summary.scss | 37 ++- src/pages/ViewReport/ViewReport.js | 6 +- src/pages/ViewReport/viewReport.scss | 34 +-- 22 files changed, 873 insertions(+), 122 deletions(-) create mode 100644 src/images/arrowCalendar.png create mode 100644 src/images/arrowSelect.png create mode 100644 src/images/selectArrow.png create mode 100644 src/pages/PartnerAddRequest/PartnerAddRequest.js create mode 100644 src/pages/PartnerAddRequest/partnerAddRequest.scss create mode 100644 src/pages/PartnerRequests/PartnerRequests.js create mode 100644 src/pages/PartnerRequests/partnerRequests.scss diff --git a/src/App.js b/src/App.js index 88965023..84bf489b 100644 --- a/src/App.js +++ b/src/App.js @@ -22,6 +22,8 @@ import {ViewReport} from './pages/ViewReport/ViewReport' import {Tracker} from './pages/Tracker/Tracker' import {Payouts} from './pages/Payouts/Payouts' import {Settings} from './pages/Settings/Settings' +import {PartnerRequests} from './pages/PartnerRequests/PartnerRequests' +import {PartnerAddRequest} from './pages/PartnerAddRequest/PartnerAddRequest' import './fonts/stylesheet.css' import 'bootstrap/dist/css/bootstrap.min.css' @@ -64,6 +66,8 @@ const App = () => { }/> }/> }/> + }/> + }/> }/> diff --git a/src/components/Calendar/calendar.scss b/src/components/Calendar/calendar.scss index 23bb98ef..07dbf74e 100644 --- a/src/components/Calendar/calendar.scss +++ b/src/components/Calendar/calendar.scss @@ -96,6 +96,12 @@ transform: scale(1.02); } + @media (max-width: 950px) { + width: 200px; + font-size: 15px; + height: 50px; + } + @media (max-width: 800px) { width: auto; height: auto; diff --git a/src/components/Calendar/calendarComponent.scss b/src/components/Calendar/calendarComponent.scss index 176fa833..ba69a3c7 100644 --- a/src/components/Calendar/calendarComponent.scss +++ b/src/components/Calendar/calendarComponent.scss @@ -29,11 +29,18 @@ &-box { display: flex; align-items: center; - margin-left: 40px; + margin-left: 20px; + cursor: pointer; img { - width: 6px; - height: 6px; + margin: 0px 10px; + width: 12px; + height: 12px; + + &:first-child { + transform: rotate(180deg); + margin: 0; + } } span { diff --git a/src/components/Calendar/calendarHelper.js b/src/components/Calendar/calendarHelper.js index 62cad531..30d8c7c7 100644 --- a/src/components/Calendar/calendarHelper.js +++ b/src/components/Calendar/calendarHelper.js @@ -53,7 +53,8 @@ export function currentMonthAndDay(day) { } export function getCorrectDate(day) { - return `${new Date(day).getDate()}-${new Date(day).getMonth() + 1}-${new Date(day).getFullYear()}` + const months = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'] + return `${new Date(day).getDate()} ${months[new Date(day).getMonth()]} ${new Date(day).getFullYear()} года` }; export function currentMonthAndDayReportPage() { diff --git a/src/components/ProfileCalendar/ProfileCalendarComponent.js b/src/components/ProfileCalendar/ProfileCalendarComponent.js index 5b438284..ef20a698 100644 --- a/src/components/ProfileCalendar/ProfileCalendarComponent.js +++ b/src/components/ProfileCalendar/ProfileCalendarComponent.js @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react' -import ellipse from '../../images/ellipse.png' +import arrow from '../../images/arrowCalendar.png' import rectangle from '../../images/rectangle__calendar.png' import calendarIcon from '../../images/calendar_icon.png' import moment from 'moment' @@ -68,27 +68,27 @@ export const ProfileCalendarComponent = React.memo(({value, setValueHandler, rep

Мои отчеты

-
- - { - setValueHandler(prevMonth()) - dispatch(setRequestDate(getReports(prevMonth()))) - }}> +
{ + setValueHandler(prevMonth()) + dispatch(setRequestDate(getReports(prevMonth()))) + }}> + + {prevMonth().format('MMMM')}
{value.format('YYYY')}
-
- - { - setValueHandler(nextMonth()) - dispatch(setRequestDate(getReports(nextMonth()))) +
{ + setValueHandler(nextMonth()) + dispatch(setRequestDate(getReports(nextMonth()))) - }}> + }}> + {nextMonth().format('MMMM')} +
diff --git a/src/components/ProfileCalendar/profileCalendar.scss b/src/components/ProfileCalendar/profileCalendar.scss index 59fe1f93..36d8c739 100644 --- a/src/components/ProfileCalendar/profileCalendar.scss +++ b/src/components/ProfileCalendar/profileCalendar.scss @@ -53,4 +53,22 @@ transform: scale(1.02); } } + + .summary__info { + @media (max-width: 800px) { + .summary__name { + margin: 0; + max-width: 220px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + } + + @media (max-width: 500px) { + .summary__name { + max-width: 150px; + } + } + } } diff --git a/src/components/ProfileHeader/ProfileHeader.js b/src/components/ProfileHeader/ProfileHeader.js index adc6055c..d63aae34 100644 --- a/src/components/ProfileHeader/ProfileHeader.js +++ b/src/components/ProfileHeader/ProfileHeader.js @@ -21,6 +21,45 @@ export const ProfileHeader = () => { const userRole = useSelector(getRole); const profileInfo = useSelector(getProfileInfo); + const [user] = useState('developer') + const [navInfo] = useState({ + developer: [ + { + path: '/summary', + name: 'Резюме' + }, + { + path: '/calendar', + name: 'Отчетность' + }, + { + path: '/tracker', + name: 'Трекер' + }, + { + path: '/payouts', + name: 'Выплаты' + }, + { + path: '/settings', + name: 'Настройки' + }, + ], + partner: [ + { + path: '/employees', + name: 'Сотрудники' + }, + { + path: '', + name: 'Отчетность' + }, + { + path: '/requests', + name: 'Запросы' + }, + ] + }) const [isLoggingOut, setIsLoggingOut] = useState(false); @@ -44,7 +83,14 @@ export const ProfileHeader = () => {
-

itguild.для разработчиков

+

itguild. + + {user === 'developer' ? + 'для разработчиков' : + 'для партнеров' + } + +

@@ -53,15 +99,20 @@ export const ProfileHeader = () => {
-

{profileInfo?.fio}

+

+ {user === 'developer' ? + profileInfo?.fio : + '' + } +

avatar diff --git a/src/components/ReportForm/ReportForm.js b/src/components/ReportForm/ReportForm.js index 7a579863..77163999 100644 --- a/src/components/ReportForm/ReportForm.js +++ b/src/components/ReportForm/ReportForm.js @@ -60,13 +60,11 @@ const ReportForm = () => { const totalHours = inputs.reduce((a, b) => a + b.hours_spent, 0); const deleteInput = (indexRemove) => { - if (indexRemove !== 0) { - setInputs((prev) => prev.filter((el, index) => index !== indexRemove)) - } + setInputs((prev) => prev.filter((el, index) => index !== indexRemove)) }; const handler = () => { - if(!inputs[0].task) { + if(!inputs[0].task || !inputs[0].hours_spent) { setReportSuccess('Заполните задачи'); setTimeout(() => setReportSuccess(''), 1000) return diff --git a/src/helper.js b/src/helper.js index 078e987e..46cfd13b 100644 --- a/src/helper.js +++ b/src/helper.js @@ -3,7 +3,7 @@ export function createMarkup(text) { } export function transformHtml(text) { - let startHtml = {__html: text.split('

||

||

||

').join('

').split('
')}; + let startHtml = {__html: text.split('

||

').join('

').split('
')}; startHtml = startHtml.__html.filter((el) => el !== null && el !== "" || el === 0 ); diff --git a/src/images/arrowCalendar.png b/src/images/arrowCalendar.png new file mode 100644 index 0000000000000000000000000000000000000000..47d2e35769502e99635272e075a616a2d4b4391f GIT binary patch literal 2284 zcmeHJX;c$e6ds}o5)|RoAh^Vx>OoKtk?JAHA|e)%MWAVjvX@0T2@+RAT>+OQVo?D} z0NDwI0D+1csRs>+hbmSFTue+#zI6G@RT`afE#>+*sW)!k zN=whUoylZnW#`<<&C4$+EGjNxmzHtLxfPXFyz0BP_aE>d*3~}|G&D9fKYiBP*3sD| z62FlA*xmPY|KN~xST;8P>h*+t>Q}|IQq@0Mw;O^qn_L`sc^wmtNTyGAl9xRhm)#Hc z)3RhV_~O07Y@Dw**pQMv5{+_50uIJ<+kq5Mi}e@TEz}}HQfcYP-5EMIj=zG2>s6kL zs+CD?ONzkjf5fGtGV@S-BYmkMxoS8aS&zE5$s7RN6tjq3;cHj9xE__gX(NU{5{ee^%0L01tm#-g zb6qn?j5l2=s%pp3+0~%T>%-8aIaLsu70aL68hGT`AzuS1<`3G-* zDcUuoQhAiPEwl+@jpkPWYI$+Wd4;tUl^UsN2qqbFdY)l#uM> z{tvDAHO`qdb6YWA9wFTG+-FBSf0BU@5}gWxBxa1Fh&*b$^+HB?SO`R^aVWLQ*V;U! z`|Z5qp}juZ+d4cX{W=Yu-uJK4BPmA(`dp^gBGYC@ASD^W4UXB;Q4P_ z^|{!&qcP`(^S`$K%$|F+qYXz`CG>KAxyz1QS5$N)=E9ej=2||?8i!GGf{}2CV^OJP zw9bn`gIgz5@%UpYI21z>5sF*FnK>yGShmf`oX?6L#L%_|vVV!+9y17i+;Sl!DZev<+=lCpV*S16@z?t9Ng?WHGm!QSIULB&h=^x zQR8Waw2ZG(I1hbKq$&d?$nz6XHi9SYs7g6a&Qd9)Sm`P?`4J#fOPnW!MA(-$gm9(U z!7b{ogKF$k6HL?uF+fCN;*MHjgPPE;Fex5nN?;=-PpQ3+w(xKJHTYWEKqfcXe}L7M_4;5uwqIU9ha_qNf9FL_9Wk0 z5~0UrQVW{Avom#L^_Z_4d!F|gn literal 0 HcmV?d00001 diff --git a/src/images/selectArrow.png b/src/images/selectArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..b610b0e9ccb530c803533e9fa5bfde9a7e58c0bb GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eBevhY%V@L(#+un_w4F&?P$t@Gq6lNYUTB>c) zHQBO#>elEKmeUg^JeXUcRCFujW%Gf;@Bh06?ANc%EI7CI+O3Nco7XUi+oh^?u-x&q zY7^LSMRVyhu?MG?PLVYJAazTg>HS}=rEd!NdHJOZCcja9{W8q<&zAPB*B-4q!?jMR oN&7yR$E0GpLO)I3n4iy;%``;({Iz7hgM7l^>FVdQ&MBb@0E4z!C;$Ke literal 0 HcmV?d00001 diff --git a/src/pages/PartnerAddRequest/PartnerAddRequest.js b/src/pages/PartnerAddRequest/PartnerAddRequest.js new file mode 100644 index 00000000..3ea3ad4a --- /dev/null +++ b/src/pages/PartnerAddRequest/PartnerAddRequest.js @@ -0,0 +1,98 @@ +import React from 'react'; + +import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader"; +import {Footer} from "../../components/Footer/Footer"; + +import arrowDown from "../../images/selectArrow.png" + +import './partnerAddRequest.scss' + +export const PartnerAddRequest = () => { + return ( +
+ +
+

Страница добавления заявки

+
+
+
+

Данные открытой позиции

+
+

Название вакансии

+
+ +
+
+
+

Выберите специализацию

+
+
+ Разработка + +
+
+ Backend Developer + +
+
+
+
+
+

Квалификация

+
+

Выберите уровень знаний

+
+ Разработка + +
+
+
+

Введите необходимое описание

+