Added modal to tracker

This commit is contained in:
MaxOvs19 2023-03-07 19:40:52 +03:00
parent 22e70549a9
commit b80824088d
5 changed files with 283 additions and 223 deletions

View File

@ -5,9 +5,9 @@ import creatorMock from "../../../images/avatarMoсkCreator.png";
import avatarMock1 from "../../../images/avatarMoсk1.png"; import avatarMock1 from "../../../images/avatarMoсk1.png";
import avatarMock2 from "../../../images/avatarMoсk2.png"; import avatarMock2 from "../../../images/avatarMoсk2.png";
import category from "../../../images/category.png"; import category from "../../../images/category.png";
import comments from "../../../images/comments.png"; import comments from "../../../images/commentsBoard.svg";
import watch from "../../../images/watch.png"; import watch from "../../../images/watch.png";
import files from "../../../images/files.png"; import files from "../../../images/filesBoard.svg";
import task from "../../../images/tasksMock.png"; import task from "../../../images/tasksMock.png";
import arrow from "../../../images/arrowStart.png"; import arrow from "../../../images/arrowStart.png";
@ -88,7 +88,7 @@ export const ModalTiket = ({ active, setActive }) => {
})} })}
</div> </div>
<div className="add-worker"> <div className="add-worker moreItems">
<button>+</button> <button>+</button>
<span>Добавить участников</span> <span>Добавить участников</span>
</div> </div>

View File

