redesign cards

This commit is contained in:
Victor Batischev 2024-02-13 20:12:07 +03:00
parent ad8c975004
commit 53bd5a661d
8 changed files with 64 additions and 41 deletions

View File

@ -29,7 +29,7 @@
&__info { &__info {
font-size: 15px; font-size: 15px;
font-weight: 300; font-weight: 300;
margin: 12px 0 20px; margin-top: 8px;
} }
@media (max-width: 805px) { @media (max-width: 805px) {
@ -52,13 +52,14 @@
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
row-gap: 5px;
} }
.invite-person-block { .invite-person-block {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
row-gap: 10px; row-gap: 5px;
&__input { &__input {
margin: 0; margin: 0;
min-width: 240px; min-width: 240px;
@ -86,11 +87,10 @@
span { span {
text-align: center; text-align: center;
margin: 5px 0; margin-top: 15px;
} }
.invite-person-block { .invite-person-block {
row-gap: 5px;
&__btn { &__btn {
margin: 5px auto; margin: 5px auto;
} }

View File

@ -406,11 +406,11 @@ export const TrackerModal = ({
<div className="select__person"> <div className="select__person">
<div className="title-project select-person"> <div className="title-project select-person">
<h4>Добавьте участника</h4> <h4>Добавьте участника</h4>
<p className="select-person__info">
Выберите пользователя в списке или добавьте по e-mail
</p>
<div className="invite__blocks"> <div className="invite__blocks">
<div className="add-person-block"> <div className="add-person-block">
<p className="select-person__info">
Выберите пользователя в списке
</p>
<div <div
className={ className={
selectWorkersOpen selectWorkersOpen
@ -461,8 +461,8 @@ export const TrackerModal = ({
Добавить Добавить
</BaseButton> </BaseButton>
</div> </div>
<span>или</span>
<div className="invite-person-block"> <div className="invite-person-block">
<span>или добавьте по e-mail</span>
<div className="input-container invite-person-block__input"> <div className="input-container invite-person-block__input">
<input <input
className="name-project" className="name-project"

View File

@ -1,10 +1,10 @@
import React, { useEffect, useState } 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, useNavigate } from "react-router-dom";
import { deleteProject, modalToggle } from "@redux/projectsTrackerSlice"; import { deleteProject, modalToggle } from "@redux/projectsTrackerSlice";
import { copyProjectLink } from "@utils/helper"; import { copyProjectLink, urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request"; import { apiRequest } from "@api/request";
@ -18,7 +18,6 @@ import archiveSet from "assets/icons/archive.svg";
import del from "assets/icons/delete.svg"; import del from "assets/icons/delete.svg";
import edit from "assets/icons/edit.svg"; import edit from "assets/icons/edit.svg";
import link from "assets/icons/link.svg"; import link from "assets/icons/link.svg";
import avatarProject from "assets/images/avatarMok.png";
import "./projectTicket.scss"; import "./projectTicket.scss";
@ -27,8 +26,8 @@ export const ProjectTicket = ({ project, index }) => {
const [modalAdd, setModalAdd] = useState(false); const [modalAdd, setModalAdd] = useState(false);
const [modalDelete, setModalDelete] = useState(false); const [modalDelete, setModalDelete] = useState(false);
const [acceptModalOpen, setAcceptModalOpen] = useState(false); const [acceptModalOpen, setAcceptModalOpen] = useState(false);
const [path, setPath] = useState("");
const dispatch = useDispatch(); const dispatch = useDispatch();
const navigate = useNavigate();
const { showNotification } = useNotification(); const { showNotification } = useNotification();
useEffect(() => { useEffect(() => {
@ -84,18 +83,30 @@ export const ProjectTicket = ({ project, index }) => {
<div className="project__link">{project.name}</div> <div className="project__link">{project.name}</div>
<div className="project__info"> <div className="project__info">
<p>Открытые задачи</p> {/* <p>Открытые задачи</p>
<span className="count"> <span className="count">
{project.columns.reduce( {project.columns.reduce(
(accumulator, currentValue) => (accumulator, currentValue) =>
accumulator + currentValue.tasks.length, accumulator + currentValue.tasks.length,
0 0
)} )}
</span> </span> */}
<img src={avatarProject} alt="#" className="project__avatar" /> <img
src={urlForLocal(project.owner_info.avatar)}
alt="avatar"
className="project__avatar"
/>
<span>{project.owner_info.fio}</span>
</div> </div>
</Link> </Link>
{/* <Link
to={`/profile/statistics/${project.id}`}
className="project__statistics"
>
Посмотреть статистику
</Link> */}
<span <span
className="menu-settings" className="menu-settings"
onClick={() => { onClick={() => {
@ -105,13 +116,6 @@ export const ProjectTicket = ({ project, index }) => {
... ...
</span> </span>
<Link
to={`/profile/statistics/${project.id}`}
className="project__statistics"
>
Посмотреть статистику
</Link>
<TrackerModal <TrackerModal
active={modalAdd} active={modalAdd}
setActive={setModalAdd} setActive={setModalAdd}
@ -131,9 +135,9 @@ export const ProjectTicket = ({ project, index }) => {
<img src={edit}></img> <img src={edit}></img>
<p>редактировать</p> <p>редактировать</p>
</div> </div>
<div> <div onClick={copyProjectLink(project.id)}>
<img src={link}></img> <img src={link}></img>
<p onClick={copyProjectLink(project.id)}>скопировать ссылку</p> <p>скопировать ссылку</p>
</div> </div>
<div <div
onClick={() => { onClick={() => {
@ -144,7 +148,14 @@ export const ProjectTicket = ({ project, index }) => {
<img src={archiveSet}></img> <img src={archiveSet}></img>
<p>в архив</p> <p>в архив</p>
</div> </div>
<div
onClick={() => {
navigate(`/profile/statistics/${project.id}`);
}}
>
<img src={archiveSet}></img>
<p>статистика</p>
</div>
<div <div
onClick={() => { onClick={() => {
setModalDelete(true); setModalDelete(true);

View File

@ -40,7 +40,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
position: relative; position: relative;
margin-bottom: 30px;
p { p {
color: #6f6f6f; color: #6f6f6f;
@ -50,6 +49,11 @@
line-height: 17px; line-height: 17px;
} }
span {
color: blue;
font-size: 15px;
}
.count { .count {
margin-left: 8px; margin-left: 8px;
width: 26px; width: 26px;
@ -78,16 +82,16 @@
.menu-settings { .menu-settings {
position: absolute; position: absolute;
font-size: 21px; font-size: 30px;
color: #6f6f6f; color: #6f6f6f;
right: 15px; right: 15px;
top: 0px; top: -10px;
} }
&__avatar { &__avatar {
width: 25px; width: 25px;
height: 25px; height: 25px;
margin-left: 56px; margin-right: 10px;
} }
&__open-tracker { &__open-tracker {

View File

@ -878,6 +878,7 @@ export const ProjectTracker = () => {
"YYYY-MM-DD HH:mm:ss" "YYYY-MM-DD HH:mm:ss"
); );
const titleColor = const titleColor =
task.dead_line &&
dateDeadline < new Date(currentDate) dateDeadline < new Date(currentDate)
? "red" ? "red"
: "#1a1919"; : "#1a1919";

View File

@ -171,7 +171,7 @@
.create-project-btn { .create-project-btn {
width: 300px; width: 300px;
height: 113px; height: 83px;
border-radius: 12px; border-radius: 12px;
background: #ecf8e5; background: #ecf8e5;
color: #000000; color: #000000;
@ -224,7 +224,6 @@
align-items: center; align-items: center;
column-gap: 5px; column-gap: 5px;
img { img {
margin-left: -22px;
height: 22px; height: 22px;
} }
} }
@ -564,6 +563,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@media (max-width: 900px) {
left: 0px;
}
.close { .close {
cursor: pointer; cursor: pointer;
width: 20px; width: 20px;

View File

@ -155,7 +155,7 @@ export const ViewReport = () => {
: "view-report__bar__delete disable" : "view-report__bar__delete disable"
} }
> >
Удалить отчет Удалить
</button> </button>
)} )}
</div> </div>
@ -201,7 +201,7 @@ export const ViewReport = () => {
<thead> <thead>
<tr> <tr>
<th> <th>
<p>Какие задачи выполнены?</p> <p>Выполненные задачи</p>
</th> </th>
<th> <th>
<p>Время</p> <p>Время</p>
@ -242,7 +242,7 @@ export const ViewReport = () => {
</div> </div>
{Boolean(difficulties.length) && ( {Boolean(difficulties.length) && (
<div className="view-report__item"> <div className="view-report__item">
<h3>Какие сложности возникли?</h3> <h3>Возникшие сложности</h3>
{difficulties.map((item, index) => { {difficulties.map((item, index) => {
return <p key={index}>{item}</p>; return <p key={index}>{item}</p>;
})} })}

View File

@ -60,7 +60,7 @@
border-radius: 12px; border-radius: 12px;
padding: 20px 33px; padding: 20px 33px;
align-items: center; align-items: center;
column-gap: 60px; column-gap: 20px;
height: 72px; height: 72px;
justify-content: space-between; justify-content: space-between;
@ -88,9 +88,14 @@
} }
&__delete { &__delete {
background: white; color: #000000;
border-radius: 12px; font-size: 15px;
border: 1px dashed #8bcc60; font-weight: 500;
line-height: 32px;
padding: 8px 24px;
background: whitesmoke;
border-radius: 44px;
border: none;
} }
.disable { .disable {
@ -343,9 +348,8 @@
width: 100%; width: 100%;
@media (max-width: 900px) { @media (max-width: 900px) {
max-width: 28px; max-width: 40px;
height: 28px; height: 40px;
font-size: 15px;
} }
} }