Moving components and creating jsconfig

This commit is contained in:
MaxOvs19 2023-05-29 15:01:38 +03:00
parent 3b605280b2
commit 5865c59ba3
24 changed files with 185 additions and 237 deletions

7
jsconfig.json Normal file
View File

@ -0,0 +1,7 @@
{
"compilerOptions": {
"target": "es2020"
// "baseUrl": "src"
},
"include": ["src"]
}

View File

@ -13,7 +13,7 @@ import Candidate from "./components/Candidate/Candidate";
import Calendar from "./components/Calendar/Calendar";
import ReportForm from "./components/ReportForm/ReportForm";
import FreeDevelopers from "./components/FreeDevelopers/FreeDevelopers";
import { TicketFullScreen } from "./components/UI/TicketFullScreen/TicketFullScreen";
import { TicketFullScreen } from "./components/Modal/Tracker/TicketFullScreen/TicketFullScreen";
import { ProfileCalendar } from "./components/ProfileCalendar/ProfileCalendar";
import Article from "./pages/Article/Article";
import FormPage from "./pages/FormPage/FormPage";

View File

@ -7,8 +7,8 @@ import { loading } from "../../redux/loaderSlice";
import { setRole } from "../../redux/roleSlice";
import { selectIsLoading } from "../../redux/loaderSlice";
import ModalRegistration from "../UI/ModalRegistration/ModalRegistration";
import ModalErrorLogin from "../UI/ModalErrorLogin/ModalErrorLogin";
import ModalRegistration from "../Modal/ModalRegistration/ModalRegistration";
import ModalErrorLogin from "../Modal/ModalErrorLogin/ModalErrorLogin";
import { Loader } from "../Loader/Loader";
import { apiRequest } from "../../api/request";
@ -49,7 +49,7 @@ export const AuthBox = ({ title }) => {
data: formData,
}).then((res) => {
if (!res.access_token) {
setError("Некорректные данные для входа");
setError("Введены некоректные данные для входа");
setModalError(true);
dispatch(loading(false));
} else {

View File

@ -1,7 +1,7 @@
import React, { useState } from "react";
import { Achievement } from "../Achievement/Achievement";
import ModalAspirant from "../UI/ModalAspirant/ModalAspirant";
import ModalAspirant from "../Modal/ModalAspirant/ModalAspirant";
import { urlForLocal } from "../../helper";
import { LEVELS, SKILLS } from "../../constants/constants";

View File

@ -1,8 +1,8 @@
import React from "react";
import classes from "./button.module.scss";
import classes from "./basebutton.module.scss";
export const Button = ({ children, styles, ...props }) => {
export const BaseButton = ({ children, styles, ...props }) => {
return (
<button
className={styles ? `${styles} ${classes.button}` : classes.button}
@ -13,4 +13,4 @@ export const Button = ({ children, styles, ...props }) => {
);
};
export default Button;
export default BaseButton;

View File

@ -2,11 +2,18 @@ import React from "react";
import "./modalLayout.scss";
export const ModalLayout = ({ active, setActive, children, styles }) => {
export const ModalLayout = ({
active,
setActive,
children,
styles,
...props
}) => {
return (
<div
className={active ? `modal-layout active` : "modal-layout"}
onClick={() => setActive(false)}
{...props}
>
<div
className={

View File

@ -6,7 +6,7 @@ import SideBar from "../SideBar/SideBar";
import { Footer } from "../Footer/Footer";
import { scrollToForm } from "../../helper";
import { ProfileBreadcrumbs } from "../ProfileBreadcrumbs/ProfileBreadcrumbs";
import Button from "../Common/Button/Button";
import BaseButton from "../Common/BaseButton/BaseButton";
import mockWorker from "../../assets/images/mock/mokPerson.png";
import arrow from "../../assets/icons/arrows/arrow_left.png";
@ -42,9 +42,9 @@ export const FreeDevelopers = ({}) => {
<div></div>
</div>
</div>
<Button onClick={scrollToForm} styles={"dev-code"}>
<BaseButton onClick={scrollToForm} styles={"dev-code"}>
Код разработчика
</Button>
</BaseButton>
</div>
<div className="free-dev__body">
@ -86,9 +86,9 @@ export const FreeDevelopers = ({}) => {
<div className="login">
<h3>Для просмотра полного резюме разработчика авторизуйтесь</h3>
<Button styles={"dev-code"}>
<BaseButton styles={"dev-code"}>
<Link to={"/auth"}>Войти</Link>
</Button>
</BaseButton>
</div>
</div>
<Footer />

View File

@ -2,7 +2,7 @@ import React, { useState } from "react";
import { Link } from "react-router-dom";
import ModalLayout from "../../Common/ModalLayout/ModalLayout";
import Button from "../../Common/Button/Button";
import BaseButton from "../../Common/BaseButton/BaseButton";
import avatar from "../../../assets/images/mock/mokPerson.png";
import logoTg from "../../../assets/icons/tgLogo.svg";
@ -74,9 +74,9 @@ export const ModalAspirant = ({ active, setActive, level }) => {
onChange={(e) => setTime(e.target.value)}
></input>
</div>
<Button onClick={send} styles="form-interview__submit">
<BaseButton onClick={send} styles="form-interview__submit">
Отправить
</Button>
</BaseButton>
</div>
<span className="exit" onClick={() => setActive(false)}></span>
<ModalLayout active={modalSend} setActive={setModalSend} styles={"send"}>

View File

@ -0,0 +1,26 @@
import React from "react";
import "./modalErrorLogin.scss";
import ModalLayout from "../../Common/ModalLayout/ModalLayout";
import BaseButton from "../../Common/BaseButton/BaseButton";
export const ModalErrorLogin = ({ active, setActive, title }) => {
return (
<ModalLayout active={active} setActive={setActive} styles={"error-login"}>
<h2>Ошибка входа</h2>
<p>{title}</p>
<BaseButton
styles={"error-login__button"}
onClick={(e) => {
e.preventDefault();
setActive(false);
}}
>
Попробовать еще раз
</BaseButton>
<span onClick={() => setActive(false)} className="exit"></span>
</ModalLayout>
);
};
export default ModalErrorLogin;

View File

@ -0,0 +1,31 @@
.error-login {
position: relative;
padding: 54px 76px;
background: linear-gradient(180deg, #ffffff 0%, #ebebeb 100%);
border-radius: 40px;
display: flex;
flex-direction: column;
align-items: center;
h2 {
font-size: 24px;
line-height: 29px;
color: #263238;
margin-bottom: 16px;
}
p {
font-size: 12px;
line-height: 14px;
width: 176px;
text-align: center;
font-weight: 300;
margin-bottom: 30px;
}
&__button {
font-size: 14px;
width: 198px;
height: 50px;
}
}

View File

@ -1,7 +1,7 @@
import React from "react";
import ModalLayout from "../../Common/ModalLayout/ModalLayout";
import Button from "../../Common/Button/Button";
import BaseButton from "../../Common/BaseButton/BaseButton";
import telegramLogo from "../../../assets/icons/tgLogo.svg";
import doc from "../../../assets/icons/doc.svg";
@ -37,12 +37,12 @@ export const ModalRegistration = ({ active, setActive }) => {
</div>
</div>
<div className="button-box">
<Button
<BaseButton
onClick={(e) => e.preventDefault()}
styles={"button-box__submit"}
>
Отправить
</Button>
</BaseButton>
<h5>
У вас уже есть аккаунт? <p>Войти</p>
</h5>

View File

@ -1,28 +1,32 @@
import React, { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import TrackerModal from "../TrackerModal/TrackerModal";
import { apiRequest } from "../../../api/request";
import { apiRequest } from "../../../../api/request";
import { useDispatch } from "react-redux";
import { urlForLocal } from "../../../helper";
import { urlForLocal } from "../../../../helper";
import {
modalToggle,
setProjectBoardFetch,
} from "../../../redux/projectsTrackerSlice";
import { getCorrectDate } from "../../../components/Calendar/calendarHelper";
} from "../../../../redux/projectsTrackerSlice";
import { getCorrectDate } from "../../../../components/Calendar/calendarHelper";
import category from "../../../assets/icons/category.svg";
import watch from "../../../assets/icons/watch.svg";
import file from "../../../assets/icons/fileModal.svg";
import arrow from "../../../assets/icons/arrows/arrowStart.png";
import link from "../../../assets/icons/link.svg";
import archive from "../../../assets/icons/archive.svg";
import del from "../../../assets/icons/delete.svg";
import edit from "../../../assets/icons/edit.svg";
import send from "../../../assets/icons/send.svg";
import plus from "../../../assets/icons/plus.svg";
import fullScreen from "../../../assets/icons/arrows/inFullScreen.svg";
import close from "../../../assets/icons/closeProjectPersons.svg";
// import TrackerModal from "";
import TrackerModal from "../../../UI/TrackerModal/TrackerModal";
import ModalLayout from "../../../Common/ModalLayout/ModalLayout";
import BaseButton from "../../../Common/BaseButton/BaseButton";
import category from "../../../../assets/icons/category.svg";
import watch from "../../../../assets/icons/watch.svg";
import file from "../../../../assets/icons/fileModal.svg";
import arrow from "../../../../assets/icons/arrows/arrowStart.png";
import link from "../../../../assets/icons/link.svg";
import archive from "../../../../assets/icons/archive.svg";
import del from "../../../../assets/icons/delete.svg";
import edit from "../../../../assets/icons/edit.svg";
import send from "../../../../assets/icons/send.svg";
import plus from "../../../../assets/icons/plus.svg";
import fullScreen from "../../../../assets/icons/arrows/inFullScreen.svg";
import close from "../../../../assets/icons/closeProjectPersons.svg";
import "./ModalTicket.scss";
@ -200,13 +204,11 @@ export const ModalTiсket = ({
}, [members]);
return (
<div
className={active ? "modal-tiket active" : "modal-tiket"}
onClick={() => setActive(false)}
>
<div
className="modal-tiket__content"
onClick={(e) => e.stopPropagation()}
<>
<ModalLayout
active={active}
setActive={setActive}
styles={"tracker-ticket"}
>
<div className="content">
<h3 className="title-project">
@ -253,21 +255,22 @@ export const ModalTiсket = ({
</div>
<div className="content__communication">
<p className="tasks">
<button
<BaseButton
onClick={() => {
dispatch(modalToggle("addSubtask"));
setAddSubtask(true);
}}
styles={"tasks__button"}
>
<img src={plus}></img>
Добавить под задачу
</button>
</BaseButton>
</p>
<p className="file">
<button>
<BaseButton styles={"file__button"}>
<img src={file}></img>
Загрузить файл
</button>
</BaseButton>
<span>{0}</span>
Файлов
</p>
@ -474,14 +477,14 @@ export const ModalTiсket = ({
</div>
</div>
</div>
</div>
</ModalLayout>
<TrackerModal
active={addSubtask}
setActive={setAddSubtask}
defautlInput={task.column_id}
></TrackerModal>
</div>
</>
);
};

View File

@ -1,24 +1,8 @@
.modal-tiket {
z-index: 9;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.11);
position: fixed;
top: 0;
left: 0;
display: none;
align-items: center;
justify-content: center;
}
.modal-tiket.active {
display: flex;
}
.modal-tiket__content {
.tracker-ticket {
background: #ffffff;
//border: 1px solid #dde2e4;
padding: 0;
border-radius: 8px;
align-items: initial;
display: flex;
flex-direction: row;
@ -121,6 +105,7 @@
display: flex;
flex-direction: column;
margin-top: 10px;
p {
font-weight: 400;
font-size: 14px;
@ -143,16 +128,10 @@
.tasks {
justify-content: space-evenly;
button {
&__button {
width: 180px;
height: 40px;
background: #52b709;
border-radius: 44px;
font-weight: 400;
font-size: 12px;
line-height: 32px;
border: none;
color: #ffffff;
}
}
@ -166,18 +145,13 @@
justify-content: space-between;
margin-left: 20px;
button {
display: flex;
align-items: center;
justify-content: center;
&__button {
background: white;
width: 166px;
height: 40px;
border: 0.5px solid #1458dd;
border-radius: 44px;
font-weight: 400;
font-size: 12px;
line-height: 32px;
color: #1458dd;
img {

View File

@ -1,12 +1,12 @@
import React, { useEffect, useState } from "react";
import { ProfileHeader } from "../../ProfileHeader/ProfileHeader";
import { ProfileBreadcrumbs } from "../../ProfileBreadcrumbs/ProfileBreadcrumbs";
import { Footer } from "../../Footer/Footer";
import { ProfileHeader } from "../../../ProfileHeader/ProfileHeader";
import { ProfileBreadcrumbs } from "../../../ProfileBreadcrumbs/ProfileBreadcrumbs";
import { Footer } from "../../../Footer/Footer";
import { Link, useParams, useNavigate } from "react-router-dom";
import TrackerModal from "../TrackerModal/TrackerModal";
import { Navigation } from "../../Navigation/Navigation";
import { Loader } from "../../Loader/Loader";
import TrackerModal from "../../../UI/TrackerModal/TrackerModal";
import { Navigation } from "../../../Navigation/Navigation";
import { Loader } from "../../../Loader/Loader";
import { useDispatch, useSelector } from "react-redux";
import {
@ -16,26 +16,27 @@ import {
setToggleTab,
getProjectBoard,
getBoarderLoader,
} from "../../../redux/projectsTrackerSlice";
import { apiRequest } from "../../../api/request";
import { urlForLocal } from "../../../helper";
import { getCorrectDate } from "../../Calendar/calendarHelper";
} from "../../../../redux/projectsTrackerSlice";
import { apiRequest } from "../../../../api/request";
import { urlForLocal } from "../../../../helper";
import { getCorrectDate } from "../../../Calendar/calendarHelper";
import BaseButton from "../../../Common/BaseButton/BaseButton";
import project from "../../../assets/icons/trackerProject.svg";
import watch from "../../../assets/icons/watch.svg";
import file from "../../../assets/icons/fileModal.svg";
import send from "../../../assets/icons/send.svg";
import arrow2 from "../../../assets/icons/arrows/arrowStart.png";
import plus from "../../../assets/icons/plus.svg";
import tasks from "../../../assets/icons/trackerTasks.svg";
import archive from "../../../assets/icons/archiveTracker.svg";
import selectArrow from "../../../assets/icons/arrows/select.svg";
import arrow from "../../../assets/icons/arrows/arrowCalendar.png";
import link from "../../../assets/icons/link.svg";
import archive2 from "../../../assets/icons/archive.svg";
import del from "../../../assets/icons/delete.svg";
import edit from "../../../assets/icons/edit.svg";
import close from "../../../assets/icons/closeProjectPersons.svg";
import project from "../../../../assets/icons/trackerProject.svg";
import watch from "../../../../assets/icons/watch.svg";
import file from "../../../../assets/icons/fileModal.svg";
import send from "../../../../assets/icons/send.svg";
import arrow2 from "../../../../assets/icons/arrows/arrowStart.png";
import plus from "../../../../assets/icons/plus.svg";
import tasks from "../../../../assets/icons/trackerTasks.svg";
import archive from "../../../../assets/icons/archiveTracker.svg";
import selectArrow from "../../../../assets/icons/arrows/select.svg";
import arrow from "../../../../assets/icons/arrows/arrowCalendar.png";
import link from "../../../../assets/icons/link.svg";
import archive2 from "../../../../assets/icons/archive.svg";
import del from "../../../../assets/icons/delete.svg";
import edit from "../../../../assets/icons/edit.svg";
import close from "../../../../assets/icons/closeProjectPersons.svg";
import "./ticketFullScreen.scss";
@ -307,7 +308,7 @@ export const TicketFullScreen = ({}) => {
</div>
</div>
</div>
<div className="modal-tiket__content ticket">
<div className="tracker-ticket ticket">
<div className="content ticket-whith">
<div className="content__task">
<span>Задача</span>
@ -338,25 +339,25 @@ export const TicketFullScreen = ({}) => {
) : (
<p>{inputsValue.description}</p>
)}
{/*<img src={task} className="image-task"></img>*/}
</div>
<div className="content__communication">
<p className="tasks">
<button
<BaseButton
onClick={() => {
dispatch(modalToggle("addSubtask"));
setModalAddWorker(true);
setAddSubtask(true);
}}
styles={"tasks__button"}
>
<img src={plus}></img>
Добавить под задачу
</button>
</BaseButton>
</p>
<p className="file">
<button>
<BaseButton styles={"file__button"}>
<img src={file}></img>
Загрузить файл
</button>
</BaseButton>
<span>{0}</span>
Файлов
</p>

View File

@ -2,7 +2,7 @@ import React, { useState } from "react";
import Slider from "react-slick";
import { Link } from "react-router-dom";
import Button from "../Common/Button/Button";
import BaseButton from "../Common/BaseButton/BaseButton";
import mockWorker from "../../assets/images/mock/mokPerson.png";
@ -67,9 +67,9 @@ export const SliderWorkers = ({ title, titleInfo, subTitle }) => {
<img src={worker.avatar}></img>
<div className="worker-description">
<p>{worker.skils}</p>
<Button styles="worker__resume">
<BaseButton styles="worker__resume">
<Link to={`/worker/${index}`}>Подробное резюме</Link>
</Button>
</BaseButton>
</div>
</div>
);

View File

@ -1,32 +0,0 @@
import React from "react";
import "./modalErrorLogin.scss";
export const ModalErrorLogin = ({ active, setActive, title }) => {
return (
<div
className={active ? "modal-error active" : "modal-error"}
onClick={() => setActive(false)}
>
<div
className="modal-error__content"
onClick={(e) => e.stopPropagation()}
>
<h2>Ошибка входа</h2>
<p>{title}</p>
<button
className="modal-error__content-button"
onClick={(e) => {
e.preventDefault();
setActive(false);
}}
>
Попробовать еще раз
</button>
<span onClick={() => setActive(false)}></span>
</div>
</div>
);
};
export default ModalErrorLogin;

View File

@ -1,77 +0,0 @@
.modal-error {
z-index: 9;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.11);
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
transform: scale(0);
&__content {
position: relative;
padding: 54px 76px;
background: linear-gradient(180deg, #ffffff 0%, #ebebeb 100%);
border-radius: 40px;
display: flex;
flex-direction: column;
align-items: center;
h2 {
font-size: 24px;
line-height: 29px;
color: #263238;
margin-bottom: 16px;
}
p {
font-size: 12px;
line-height: 14px;
width: 176px;
text-align: center;
font-weight: 300;
margin-bottom: 30px;
}
&-button {
color: white;
font-size: 14px;
line-height: 32px;
width: 198px;
height: 50px;
background: #52b709;
border-radius: 44px;
border: none;
}
span {
cursor: pointer;
position: absolute;
top: 30px;
right: 36px;
&:before,
&:after {
content: "";
position: absolute;
width: 16px;
height: 2px;
background: #263238;
}
&:before {
transform: rotate(45deg);
}
&:after {
transform: rotate(-45deg);
}
}
}
}
.modal-error.active {
transform: scale(1);
}

View File

@ -13,7 +13,7 @@ import { ProfileBreadcrumbs } from "../../components/ProfileBreadcrumbs/ProfileB
import { SliderWorkers } from "../../components/SliderWorkers/SliderWorkers";
import { Loader } from "../../components/Loader/Loader";
import { Footer } from "../../components/Footer/Footer";
import Button from "../../components/Common/Button/Button";
import BaseButton from "../../components/Common/BaseButton/BaseButton";
import cursorImg from "../../assets/icons/cursorImg.svg";
@ -82,12 +82,12 @@ export const PartnerRequests = () => {
Оператор компании заводит заявку и указывает необходимые
параметры количество сотрудников, стек, уровень специалиста
</p>
<Button>
<BaseButton>
<Link to={"/profile/add-request"}>
<span>+</span>
Создать запрос
</Link>
</Button>
</BaseButton>
</div>
</div>
)}
@ -97,12 +97,12 @@ export const PartnerRequests = () => {
<div className="partnerRequests__noItems__create__link">
<img src={cursorImg} alt="cursor" />
<p>У вас еще нет запросов на сотрудников</p>
<Button>
<BaseButton>
<Link to={"/profile/add-request"}>
<span>+</span>
Создать запрос
</Link>
</Button>
</BaseButton>
</div>
<div className="partnerRequests__noItems__create__instruction">
<h3>Инструкция: подачи заявки</h3>

View File

@ -4,7 +4,7 @@ import { Footer } from "../../components/Footer/Footer";
import { ProfileBreadcrumbs } from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { ProfileHeader } from "../../components/ProfileHeader/ProfileHeader";
import { Navigation } from "../../components/Navigation/Navigation";
import Button from "../../components/Common/Button/Button";
import BaseButton from "../../components/Common/BaseButton/BaseButton";
import kontur from "../../assets/images/logo/konturLogo.png";
import astral from "../../assets/images/logo/astralLogo.png";
@ -40,8 +40,12 @@ export const PartnerSettings = () => {
</div>
<div className="settings__buttons">
<Button styles={"settings__buttons-cancel"}>Отмена</Button>
<Button styles={"settings__buttons-save"}>Сохранить</Button>
<BaseButton styles={"settings__buttons-cancel"}>
Отмена
</BaseButton>
<BaseButton styles={"settings__buttons-save"}>
Сохранить
</BaseButton>
</div>
<span className="settings__agreement">
Нажимая "Сохранить", вы соглашаетесь с Правилами обработки и
@ -77,8 +81,12 @@ export const PartnerSettings = () => {
</div>
<div className="settings__buttons">
<Button styles={"settings__buttons-cancel"}>Отмена</Button>
<Button styles={"settings__buttons-save"}>Сохранить</Button>
<BaseButton styles={"settings__buttons-cancel"}>
Отмена
</BaseButton>
<BaseButton styles={"settings__buttons-save"}>
Сохранить
</BaseButton>
</div>
<span className="settings__agreement">
Нажимая "Сохранить", вы соглашаетесь с Правилами обработки и

View File

@ -22,7 +22,7 @@ import {
deletePersonOnProject,
} from "../../redux/projectsTrackerSlice";
import ModalTicket from "../../components/UI/ModalTicket/ModalTicket";
import ModalTicket from "../../components/Modal/Tracker/ModalTicket/ModalTicket";
import TrackerModal from "../../components/UI/TrackerModal/TrackerModal";
import project from "../../assets/icons/trackerProject.svg";