@ -134,14 +134,26 @@
} }
button { button {
cursor: pointer;
background: #8bcc60; background: #8bcc60;
border-radius: 44px;
width: 33px; width: 33px;
height: 33px; height: 33px;
display: flex;
justify-content: center;
align-items: center;
border: none;
color: white;
font-size: 17px;
} }
} }
.start { .start {
margin-top: 25px; margin-top: 25px;
width: 151px;
height: 40px;
border: none;
color: white;
background: #1458dd; background: #1458dd;
border-radius: 44px; border-radius: 44px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

View File

@ -1,230 +1,278 @@
import React, {useState} from 'react'; import React, { useState } from "react";
import {ProfileHeader} from "../../components/ProfileHeader/ProfileHeader"; import { ProfileHeader } from "../../components/ProfileHeader/ProfileHeader";
import {Footer} from '../../components/Footer/Footer' import { Footer } from "../../components/Footer/Footer";
import project from '../../images/trackerProject.svg' import project from "../../images/trackerProject.svg";
import tasks from '../../images/trackerTasks.svg' import tasks from "../../images/trackerTasks.svg";
import archive from '../../images/archiveTracker.svg' import archive from "../../images/archiveTracker.svg";
import avatarTest from '../../images/AvatarTest .png' import avatarTest from "../../images/AvatarTest .png";
import selectArrow from '../../images/select.svg' import selectArrow from "../../images/select.svg";
import commentsBoard from '../../images/commentsBoard.svg' import commentsBoard from "../../images/commentsBoard.svg";
import filesBoard from '../../images/filesBoard.svg' import filesBoard from "../../images/filesBoard.svg";
import './tracker.scss' import "./tracker.scss";
import ModalTiket from "../../components/UI/ModalTiket/ModalTiket";
export const Tracker = () => { export const Tracker = () => {
const [toggleTab, setToggleTab] = useState(1);
const [toggleTab, setToggleTab] = useState(1)
const [projects] = useState([ const [projects] = useState([
{ {
name: 'Разработка трекера', name: "Разработка трекера",
count: 4 count: 4,
}, },
{ {
name: 'Кинотеатр', name: "Кинотеатр",
count: 4 count: 4,
}, },
{ {
name: 'Проект страхование', name: "Проект страхование",
count: 4 count: 4,
} },
]) ]);
const [tabTaskMok] = useState([ const [tabTaskMok] = useState([
{ {
name: 'Открытые', name: "Открытые",
tasks: [ tasks: [
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
}, },
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
} },
] ],
}, },
{ {
name: 'В процессе', name: "В процессе",
tasks: [ tasks: [
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
} },
] ],
}, },
{ {
name: 'На проверке', name: "На проверке",
tasks: [ tasks: [
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
}, },
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
}, },
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
} },
] ],
}, },
{ {
name: 'Готово', name: "Готово",
tasks: [ tasks: [
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
}, },
{ {
task: 'PR - 2245', task: "PR - 2245",
description: 'Сверстать часть таблицы. Сверстать часть таблицы', description: "Сверстать часть таблицы. Сверстать часть таблицы",
comments: 12, comments: 12,
files: 0, files: 0,
avatarCreated: avatarTest, avatarCreated: avatarTest,
avatarDo: avatarTest avatarDo: avatarTest,
} },
] ],
} },
]) ]);
const [modalActiveTicket, setModalActiveTicket] = useState(false);
const toggleTabs = (index) => { const toggleTabs = (index) => {
setToggleTab(index) setToggleTab(index);
} };
return ( return (
<div className='tracker'> <div className="tracker">
<ProfileHeader /> <ProfileHeader />
<div className='container'> <div className="container">
<div className='tracker__content'> <div className="tracker__content">
<h2 className='tracker__title'>Трекер</h2> <h2 className="tracker__title">Трекер</h2>
<div className='tracker__tabs'> <div className="tracker__tabs">
<div className='tracker__tabs__head'> <div className="tracker__tabs__head">
<div className={toggleTab === 1 ? 'tab active-tab' : 'tab'} onClick={() => toggleTabs(1)}> <div
<img src={project} alt='img' /> className={toggleTab === 1 ? "tab active-tab" : "tab"}
onClick={() => toggleTabs(1)}
>
<img src={project} alt="img" />
<p>Проекты </p> <p>Проекты </p>
</div> </div>
<div className={toggleTab === 2 ? 'tab active-tab' : 'tab'} onClick={() => toggleTabs(2)}> <div
<img src={tasks} alt='img' /> className={toggleTab === 2 ? "tab active-tab" : "tab"}
onClick={() => toggleTabs(2)}
>
<img src={tasks} alt="img" />
<p>Задачи</p> <p>Задачи</p>
</div> </div>
<div className={toggleTab === 3 ? 'tab active-tab' : 'tab'} onClick={() => toggleTabs(3)}> <div
<img src={archive} alt='img' /> className={toggleTab === 3 ? "tab active-tab" : "tab"}
onClick={() => toggleTabs(3)}
>
<img src={archive} alt="img" />
<p>Архив</p> <p>Архив</p>
</div> </div>
</div> </div>
<div className='tracker__tabs__content'> <div className="tracker__tabs__content">
<div className={toggleTab === 1 ? 'tracker__tabs__content__projects active__content' : 'tracker__tabs__content__projects'}> <div
{projects.map((project, index) => { className={
return <div className='project' key={index}> toggleTab === 1
<h3>{project.name}</h3> ? "tracker__tabs__content__projects active__content"
<div className='project__info'> : "tracker__tabs__content__projects"
<p>Открытые задачи</p>
<span className='count'>{project.count}</span>
<span className='add'>+</span>
</div>
</div>
})
} }
<button><span>+</span>Создать проект</button> >
{projects.map((project, index) => {
return (
<div className="project" key={index}>
<h3>{project.name}</h3>
<div className="project__info">
<p>Открытые задачи</p>
<span className="count">{project.count}</span>
<span className="add">+</span>
</div> </div>
<div className={toggleTab === 2 ? 'tracker__tabs__content__tasks tasks active__content' : 'tracker__tabs__content__projects'}> </div>
<div className='tasks__head'> );
})}
<button>
<span>+</span>Создать проект
</button>
</div>
<div
className={
toggleTab === 2
? "tracker__tabs__content__tasks tasks active__content"
: "tracker__tabs__content__projects"
}
>
<div className="tasks__head">
<h4>Проект : Разработка трекера</h4> <h4>Проект : Разработка трекера</h4>
<span className='tasks__head__add'>+</span> <span className="tasks__head__add">+</span>
<div className='tasks__head__persons'> <div className="tasks__head__persons">
<img src={avatarTest} alt='avatar' /> <img src={avatarTest} alt="avatar" />
<img src={avatarTest} alt='avatar' /> <img src={avatarTest} alt="avatar" />
<img src={avatarTest} alt='avatar' /> <img src={avatarTest} alt="avatar" />
<img src={avatarTest} alt='avatar' /> <img src={avatarTest} alt="avatar" />
<span>+9</span> <span>+9</span>
</div> </div>
<div className='tasks__head__select'> <div className="tasks__head__select">
<span>Учавствую</span> <span>Учавствую</span>
<img src={selectArrow} alt='arrow' /> <img src={selectArrow} alt="arrow" />
</div> </div>
<div className='tasks__head__select'> <div className="tasks__head__select">
<span>Мои</span> <span>Мои</span>
<img src={selectArrow} alt='arrow' /> <img src={selectArrow} alt="arrow" />
</div> </div>
</div> </div>
<div className='tasks__container'> <ModalTiket
active={modalActiveTicket}
setActive={setModalActiveTicket}
/>
<div className="tasks__container">
{tabTaskMok.map((section, index) => { {tabTaskMok.map((section, index) => {
return <div key={index} className={section.tasks.length >= 3 ? 'tasks__board tasks__board__more' : 'tasks__board'}> return (
<div className='board__head'> <div
<span className={index === 3 ? 'done' : ''}>{section.name}</span> key={index}
className={
section.tasks.length >= 3
? "tasks__board tasks__board__more"
: "tasks__board"
}
>
<div className="board__head">
<span className={index === 3 ? "done" : ""}>
{section.name}
</span>
<div> <div>
<span className='add'>+</span> <span className="add">+</span>
<span className='more'>...</span> <span className="more">...</span>
</div> </div>
</div> </div>
{section.tasks.map((task, index) => { {section.tasks.map((task, index) => {
return <div key={index} className='tasks__board__item' draggable="true"> return (
<div className='tasks__board__item__title'> <div
key={index}
className="tasks__board__item"
draggable="true"
onClick={() => setModalActiveTicket(true)}
>
<div className="tasks__board__item__title">
<p>{task.task}</p> <p>{task.task}</p>
<span>...</span> <span>...</span>
</div> </div>
<p className='tasks__board__item__description'> <p className="tasks__board__item__description">
{task.description} {task.description}
</p> </p>
<div className='tasks__board__item__info'> <div className="tasks__board__item__info">
<div className='tasks__board__item__info__more'> <div className="tasks__board__item__info__more">
<img src={commentsBoard} alt='commentsImg' /> <img src={commentsBoard} alt="commentsImg" />
<span>{task.comments} коментариев</span> <span>{task.comments} коментариев</span>
</div> </div>
<div className='tasks__board__item__info__more'> <div className="tasks__board__item__info__more">
<img src={filesBoard} alt='filesImg' /> <img src={filesBoard} alt="filesImg" />
<span>{task.files} файлов</span> <span>{task.files} файлов</span>
</div> </div>
<div className='tasks__board__item__info__avatars'> <div className="tasks__board__item__info__avatars">
<img src={task.avatarCreated} alt='avatar' /> <img src={task.avatarCreated} alt="avatar" />
<img src={task.avatarDo} alt='avatar' /> <img src={task.avatarDo} alt="avatar" />
</div> </div>
</div> </div>
</div> </div>
}) );
} })}
{section.tasks.length >= 3 && {section.tasks.length >= 3 && (
<span className='moreItems'>+</span> <span className="moreItems">+</span>
} )}
</div> </div>
}) );
} })}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<Footer/> <Footer />
</div> </div>
) );
}; };