partner-personal-area

This commit is contained in:
Николай Полтщук 2023-02-27 16:50:32 +03:00
parent 15ed4b8c1d
commit 31cc5acbe1
18 changed files with 157 additions and 16 deletions

View File

@ -39,8 +39,6 @@ const App = () => {
<Routes>
<Route exact path='/' element={<Home/>}/>
<Route exact path='/authdev' element={<AuthForDevelopers/>}/>
<Route exact path='/auth' element={<AuthForPartners/>}/>
@ -61,6 +59,7 @@ const App = () => {
<Route exact path='profile'>
<Route index element={<Profile/>}/>
<Route exact path='employees' element={<Home/>}/>
<Route exact path='calendar' element={<ProfileCalendar/>}/>
<Route exact path='summary' element={<Summary/>}/>
<Route exact path='view' element={<ViewReport/>}/>
@ -72,7 +71,7 @@ const App = () => {
<Route exact path='bid' element={<PartnerBid/>}/>
</Route>
<Route path="*" element={<Navigate to="/" replace/>}/>
<Route path="*" element={<Navigate to="/profile" replace/>}/>
</Routes>
</Router>
</>

View File

@ -77,6 +77,7 @@ export const AuthBox = ({title, altTitle, roleChangeLink}) => {
localStorage.setItem('auth_token', res.access_token);
localStorage.setItem('id', res.id);
localStorage.setItem('cardId', res.card_id);
localStorage.setItem('role_status', res.status);
localStorage.setItem(
'access_token_expired_at',
res.access_token_expired_at

View File

@ -1,6 +1,6 @@
import React, {useEffect, useState} from 'react'
import {useSelector} from 'react-redux'
import {Link, useNavigate} from 'react-router-dom'
import {Link, Navigate, useNavigate} from 'react-router-dom'
import CalendarComponent from './CalendarComponent'
import {currentMonth} from './calendarHelper'
@ -16,6 +16,9 @@ import {urlForLocal} from "../../helper";
const Calendar = () => {
if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/>
}
const candidateForCalendar = useSelector(selectCurrentCandidate);

View File

@ -1,5 +1,5 @@
import React, {useEffect, useState} from 'react'
import {useParams, Link, useNavigate} from 'react-router-dom'
import {useParams, Link, useNavigate, Navigate} from 'react-router-dom'
import {useSelector, useDispatch} from 'react-redux'
import SkillSection from '../SkillSection/SkillSection'
@ -23,6 +23,9 @@ import {Header} from "../Header/Header";
const Candidate = () => {
if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/>
}
const {id: candidateId} = useParams();
const navigate = useNavigate();

View File

@ -0,0 +1,16 @@
import React from 'react'
import {Link} from "react-router-dom";
import './profileBreadcrumbs.scss'
export const ProfileBreadcrumbs = ({ links }) => {
return (
<div className='profileBreadcrumbs'>
{links.map((link, index) => {
return <Link key={index} to={link.link}>{link.name}</Link>
})
}
</div>
)
}

View File

@ -0,0 +1,50 @@
.profileBreadcrumbs {
display: flex;
margin-bottom: 12px;
@media (max-width: 570px) {
margin-top: 15px;
}
a {
color: #5B6871;
font-weight: 400;
font-size: 12px;
line-height: 16px;
transition: 0.3s all ease;
position: relative;
margin-right: 20px;
display: flex;
align-items: center;
@media (max-width: 525px) {
font-size: 10px;
}
@media (max-width: 455px) {
font-size: 9px;
}
&:hover {
text-decoration: none;
color: #000000;
}
&:after {
content: '';
background-image: url("../../images/BreadcrumbsArrow.png");
background-repeat: no-repeat;
width: 7px;
height:10px;
position: absolute;
right: -14px;
}
&:last-child {
margin-right: 0;
&:after {
background: none;
}
}
}
}

View File

@ -2,12 +2,13 @@ import React, { useEffect, useState } from 'react'
import {useDispatch, useSelector} from 'react-redux'
import {getReports} from '../Calendar/calendarHelper'
import { Link } from 'react-router-dom'
import {Link, Navigate} from 'react-router-dom'
import moment from "moment";
import {ProfileCalendarComponent} from "./ProfileCalendarComponent";
import {Loader} from "../Loader/Loader";
import {ProfileHeader} from "../ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import { Footer } from '../Footer/Footer'
import {urlForLocal} from "../../helper";
@ -21,6 +22,9 @@ import './profileCalendar.scss'
export const ProfileCalendar = () => {
if(localStorage.getItem('role_status') === '18') {
return <Navigate to="/profile" replace/>
}
const dispatch = useDispatch();
const profileInfo = useSelector(getProfileInfo)
const requestDates = useSelector(getRequestDates)
@ -62,6 +66,7 @@ export const ProfileCalendar = () => {
<div className='profile__calendar'>
<ProfileHeader/>
<div className='container'>
<ProfileBreadcrumbs links={[{name: 'Главная', link: '/profile'},{name: 'Ваша отчетность', link: '/profile/calendar'}]} />
<h2 className='summary__title'>Ваши отчеты</h2>
<div className='summary__info'>
<div className='summary__person'>

View File

@ -21,7 +21,7 @@ export const ProfileHeader = () => {
const userRole = useSelector(getRole);
const profileInfo = useSelector(getProfileInfo);
const [user] = useState('partner')
const [user] = useState(localStorage.getItem('role_status') === '18' ? 'partner' : 'developer')
const [navInfo] = useState({
developer: [
{

View File

@ -1,15 +1,15 @@
import React, {useState, useEffect} from 'react'
import {useSelector} from 'react-redux'
import {Link, useNavigate} from 'react-router-dom'
import {Link, Navigate, useNavigate} from 'react-router-dom'
import DatePicker, { registerLocale } from "react-datepicker"
import {getCorrectDate, getCreatedDate} from '../Calendar/calendarHelper'
import ru from "date-fns/locale/ru"
registerLocale("ru", ru);
import {Loader} from '../Loader/Loader'
import {currentMonthAndDay} from '../Calendar/calendarHelper'
import {Footer} from "../Footer/Footer";
import {ProfileHeader} from "../ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {apiRequest} from "../../api/request";
@ -25,6 +25,9 @@ import './reportForm.scss'
import "react-datepicker/dist/react-datepicker.css";
const ReportForm = () => {
if(localStorage.getItem('role_status') === '18') {
return <Navigate to="/profile" replace/>
}
const navigate= useNavigate();
const reportDate = useSelector(getReportDate);
@ -96,6 +99,10 @@ const ReportForm = () => {
<section className='report-form'>
<ProfileHeader/>
<div className='container'>
<ProfileBreadcrumbs links={[{name: 'Главная', link: '/profile'},
{name: 'Ваша отчетность', link: '/profile/calendar'},
{name: 'Страница добавления нового отчета', link: '/report'}]}
/>
<h2 className='summary__title'>Ваши отчеты - <span>добавить отчет</span></h2>
<div>
<div className='report__head'>

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

View File

@ -1,6 +1,6 @@
import React, {useEffect} from 'react'
import {useDispatch, useSelector} from 'react-redux'
import {useParams, useNavigate} from 'react-router-dom'
import {useParams, useNavigate, Navigate} from 'react-router-dom'
import SVG from 'react-inlinesvg'
import Form from '../../components/Form/Form'
@ -22,6 +22,9 @@ import {urlForLocal} from "../../helper";
import './formPage.scss'
const FormPage = () => {
if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/>
}
const params = useParams();
const navigate = useNavigate();
const dispatch = useDispatch();

View File

@ -9,9 +9,13 @@ import {profiles, tags} from '../../redux/outstaffingSlice'
import {Header} from "../../components/Header/Header";
import {apiRequest} from "../../api/request";
import {Navigate} from "react-router-dom";
const Home = () => {
if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/>
}
const [isLoadingMore, setIsLoadingMore] = useState(false);
const [index, setIndex] = useState(4);

View File

@ -1,17 +1,28 @@
import React from 'react';
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from "../../components/Footer/Footer";
import arrowDown from "../../images/selectArrow.png"
import './partnerAddRequest.scss'
import {Navigate} from "react-router-dom";
export const PartnerAddRequest = () => {
if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/>
}
return (
<div className='partnerAddRequest'>
<ProfileHeader />
<div className='container'>
<ProfileBreadcrumbs links={[
{name: 'Главная', link: '/profile'},
{name: 'Запросы и открытые позиции', link: '/profile/requests'},
{name: 'Создание новой заявки', link: '/profile/add-request'}
]}
/>
<h2 className='partnerAddRequest__title'>Страница добавления заявки</h2>
<div className='partnerAddRequest__section'>
<div className='partnerAddRequest__form'>

View File

@ -1,7 +1,8 @@
import React, {useState} from 'react';
import {Link} from "react-router-dom";
import {Link, Navigate} from "react-router-dom";
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from "../../components/Footer/Footer";
import arrowSwitchDate from "../../images/arrowViewReport.png";
@ -12,6 +13,9 @@ import personImg from "../../images/mokPerson.png"
import './partnerBid.scss'
export const PartnerBid = () => {
if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/>
}
const [mokPersons] = useState([
{
name: 'Дмитрий, PHP Back end - разработчик, Middle',
@ -33,6 +37,12 @@ export const PartnerBid = () => {
<div className='partnerBid'>
<ProfileHeader />
<div className='container'>
<ProfileBreadcrumbs links={[
{name: 'Главная', link: '/profile'},
{name: 'Запросы и открытые позиции', link: '/profile/requests'},
{name: 'Просмотр заявки - PHP разработчик', link: '/profile/bid'}
]}
/>
<h2 className='partnerBid__title'>Страница заявки </h2>
<div className='partnerBid__qualification'>
<h3>PHP разработчик</h3>
@ -97,8 +107,8 @@ export const PartnerBid = () => {
<p>Подходящие сотрудники по запросу</p>
</div>
<div className='partnerBid__suitable__persons'>
{mokPersons.map((person) => {
return <div className='partnerBid__suitable__person'>
{mokPersons.map((person, index) => {
return <div key={index} className='partnerBid__suitable__person'>
<img src={person.img} alt='avatar' />
<p>{person.name}</p>
<Link className='partnerBid__suitable__person__more' to={person.link}>

View File

@ -1,12 +1,16 @@
import React, {useState} from 'react';
import {Link} from "react-router-dom";
import {Link, Navigate} from "react-router-dom";
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from "../../components/Footer/Footer";
import './partnerRequests.scss'
export const PartnerRequests = () => {
if(localStorage.getItem('role_status') !== '18') {
return <Navigate to="/profile" replace/>
}
const [items] = useState([
{
name: 'PHP разработчик ',
@ -29,6 +33,11 @@ export const PartnerRequests = () => {
<div className='partnerRequests'>
<ProfileHeader />
<div className='container'>
<ProfileBreadcrumbs links={[
{name: 'Главная', link: '/profile'},
{name: 'Запросы и открытые позиции', link: '/profile/requests'}
]}
/>
<h2 className='partnerRequests__title'>Запросы</h2>
<div className='partnerRequests__section'>
<div className='partnerRequests__section__items'>

View File

@ -3,6 +3,7 @@ import {useSelector} from "react-redux";
import {Link} from "react-router-dom";
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from "../../components/Footer/Footer";
import {getProfileInfo} from "../../redux/outstaffingSlice";
@ -22,7 +23,7 @@ import './profile.scss'
export const Profile = () => {
const profileInfo = useSelector(getProfileInfo);
const [user] = useState('partner')
const [user] = useState(localStorage.getItem('role_status') === '18' ? 'partner' : 'developer')
const [profileItemsInfo] = useState({
developer: [
{
@ -94,6 +95,7 @@ export const Profile = () => {
<div className='profile'>
<ProfileHeader/>
<div className='container'>
<ProfileBreadcrumbs links={[{name: 'Главная', link: '/profile'}]} />
<h2 className='profile__title'>
{user === 'developer' ?
<span><p>Добрый день,&nbsp;</p>{profileInfo.fio}</span>

View File

@ -2,6 +2,7 @@ import React, {useEffect, useState} from 'react';
import {useSelector} from "react-redux";
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {getProfileInfo} from "../../redux/outstaffingSlice";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from '../../components/Footer/Footer'
import {transformHtml, urlForLocal} from "../../helper";
@ -11,8 +12,12 @@ import gitImgItem from "../../images/gitItemImg.png"
import './summary.scss'
import {apiRequest} from "../../api/request";
import {Navigate} from "react-router-dom";
export const Summary = () => {
if(localStorage.getItem('role_status') === '18') {
return <Navigate to="/profile" replace/>
}
const profileInfo = useSelector(getProfileInfo);
const [openGit, setOpenGit] = useState(false);
const [gitInfo, setGitInfo] = useState([]);
@ -26,6 +31,11 @@ export const Summary = () => {
<ProfileHeader/>
<div className='container'>
<div className='summary__content'>
<ProfileBreadcrumbs links={[
{name: 'Главная', link: '/profile'},
{name: 'Данные и резюме', link: '/profile/summary'}
]}
/>
<h2 className='summary__title'>Ваше резюме {openGit && <span>- Git</span>}</h2>
{openGit && <div className='summary__back' onClick={() => setOpenGit(false)}>
<img src={arrow} alt='arrow'/>

View File

@ -1,11 +1,12 @@
import React, {useEffect, useState} from 'react'
import {Link} from "react-router-dom";
import {Link, Navigate} from "react-router-dom";
import {useSelector} from "react-redux";
import {getReportDate} from "../../redux/reportSlice";
import {Loader} from "../../components/Loader/Loader"
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
import {Footer} from "../../components/Footer/Footer";
import arrow from "../../images/right-arrow.png";
@ -16,6 +17,9 @@ import {getCorrectDate, getCreatedDate} from '../../components/Calendar/calendar
import './viewReport.scss'
export const ViewReport = () => {
if(localStorage.getItem('role_status') === '18') {
return <Navigate to="/profile" replace/>
}
const reportDate = useSelector(getReportDate);
const [taskText, setTaskText] = useState([]);
@ -76,6 +80,10 @@ export const ViewReport = () => {
<ProfileHeader/>
<div className='container'>
<div className='viewReport__info'>
<ProfileBreadcrumbs links={[{name: 'Главная', link: '/profile'},
{name: 'Ваша отчетность', link: '/profile/calendar'},
{name: 'Просмотр отчета за день', link: '/profile/view'}]}
/>
<h2 className='viewReport__title'>Ваши отчеты - <span>просмотр отчета за день</span></h2>
<Link className='viewReport__back' to={`/profile/calendar`}>
<img src={arrow} alt='arrow'/><p>Вернуться</p>