From 214d309ffb70e464a9eebb7eaf045d9424851375 Mon Sep 17 00:00:00 2001 From: M1kola Date: Fri, 9 Aug 2024 21:09:02 +0300 Subject: [PATCH] partner categories fixes --- .../PartnerСategories/PartnerСategories.jsx | 116 ++++++++++-------- 1 file changed, 62 insertions(+), 54 deletions(-) diff --git a/src/pages/PartnerСategories/PartnerСategories.jsx b/src/pages/PartnerСategories/PartnerСategories.jsx index 20398412..e8d08dd9 100644 --- a/src/pages/PartnerСategories/PartnerСategories.jsx +++ b/src/pages/PartnerСategories/PartnerСategories.jsx @@ -17,8 +17,8 @@ import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadc import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; import rightArrow from "assets/icons/arrows/arrowRight.svg"; +import folder from "assets/icons/folder.svg"; import report from "assets/icons/report.svg"; -import folder from "assets/icons/folder.svg" import "./partnerСategories.scss"; @@ -65,8 +65,7 @@ export const PartnerCategories = () => {

{item?.employee.fio}

- {item?.employee.level_title} /{" "} - {item?.employee.position.name} + {item?.employee.level_title} / {item?.employee.position.name} ) @@ -77,7 +76,12 @@ export const PartnerCategories = () => {
{item?.employee.projects.length ? ( item.employee.projects.map((project) => { - return
folder

{project.project.name}

+ return ( +
+ folder{" "} +

{project.project.name}

+
+ ); }) ) : ( Нет проектов @@ -131,9 +135,9 @@ export const PartnerCategories = () => { useEffect(() => { setLoader(true); apiRequest("/project/my-employee").then((el) => { - setNodes(el.managerEmployees) - setInitialNodes(el.managerEmployees) - setLoader(false) + setNodes(el.managerEmployees); + setInitialNodes(el.managerEmployees); + setLoader(false); }); }, []); @@ -201,8 +205,7 @@ export const PartnerCategories = () => { setActiveTab(tab.name); setNodes( initialNodes.filter( - (item) => - item.employee.position.id === tab.value + (item) => item.employee.position.id === tab.value ) ); }} @@ -225,56 +228,61 @@ export const PartnerCategories = () => { sort={sort} pagination={pagination} /> - {Boolean(nodes.length) && pagination.state.getPages(data.nodes).length > 1 && -
- - - {pagination.state.getPages(data.nodes).map((_, index) => ( + {Boolean(nodes.length) && + pagination.state.getPages(data.nodes).length > 1 && ( +
- ))} - - -
- } + + {pagination.state + .getPages(data.nodes) + .map((_, index) => ( + + ))} + + +
+ )} ) : (