2023-02-21 19:05:04 +03:00
|
|
|
|
import React, {useState} from 'react';
|
2023-01-13 13:02:48 +03:00
|
|
|
|
import {useSelector} from "react-redux";
|
|
|
|
|
import {Link} from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader";
|
2023-02-27 16:50:32 +03:00
|
|
|
|
import {ProfileBreadcrumbs} from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs"
|
2023-01-13 13:02:48 +03:00
|
|
|
|
import {Footer} from "../../components/Footer/Footer";
|
|
|
|
|
|
|
|
|
|
import {getProfileInfo} from "../../redux/outstaffingSlice";
|
|
|
|
|
|
2023-01-20 16:20:06 +03:00
|
|
|
|
import {urlForLocal} from "../../helper";
|
|
|
|
|
|
2023-01-13 13:02:48 +03:00
|
|
|
|
import reportsIcon from "../../images/reports.png"
|
|
|
|
|
import summaryIcon from "../../images/summaryIcon.png"
|
|
|
|
|
import timerIcon from "../../images/timerIcon.png"
|
|
|
|
|
import paymentIcon from "../../images/paymentIcon.png"
|
|
|
|
|
import settingIcon from "../../images/settingIcon.png"
|
2023-01-20 16:20:06 +03:00
|
|
|
|
|
2023-01-13 13:02:48 +03:00
|
|
|
|
import rightArrow from "../../images/arrowRight.png"
|
|
|
|
|
|
|
|
|
|
import './profile.scss'
|
|
|
|
|
|
|
|
|
|
export const Profile = () => {
|
|
|
|
|
|
|
|
|
|
const profileInfo = useSelector(getProfileInfo);
|
2023-02-27 16:50:32 +03:00
|
|
|
|
const [user] = useState(localStorage.getItem('role_status') === '18' ? 'partner' : 'developer')
|
2023-02-21 19:05:04 +03:00
|
|
|
|
const [profileItemsInfo] = useState({
|
|
|
|
|
developer: [
|
|
|
|
|
{
|
|
|
|
|
path: '/calendar',
|
|
|
|
|
img: reportsIcon,
|
|
|
|
|
title: 'Ваша отчетность',
|
|
|
|
|
description: '<span></span>Отработанных в этом месяце часов'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/summary',
|
|
|
|
|
img: summaryIcon,
|
|
|
|
|
title: 'Данные и резюме',
|
|
|
|
|
description: 'Ваше резюме<br/><span>заполнено</span>'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/tracker',
|
|
|
|
|
img: timerIcon,
|
|
|
|
|
title: 'Трекер времени',
|
|
|
|
|
description: 'Сколько времени занимает<br/> выполнение задач'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/payouts',
|
|
|
|
|
img: paymentIcon,
|
|
|
|
|
title: 'Выплаты',
|
|
|
|
|
description: 'У вас <span>подтвержден</span><br/> статус самозанятого'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/settings',
|
|
|
|
|
img: settingIcon,
|
|
|
|
|
title: 'Настройки аккаунта',
|
|
|
|
|
description: 'Перейдите чтобы начать<br/> редактирование'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
partner: [
|
|
|
|
|
{
|
|
|
|
|
path: '/requests',
|
|
|
|
|
img: reportsIcon,
|
|
|
|
|
title: 'Запросы и открытые позиции',
|
|
|
|
|
description: '<span>У вас 2 вакансии<br/></span>открытые от лица компании'
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-16 15:10:53 +03:00
|
|
|
|
path: '/employees',
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: summaryIcon,
|
|
|
|
|
title: 'Данные персонала',
|
|
|
|
|
description: 'Наши специалисты <br/><span>уже работающие у вас</span>'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/tracker',
|
|
|
|
|
img: timerIcon,
|
|
|
|
|
title: 'Трекер времени',
|
|
|
|
|
description: 'Контроль времени и<br/> выполнение задач'
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-20 14:00:10 +03:00
|
|
|
|
path: '/treaties',
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: paymentIcon,
|
|
|
|
|
title: 'Договора и отчетность',
|
|
|
|
|
description: 'Ключевые условия<br/> договора'
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-20 14:40:24 +03:00
|
|
|
|
path: '/settings',
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: settingIcon,
|
|
|
|
|
title: 'Настройки аккаунта',
|
|
|
|
|
description: 'Перейдите чтобы начать<br/> редактирование'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
})
|
2023-01-13 13:02:48 +03:00
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className='profile'>
|
|
|
|
|
<ProfileHeader/>
|
|
|
|
|
<div className='container'>
|
2023-02-27 16:50:32 +03:00
|
|
|
|
<ProfileBreadcrumbs links={[{name: 'Главная', link: '/profile'}]} />
|
2023-02-21 19:05:04 +03:00
|
|
|
|
<h2 className='profile__title'>
|
|
|
|
|
{user === 'developer' ?
|
|
|
|
|
<span><p>Добрый день, </p>{profileInfo.fio}</span>
|
|
|
|
|
:
|
|
|
|
|
'ООО НДВ Консалтинг'
|
|
|
|
|
}
|
|
|
|
|
</h2>
|
2023-01-13 13:02:48 +03:00
|
|
|
|
<div className='summary__info'>
|
|
|
|
|
<div className='summary__person'>
|
2023-01-20 16:20:06 +03:00
|
|
|
|
<img src={profileInfo.photo ? urlForLocal(profileInfo.photo) : ''} className='summary__avatar' alt='avatar'/>
|
2023-02-21 19:05:04 +03:00
|
|
|
|
<p className='summary__name'>
|
|
|
|
|
{user === 'developer' ?
|
|
|
|
|
<span>{profileInfo.fio}, {profileInfo.specification} разработчик</span>
|
|
|
|
|
:
|
|
|
|
|
'ООО НДВ Консалтинг'
|
|
|
|
|
}
|
|
|
|
|
</p>
|
2023-01-13 13:02:48 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='profile__items'>
|
2023-02-21 19:05:04 +03:00
|
|
|
|
{
|
|
|
|
|
profileItemsInfo[user].map((item, index) => {
|
|
|
|
|
return <Link key={index} to={`/profile${item.path}`} className='item'>
|
|
|
|
|
<div className='item__about'>
|
|
|
|
|
<img src={item.img} alt='itemImg'/>
|
|
|
|
|
<h3>{item.title}</h3>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='item__info'>
|
|
|
|
|
<p dangerouslySetInnerHTML={{__html: item.description}}></p>
|
|
|
|
|
<div className='item__infoLink'>
|
|
|
|
|
<img src={rightArrow} alt='arrow'/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
})
|
|
|
|
|
}
|
2023-01-13 13:02:48 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Footer/>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
};
|