Fixed statistics page

This commit is contained in:
MaxOvs19 2023-10-03 18:26:07 +03:00
parent 986c0833f7
commit aba12694bf
4 changed files with 31 additions and 8 deletions

View File

@ -4,6 +4,8 @@ import { Link } from "react-router-dom";
import { deleteProject, modalToggle } from "@redux/projectsTrackerSlice";
import { copyProjectLink } from "@utils/helper";
import { apiRequest } from "@api/request";
import { useNotification } from "@hooks/useNotification";
@ -63,12 +65,6 @@ export const ProjectTiket = ({ project, index }) => {
});
}
function copyProjectLink() {
navigator.clipboard.writeText(
`https://itguild.info/tracker/project/${project.id}`
);
}
function closeAcceptModal() {
setAcceptModalOpen(false);
}
@ -120,7 +116,7 @@ export const ProjectTiket = ({ project, index }) => {
</div>
<div>
<img src={link}></img>
<p onClick={copyProjectLink}>ссылка на проект</p>
<p onClick={copyProjectLink(project.id)}>ссылка на проект</p>
</div>
<div
onClick={() => {

View File

@ -4,6 +4,8 @@ import { Link } from "react-router-dom";
import { setToggleTab } from "@redux/projectsTrackerSlice";
import { copyProjectLink } from "@utils/helper";
import { Navigation } from "@components/Navigation/Navigation";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
@ -103,7 +105,9 @@ const Statistics = () => {
<div className="statistics-header__menu">
<h1>Статистика проекта</h1>
<img src={link} alt="#" />
<span className="return-text">ссылка на проект</span>
<span className="return-text" onClick={copyProjectLink("62")}>
ссылка на проект
</span>
</div>
<div className="statistics-header__return">

View File

@ -17,6 +17,16 @@
transform: rotate(-180deg);
margin-right: 22px;
}
a {
cursor: pointer;
transition: 0.4s;
&:hover {
text-decoration: underline !important;
transition: 0.4s;
}
}
}
&__menu {
@ -33,6 +43,13 @@
span {
margin-left: 17px;
cursor: pointer;
transition: 0.4s;
&:hover {
text-decoration: underline;
transition: 0.4s;
}
}
}
}

View File

@ -79,3 +79,9 @@ export function caseOfNum(number, type) {
: cases[number % 10 < 5 ? number % 10 : 5]
];
}
export function copyProjectLink(projectId) {
navigator.clipboard.writeText(
`https://itguild.info/tracker/project/${projectId}`
);
}