This commit is contained in:
Никита Губарь 2024-02-29 13:14:53 +03:00
commit d9781b6396
17 changed files with 256 additions and 173 deletions

View File

@ -6,7 +6,7 @@ import {
modalToggle modalToggle
} from "@redux/projectsTrackerSlice"; } from "@redux/projectsTrackerSlice";
import { caseOfNum, urlForLocal } from "@utils/helper"; import { caseOfNum, removeLast, urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request"; import { apiRequest } from "@api/request";
@ -67,7 +67,7 @@ const ListEmployees = ({
} }
alt="avatar" alt="avatar"
/> />
<span>{person.user.fio}</span> <span>{removeLast(person.user.fio)}</span>
<img <img
className="delete" className="delete"
src={close} src={close}

View File

@ -11,10 +11,10 @@ import { getProfileInfo } from "@redux/outstaffingSlice";
import { setProjectBoardFetch } from "@redux/projectsTrackerSlice"; import { setProjectBoardFetch } from "@redux/projectsTrackerSlice";
import { import {
backendImg,
caseOfNum, caseOfNum,
getCorrectRequestDate, getCorrectRequestDate,
getToken, getToken,
removeLast,
urlForLocal urlForLocal
} from "@utils/helper"; } from "@utils/helper";
@ -771,12 +771,12 @@ export const ModalTiсket = ({
<div className="workers_box task__info"> <div className="workers_box task__info">
<span className="exit" onClick={() => closeModal()}></span> <span className="exit" onClick={() => closeModal()}></span>
<h5>Создатель: </h5> <h5>Создатель: </h5>
<p className="workers__creator">{task.user?.fio}</p> <p className="workers__creator">{removeLast(task.user?.fio)}</p>
{executor ? ( {executor ? (
<> <>
<h5>Исполнитель: </h5> <h5>Исполнитель: </h5>
<div className="executor"> <div className="executor">
<p>{executor.fio}</p> <p>{removeLast(executor.fio)}</p>
<img <img
src={ src={
executor?.avatar executor?.avatar
@ -815,7 +815,7 @@ export const ModalTiсket = ({
key={person.user_id} key={person.user_id}
onClick={() => taskExecutor(person)} onClick={() => taskExecutor(person)}
> >
<span>{person.user.fio}</span> <span>{removeLast(person.user.fio)}</span>
<img <img
src={ src={
person.user?.avatar person.user?.avatar
@ -838,7 +838,7 @@ export const ModalTiсket = ({
{members.map((member) => { {members.map((member) => {
return ( return (
<div className="worker" key={member.user_id}> <div className="worker" key={member.user_id}>
<p>{member.fio}</p> <p>{removeLast(member.fio)}</p>
<img <img
src={ src={
member?.avatar member?.avatar
@ -881,7 +881,7 @@ export const ModalTiсket = ({
key={person.user_id} key={person.user_id}
onClick={() => addMember(person)} onClick={() => addMember(person)}
> >
<span>{person.user.fio}</span> <span>{removeLast(person.user.fio)}</span>
<img <img
src={ src={
person.user?.avatar person.user?.avatar
@ -907,7 +907,7 @@ export const ModalTiсket = ({
className="dead-line__container" className="dead-line__container"
onClick={() => setDatePickerOpen(!datePickerOpen)} onClick={() => setDatePickerOpen(!datePickerOpen)}
> >
<img src={calendarIcon} alt="calendar" /> <p></p>
<span> <span>
{deadLine ? getCorrectDate(deadLine) : "Срок исполнения"} {deadLine ? getCorrectDate(deadLine) : "Срок исполнения"}
</span> </span>

View File

@ -950,7 +950,7 @@ export const TicketFullScreen = () => {
className="dead-line__container" className="dead-line__container"
onClick={() => setDatePickerOpen(!datePickerOpen)} onClick={() => setDatePickerOpen(!datePickerOpen)}
> >
<img src={calendarIcon} alt="calendar" /> <p></p>
<span> <span>
{deadLine {deadLine
? getCorrectDate(deadLine) ? getCorrectDate(deadLine)

View File

@ -23,7 +23,7 @@ import {
} from "@redux/projectsTrackerSlice"; } from "@redux/projectsTrackerSlice";
import { getCorrectDate } from "@utils/calendarHelper"; import { getCorrectDate } from "@utils/calendarHelper";
import { getCorrectRequestDate, urlForLocal } from "@utils/helper"; import { getCorrectRequestDate, removeLast, urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request"; import { apiRequest } from "@api/request";
@ -488,7 +488,7 @@ export const TrackerModal = ({
> >
<p> <p>
{selectedWorker {selectedWorker
? selectedWorker.employee.fio ? removeLast(selectedWorker.employee.fio)
: "Выберите пользователя"} : "Выберите пользователя"}
</p> </p>
<img className="arrow" src={arrowDown} alt="arrow" /> <img className="arrow" src={arrowDown} alt="arrow" />
@ -507,7 +507,7 @@ export const TrackerModal = ({
setSelectedWorker(worker); setSelectedWorker(worker);
}} }}
> >
<span>{worker.employee.fio}</span> <span>{removeLast(worker.employee.fio)}</span>
<img <img
src={urlForLocal(worker.employee.avatar)} src={urlForLocal(worker.employee.avatar)}
alt="avatar" alt="avatar"
@ -562,7 +562,6 @@ export const TrackerModal = ({
</div> </div>
<div className="create-task-body"> <div className="create-task-body">
<div className="create-task-body__left"> <div className="create-task-body__left">
<h4>Введите название и описание задачи</h4>
<div className="input-container"> <div className="input-container">
<input <input
maxLength="100" maxLength="100"
@ -740,7 +739,7 @@ export const TrackerModal = ({
} }
alt="avatar" alt="avatar"
/> />
<span>{person.user.fio}</span> <span>{removeLast(person.user.fio)}</span>
</div> </div>
); );
}) })
@ -751,7 +750,7 @@ export const TrackerModal = ({
)} )}
</div> </div>
<div className="create-task-body__right__dead-line"> <div className="create-task-body__right__dead-line">
<img src={calendarImg} alt="calendar" /> <p></p>
<p onClick={() => setDatePickerOpen(!datePickerOpen)}> <p onClick={() => setDatePickerOpen(!datePickerOpen)}>
{deadLineDate {deadLineDate
? getCorrectDate(deadLineDate) ? getCorrectDate(deadLineDate)
@ -775,7 +774,7 @@ export const TrackerModal = ({
<Loader style={"green"} /> <Loader style={"green"} />
) : ( ) : (
<BaseButton styles={"button-add"} onClick={createTicket}> <BaseButton styles={"button-add"} onClick={createTicket}>
Создать Создать задачу
</BaseButton> </BaseButton>
)} )}
</div> </div>

View File

@ -263,7 +263,7 @@
position: absolute; position: absolute;
width: 100%; width: 100%;
padding: 9.5px 12px; padding: 9.5px 12px;
top: 48px; top: 45px;
left: 0; left: 0;
background: white; background: white;
border-radius: 5px; border-radius: 5px;
@ -338,7 +338,7 @@
} }
.create-task-body { .create-task-body {
padding: 15px 20px; padding: 15px 30px;
display: flex; display: flex;
column-gap: 20px; column-gap: 20px;
@ -374,8 +374,8 @@
} }
.ck-editor__editable.ck-rounded-corners { .ck-editor__editable.ck-rounded-corners {
min-height: 150px; min-height: 180px;
max-height: 150px; max-height: 180px;
} }
} }
@ -384,6 +384,7 @@
flex-direction: column; flex-direction: column;
align-items: start; align-items: start;
justify-content: end; justify-content: end;
row-gap: 10px;
&__owner { &__owner {
display: flex; display: flex;
@ -715,6 +716,11 @@
} }
} }
} }
.button-add {
margin: 0 30px;
align-self: flex-end;
}
} }
.name-project { .name-project {

View File

@ -97,7 +97,7 @@ export const Navigation = () => {
<div className="profile-header__personal-info"> <div className="profile-header__personal-info">
<h3 className="profile-header__personal-info-name"> <h3 className="profile-header__personal-info-name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username} {profileInfo?.fio || profileInfo?.username}
</h3> </h3>
<NavLink end to={"/profile"}> <NavLink end to={"/profile"}>
<img <img

View File

@ -95,7 +95,7 @@ export const ProfileCalendar = () => {
alt="avatar" alt="avatar"
/> />
<p className="summary__name"> <p className="summary__name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "} {profileInfo?.fio || profileInfo?.username},{" "}
{profileInfo.specification} разработчик {profileInfo.specification} разработчик
</p> </p>
</div> </div>

View File

@ -286,15 +286,15 @@ export const ProfileCalendarComponent = React.memo(
? `${getCorrectDate(startDate)} - ${getCorrectDate(endDate)}` ? `${getCorrectDate(startDate)} - ${getCorrectDate(endDate)}`
: `${getCorrectDate(endDate)} - ${getCorrectDate(startDate)}` : `${getCorrectDate(endDate)} - ${getCorrectDate(startDate)}`
: activePeriod : activePeriod
? "Выберите диапазон на календаре" ? "Выберите диапазон на календаре"
: "Выбрать диапазон"} : "Выбрать диапазон"}
</span> </span>
<span> <span>
{totalRangeHours {totalRangeHours
? `${totalRangeHours} ${hourOfNum(totalRangeHours)}` ? `${totalRangeHours} ${hourOfNum(totalRangeHours)}`
: endDate : endDate
? "0 часов" ? "0 часов"
: ""} : ""}
</span> </span>
{endDate && ( {endDate && (
<BaseButton <BaseButton

View File

@ -150,7 +150,7 @@ export const ProfileHeader = () => {
<nav className="auth-body__navigation"> <nav className="auth-body__navigation">
<div className="profile-header__personal-info"> <div className="profile-header__personal-info">
<h3 className="profile-header__personal-info-name"> <h3 className="profile-header__personal-info-name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username} {profileInfo?.fio || profileInfo?.username}
</h3> </h3>
<NavLink end to={"/profile"}> <NavLink end to={"/profile"}>
<img <img

View File

@ -566,7 +566,6 @@ $maxWidthContainer: 1123;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
flex-wrap: wrap;
@media (max-width: 600px) { @media (max-width: 600px) {
display: block; display: block;
} }

View File

@ -225,7 +225,7 @@
&__report, &__report,
&__login { &__login {
width: 60%; width: 100%;
} }
&__report { &__report {

View File

@ -103,12 +103,12 @@ export const Profile = () => {
{user === "developer" ? ( {user === "developer" ? (
<span> <span>
<p>Добрый день,&nbsp;</p> <p>Добрый день,&nbsp;</p>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username} {profileInfo?.fio || profileInfo?.username}
</span> </span>
) : ( ) : (
<span> <span>
<p>Добрый день,&nbsp;</p> <p>Добрый день,&nbsp;</p>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username} {profileInfo?.fio || profileInfo?.username}
</span> </span>
)} )}
</h2> </h2>
@ -124,13 +124,11 @@ export const Profile = () => {
<p className="summary__name"> <p className="summary__name">
{user === "developer" ? ( {user === "developer" ? (
<span> <span>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "} {profileInfo?.fio || profileInfo?.username},{" "}
{profileInfo?.specification} разработчик {profileInfo?.specification} разработчик
</span> </span>
) : ( ) : (
<span> <span>{profileInfo?.fio || profileInfo?.username}</span>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}
</span>
)} )}
</p> </p>
</div> </div>

View File

@ -23,8 +23,7 @@ import {
setToggleTab setToggleTab
} from "@redux/projectsTrackerSlice"; } from "@redux/projectsTrackerSlice";
import { urlForLocal } from "@utils/helper"; import { removeLast, urlForLocal } from "@utils/helper";
import { caseOfNum } from "@utils/helper";
import { apiRequest } from "@api/request"; import { apiRequest } from "@api/request";
@ -44,7 +43,6 @@ import TrackerSelectColumn from "@components/TrackerSelectColumn/TrackerSelectCo
import arrow from "assets/icons/arrows/arrowCalendar.png"; import arrow from "assets/icons/arrows/arrowCalendar.png";
import arrowDown from "assets/icons/arrows/selectArrow.png"; import arrowDown from "assets/icons/arrows/selectArrow.png";
import calendarIcon from "assets/icons/calendar.svg";
import category from "assets/icons/category.svg"; import category from "assets/icons/category.svg";
import close from "assets/icons/close.png"; import close from "assets/icons/close.png";
import commentsBoard from "assets/icons/commentsBoard.svg"; import commentsBoard from "assets/icons/commentsBoard.svg";
@ -64,7 +62,6 @@ export const ProjectTracker = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const projectId = useParams(); const projectId = useParams();
const currentDate = new Date().getFullYear();
const [openColumnSelect, setOpenColumnSelect] = useState({}); const [openColumnSelect, setOpenColumnSelect] = useState({});
const [selectedTab, setSelectedTab] = useState(0); const [selectedTab, setSelectedTab] = useState(0);
const [priorityTask, setPriorityTask] = useState(0); const [priorityTask, setPriorityTask] = useState(0);
@ -610,7 +607,7 @@ export const ProjectTracker = () => {
key={user.user_id} key={user.user_id}
onClick={() => executorFilter(user)} onClick={() => executorFilter(user)}
> >
<p>{user.user?.fio}</p> <p>{removeLast(user.user?.fio)}</p>
<img <img
src={ src={
user.user?.avatar user.user?.avatar
@ -908,10 +905,7 @@ export const ProjectTracker = () => {
} }
}} }}
> >
<p <p className="task__board__item__title">
className="task__board__item__title"
style={{ color: titleColor }}
>
{task.title} {task.title}
</p> </p>
</div> </div>
@ -953,7 +947,7 @@ export const ProjectTracker = () => {
{task.dead_line && ( {task.dead_line && (
<div className="tasks__board__item__dead-line"> <div className="tasks__board__item__dead-line">
<p></p> <p></p>
<span> <span style={{ color: titleColor }}>
{getCorrectDate(task.dead_line)} {getCorrectDate(task.dead_line)}
</span> </span>
</div> </div>
@ -971,7 +965,7 @@ export const ProjectTracker = () => {
alt="avatar" alt="avatar"
/> />
<span> <span>
{task.executor?.fio || {removeLast(task.executor?.fio) ||
"Исполнитель не назначен"} "Исполнитель не назначен"}
</span> </span>
</div> </div>

View File

@ -1,12 +1,16 @@
import React from "react"; import React, { useEffect, useState } from "react";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { Link } from "react-router-dom"; import { Link, useParams } from "react-router-dom";
import { setToggleTab } from "@redux/projectsTrackerSlice"; import { setToggleTab } from "@redux/projectsTrackerSlice";
import { copyProjectLink } from "@utils/helper"; import { copyProjectLink } from "@utils/helper";
import { urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request";
import { Footer } from "@components/Common/Footer/Footer"; import { Footer } from "@components/Common/Footer/Footer";
import { Loader } from "@components/Common/Loader/Loader";
import { Navigation } from "@components/Navigation/Navigation"; import { Navigation } from "@components/Navigation/Navigation";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
@ -23,6 +27,21 @@ import "./statistics.scss";
const Statistics = () => { const Statistics = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const params = useParams();
const [projectStatistic, setProjectStatistic] = useState(null);
const [projectInfo, setProjectInfo] = useState(null);
const [loader, setLoader] = useState(true);
useEffect(() => {
apiRequest(`/project/get-project?project_id=${params.id}`).then((res) => {
setProjectInfo(res);
});
apiRequest(`/project/statistic?project_id=${params.id}`).then((res) => {
setProjectStatistic(res);
setLoader(false);
});
}, []);
const teams = [ const teams = [
{ {
@ -72,135 +91,161 @@ const Statistics = () => {
/> />
<h2 className="tracker__title">Управление проектами с трекером</h2> <h2 className="tracker__title">Управление проектами с трекером</h2>
</div> </div>
<div className="tracker__tabs"> {loader ? (
<div className="tracker__tabs__head"> <Loader />
<Link ) : (
to="/profile/tracker" <div className="tracker__tabs">
className="tab active-tab" <div className="tracker__tabs__head">
onClick={() => toggleTabs(1)} <Link
> to="/profile/tracker"
<img src={project} alt="img" /> className="tab active-tab"
<p>Проекты </p> onClick={() => toggleTabs(1)}
</Link> >
<Link <img src={project} alt="img" />
to="/profile/tracker" <p>Проекты </p>
className="tab" </Link>
onClick={() => toggleTabs(2)} <Link
> to="/profile/tracker"
<img src={tasks} alt="img" /> className="tab"
<p>Все мои задачи</p> onClick={() => toggleTabs(2)}
</Link> >
<Link <img src={tasks} alt="img" />
to="/profile/tracker" <p>Все мои задачи</p>
className="tab" </Link>
onClick={() => toggleTabs(3)} <Link
> to="/profile/tracker"
<img src={archive} alt="img" /> className="tab"
<p>Архив</p> onClick={() => toggleTabs(3)}
</Link> >
</div> <img src={archive} alt="img" />
<div className="tracker__tabs__content"> <p>Архив</p>
<div className="tracker__tabs__content__wrapper statistics-body"> </Link>
<div className="statistics-header"> </div>
<div className="statistics-header__menu"> <div className="tracker__tabs__content">
<h1>Статистика проекта</h1> <div className="tracker__tabs__content__wrapper statistics-body">
<img src={link} alt="#" /> <div className="statistics-header">
<span <div className="statistics-header__menu">
className="return-text" <h1>Статистика проекта</h1>
onClick={() => copyProjectLink("62")} <img src={link} alt="#" />
> <span
ссылка на проект className="return-text"
</span> onClick={() => copyProjectLink("62")}
</div> >
ссылка на проект
<div className="statistics-header__return"> </span>
<img src={arrow} alt="#" />
<Link to={`/profile/tracker`} className="return-text">
К списку проектов
</Link>
</div>
</div>
<div className="statistics-info">
<div className="statistics-info__head">
<p>Проект: </p>
<h1>{"Разработка трекера"}</h1>
</div>
<div className="statistics-info__team">
<div className="project-info">
<div className="project-info__creator">
<span className="return-text">Создатель проекта:</span>
<div>
<p>{"Василий Тарасов"}</p>{" "}
<img src={mockAvatar} alt="#" />
</div>
</div>
<div className="project-info__tasks">
<div className="task-quantity">
<p>Открытые задачи</p>
<span className="task-quantity_open">{4}</span>
</div>
<div className="task-quantity">
<p>Задач в работе</p>
<span className="task-quantity_work">{5}</span>
</div>
<div className="task-quantity">
<p>Закрыто задач</p>
<span className="task-quantity_closed">{434}</span>
</div>
</div>
</div> </div>
<div className="list-team">
<div className="list-team__title">
<span className="return-text">Участники проекта:</span>
</div>
<div className="list-team__head">
<p>Имя</p>
<p>Почта</p>
<p>Роль</p>
<p>Статус</p>
</div>
<div className="list-team__body">
{teams.map((item) => {
return (
<>
<div className="list-team__item">
<div className="person-name">
<img src={item.avatar} alt="#" />
<p>{item.name}</p>
</div>
<div className="person-email">
<img src={emailImg} alt="#" />
<p>{item.email}</p>
</div>
<p className="person-type">{item.role}</p> <div className="statistics-header__return">
{/* <span className="status status-active"> */} <img src={arrow} alt="#" />
<span <Link to={`/profile/tracker`} className="return-text">
className={ К списку проектов
item.status </Link>
? "status status-active"
: "status status-none"
}
>
{item.status ? "Активно" : "Не активно"}
</span>
</div>
</>
);
})}
</div>
</div> </div>
<div className="add-person"> </div>
<span className="add-person__button">+</span> <div className="statistics-info">
<p>Добавить участника</p> <div className="statistics-info__head">
<p>Проект: </p>
<h1>{projectInfo?.name}</h1>
</div>
<div className="statistics-info__team">
<div className="project-info">
<div className="project-info__creator">
<span className="return-text">Создатель проекта:</span>
<div>
<p>{projectInfo?.owner_info?.fio}</p>{" "}
<img
src={
projectInfo?.owner_info?.avatar
? urlForLocal(projectInfo.owner_info.avatar)
: mockAvatar
}
alt="#"
/>
</div>
</div>
<div className="project-info__tasks">
<div className="task-quantity">
<p>Открытые задачи</p>
<span className="task-quantity_open">
{projectStatistic?.open_tasks_count}
</span>
</div>
<div className="task-quantity">
<p>Задач в работе</p>
<span className="task-quantity_work">
{projectStatistic?.task_on_work_count}
</span>
</div>
<div className="task-quantity">
<p>Закрыто задач</p>
<span className="task-quantity_closed">
{projectStatistic?.closed_task_count}
</span>
</div>
</div>
</div>
<div className="list-team">
<div className="list-team__title">
<span className="return-text">Участники проекта:</span>
</div>
<div className="list-team__head">
<p className="head__name">Имя</p>
<p className="head__email">Почта</p>
<p className="head__role">Роль</p>
<p className="head__status">Статус</p>
</div>
<div className="list-team__body">
{projectStatistic?.participants.map((person, index) => {
return (
<>
<div className="list-team__item" key={index}>
<div className="person-name">
<img
src={
person.avatar
? urlForLocal(person.avatar)
: mockAvatar
}
alt="avatar"
/>
<p>{person.username}</p>
</div>
<div className="person-email">
<img src={emailImg} alt="#" />
<p>{person.email}</p>
</div>
<p className="person-type">
{person.role ? person.role : "-"}
</p>
{/* <span className="status status-active"> */}
<span
className={
person.status
? "status status-active"
: "status status-none"
}
>
{person.status ? "Активно" : "Не активно"}
</span>
</div>
</>
);
})}
</div>
</div>
<div className="add-person">
<span className="add-person__button">+</span>
<p>Добавить участника</p>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> )}
</div> </div>
<Footer /> <Footer />
</div> </div>

View File

@ -144,6 +144,11 @@
line-height: 32px; line-height: 32px;
margin-right: 19px; margin-right: 19px;
} }
img {
max-width: 36px;
max-height: 36px;
}
} }
} }
@ -240,7 +245,7 @@
&__head { &__head {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-right: 123px; margin-right: 55px;
p { p {
color: #5b6871; color: #5b6871;
@ -255,6 +260,30 @@
@media (max-width: 650px) { @media (max-width: 650px) {
display: none; display: none;
} }
.head {
&__name {
max-width: 270px;
width: 100%;
}
&__email {
max-width: 270px;
width: 100%;
}
&__role {
max-width: 168px;
width: 100%;
text-align: center;
}
&__status {
text-align: center;
max-width: 152px;
width: 100%;
}
}
} }
&__item { &__item {
@ -270,14 +299,18 @@
&-name { &-name {
display: flex; display: flex;
align-items: center; align-items: center;
width: 202px; max-width: 270px;
width: 100%;
img { img {
margin-right: 10px; margin-right: 10px;
max-width: 36px;
max-height: 36px;
} }
} }
&-email { &-email {
width: 235px; max-width: 270px;
width: 100%;
align-items: center; align-items: center;
display: flex; display: flex;
@ -292,6 +325,7 @@
&-type { &-type {
width: 168px; width: 168px;
text-align: center;
} }
@media (max-width: 850px) { @media (max-width: 850px) {

View File

@ -107,7 +107,7 @@ export const Summary = () => {
alt="avatar" alt="avatar"
/> />
<p className="summary__name"> <p className="summary__name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "} {profileInfo?.fio || profileInfo?.username},{" "}
{profileInfo.specification} разработчик {profileInfo.specification} разработчик
</p> </p>
</div> </div>

View File

@ -91,3 +91,11 @@ export function copyProjectLink(projectId) {
`https://itguild.info/tracker/project/${projectId}` `https://itguild.info/tracker/project/${projectId}`
); );
} }
export function removeLast(string = " ") {
let arr = string.trim().split(" ");
if (arr.length > 2) {
return arr.slice(0, -1).join(" ");
}
return string;
}