2023-05-25 16:42:37 +03:00
|
|
|
|
import React, { useState } from "react";
|
|
|
|
|
import { useSelector } from "react-redux";
|
2023-01-13 13:02:48 +03:00
|
|
|
|
|
2023-05-25 16:42:37 +03:00
|
|
|
|
import { getProfileInfo } from "../../redux/outstaffingSlice";
|
2023-05-30 10:10:34 +03:00
|
|
|
|
import { urlForLocal } from "../../utils/helper";
|
2023-01-13 13:02:48 +03:00
|
|
|
|
|
2023-05-25 16:42:37 +03:00
|
|
|
|
import { ProfileHeader } from "../../components/ProfileHeader/ProfileHeader";
|
|
|
|
|
import { ProfileBreadcrumbs } from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs";
|
|
|
|
|
import { Footer } from "../../components/Footer/Footer";
|
|
|
|
|
import { CardControl } from "../../components/CardControl/CardControl";
|
|
|
|
|
import { Navigation } from "../../components/Navigation/Navigation";
|
2023-01-13 13:02:48 +03:00
|
|
|
|
|
2023-05-25 16:42:37 +03:00
|
|
|
|
import reportsIcon from "../../assets/images/reports.png";
|
|
|
|
|
import summaryIcon from "../../assets/icons/summaryIcon.png";
|
|
|
|
|
import timerIcon from "../../assets/icons/timerIcon.png";
|
|
|
|
|
import paymentIcon from "../../assets/icons/paymentIcon.png";
|
|
|
|
|
import settingIcon from "../../assets/icons/settingIcon.png";
|
|
|
|
|
import avatarMok from "../../assets/images/avatarMok.png";
|
2023-01-20 16:20:06 +03:00
|
|
|
|
|
2023-05-25 16:42:37 +03:00
|
|
|
|
import "./profile.scss";
|
2023-01-13 13:02:48 +03:00
|
|
|
|
|
|
|
|
|
export const Profile = () => {
|
|
|
|
|
const profileInfo = useSelector(getProfileInfo);
|
2023-05-25 16:42:37 +03:00
|
|
|
|
const [user] = useState(
|
|
|
|
|
localStorage.getItem("role_status") === "18" ? "partner" : "developer"
|
|
|
|
|
);
|
2023-02-21 19:05:04 +03:00
|
|
|
|
const [profileItemsInfo] = useState({
|
|
|
|
|
developer: [
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/calendar",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: reportsIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Ваша отчетность",
|
|
|
|
|
description: "<span></span>Отработанных в этом месяце часов",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/summary",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: summaryIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Данные и резюме",
|
|
|
|
|
description: "Ваше резюме<br/><span>заполнено</span>",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/tracker",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: timerIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Трекер времени",
|
|
|
|
|
description: "Сколько времени занимает<br/> выполнение задач",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/payouts",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: paymentIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Выплаты",
|
|
|
|
|
description: "У вас <span>подтвержден</span><br/> статус самозанятого",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/settings",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: settingIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Настройки аккаунта",
|
|
|
|
|
description: "Перейдите чтобы начать<br/> редактирование",
|
|
|
|
|
},
|
2023-02-21 19:05:04 +03:00
|
|
|
|
],
|
|
|
|
|
partner: [
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/requests",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: reportsIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Запросы и открытые позиции",
|
|
|
|
|
description:
|
|
|
|
|
"<span>У вас 2 вакансии<br/></span>открытые от лица компании",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/categories",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: summaryIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Данные персонала",
|
|
|
|
|
description: "Наши специалисты <br/><span>уже работающие у вас</span>",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/tracker",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: timerIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Трекер времени",
|
|
|
|
|
description: "Контроль времени и<br/> выполнение задач",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/treaties",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: paymentIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Договора и отчетность",
|
|
|
|
|
description: "Ключевые условия<br/> договора",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-25 16:42:37 +03:00
|
|
|
|
path: "profile/settings",
|
2023-02-21 19:05:04 +03:00
|
|
|
|
img: settingIcon,
|
2023-05-25 16:42:37 +03:00
|
|
|
|
title: "Настройки аккаунта",
|
|
|
|
|
description: "Перейдите чтобы начать<br/> редактирование",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
});
|
2023-01-13 13:02:48 +03:00
|
|
|
|
|
|
|
|
|
return (
|
2023-05-25 16:42:37 +03:00
|
|
|
|
<div className="profile">
|
|
|
|
|
<ProfileHeader />
|
|
|
|
|
<Navigation />
|
|
|
|
|
<div className="container">
|
|
|
|
|
<ProfileBreadcrumbs links={[{ name: "Главная", link: "/profile" }]} />
|
|
|
|
|
<h2 className="profile__title">
|
|
|
|
|
{user === "developer" ? (
|
|
|
|
|
<span>
|
|
|
|
|
<p>Добрый день, </p>
|
|
|
|
|
{profileInfo.fio}
|
|
|
|
|
</span>
|
|
|
|
|
) : (
|
|
|
|
|
"ООО НДВ Консалтинг"
|
|
|
|
|
)}
|
|
|
|
|
</h2>
|
|
|
|
|
<div className="summary__info">
|
|
|
|
|
<div className="summary__person">
|
|
|
|
|
<img
|
|
|
|
|
src={
|
|
|
|
|
profileInfo.photo ? urlForLocal(profileInfo.photo) : avatarMok
|
|
|
|
|
}
|
|
|
|
|
className="summary__avatar"
|
|
|
|
|
alt="avatar"
|
|
|
|
|
/>
|
|
|
|
|
<p className="summary__name">
|
|
|
|
|
{user === "developer" ? (
|
|
|
|
|
<span>
|
|
|
|
|
{profileInfo.fio}, {profileInfo.specification} разработчик
|
|
|
|
|
</span>
|
|
|
|
|
) : (
|
|
|
|
|
"ООО НДВ Консалтинг"
|
|
|
|
|
)}
|
|
|
|
|
</p>
|
2023-01-13 13:02:48 +03:00
|
|
|
|
</div>
|
2023-05-25 16:42:37 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div className="profile__items">
|
|
|
|
|
{profileItemsInfo[user].map((item, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<CardControl
|
2023-04-19 22:42:46 +03:00
|
|
|
|
description={item.description}
|
2023-04-19 20:22:06 +03:00
|
|
|
|
img={item.img}
|
|
|
|
|
path={item.path}
|
|
|
|
|
title={item.title}
|
|
|
|
|
key={index}
|
2023-05-25 16:42:37 +03:00
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2023-01-13 13:02:48 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-05-25 16:42:37 +03:00
|
|
|
|
<Footer />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2023-01-13 13:02:48 +03:00
|
|
|
|
};
|