registration

This commit is contained in:
Mikola 2023-11-03 16:23:49 +03:00
parent 7304b01a5d
commit baf353d7cd
5 changed files with 66 additions and 46 deletions

View File

@ -8,14 +8,15 @@ export const AcceptModal = ({title, closeModal, agreeHandler }) => {
return (
<div className="backDrop">
<div className="acceptModal">
<h3 className="acceptModal__title">
{title}
</h3>
<h3 className="acceptModal__title">{title}</h3>
<div className="acceptModal__buttons">
<button className="agree" onClick={() => {
agreeHandler()
closeModal()
}}>
<button
className="agree"
onClick={() => {
agreeHandler();
closeModal();
}}
>
Да
</button>
<button className="cancel" onClick={closeModal}>

View File

@ -1,10 +1,10 @@
import React, { useState } from "react";
import { apiRequest } from "@api/request";
import BaseButton from "@components/Common/BaseButton/BaseButton";
import ModalLayout from "@components/Common/ModalLayout/ModalLayout";
import { apiRequest } from "@api/request";
import anyMoment from "assets/icons/anyMoment.svg";
import doc from "assets/icons/doc.svg";
import telegramLogo from "assets/icons/tgLogo.svg";
@ -13,10 +13,10 @@ import "./modalRegistration.scss";
export const ModalRegistration = ({ active, setActive }) => {
const [inputsValue, setInputsValue] = useState({
userName: '',
email: '',
password: ''
})
userName: "",
email: "",
password: "",
});
const submitHandler = () => {
apiRequest("/register/sign-up", {
@ -24,12 +24,12 @@ export const ModalRegistration = ({ active, setActive }) => {
data: {
username: inputsValue.userName,
email: inputsValue.email,
password: inputsValue.password
}
password: inputsValue.password,
},
}).then((data) => {
console.log(data)
})
}
console.log(data);
});
};
return (
<ModalLayout active={active} setActive={setActive} styles={"registration"}>
<div className="registration-body__left">
@ -45,14 +45,24 @@ export const ModalRegistration = ({ active, setActive }) => {
<div className="input-body__box">
<h5>Ваше имя</h5>
<input
onChange={(e) => setInputsValue((prevValue) => ({...prevValue, userName: e.target.value}))}
placeholder='Name'
onChange={(e) =>
setInputsValue((prevValue) => ({
...prevValue,
userName: e.target.value,
}))
}
placeholder="Name"
/>
<h5>E-mail</h5>
<input
type='email'
onChange={(e) => setInputsValue((prevValue) => ({...prevValue, email: e.target.value}))}
placeholder='Email'
type="email"
onChange={(e) =>
setInputsValue((prevValue) => ({
...prevValue,
email: e.target.value,
}))
}
placeholder="Email"
/>
</div>
@ -61,16 +71,25 @@ export const ModalRegistration = ({ active, setActive }) => {
{/*<input></input>*/}
<h5>Пароль</h5>
<input
type='password'
onChange={(e) => setInputsValue((prevValue) => ({...prevValue, password: e.target.value}))}
placeholder='Password'
type="password"
onChange={(e) =>
setInputsValue((prevValue) => ({
...prevValue,
password: e.target.value,
}))
}
placeholder="Password"
/>
</div>
</div>
<div className="button-box">
<BaseButton
onClick={() => submitHandler()}
styles={inputsValue.userName && inputsValue.email && inputsValue.password ? "button-box__submit" : "button-box__submit disable"}
styles={
inputsValue.userName && inputsValue.email && inputsValue.password
? "button-box__submit"
: "button-box__submit disable"
}
>
Отправить
</BaseButton>

View File

@ -1011,7 +1011,7 @@ export const ModalTiсket = ({
</div>
{acceptModalOpen && (
<AcceptModal
title={'Вы точно хотите переместить задачу в архив?'}
title={"Вы точно хотите переместить задачу в архив?"}
closeModal={closeAcceptModal}
agreeHandler={deleteTask}
/>

View File

@ -1208,9 +1208,10 @@ export const TicketFullScreen = () => {
</div>
{acceptModalOpen && (
<AcceptModal
title={'Вы точно хотите переместить задачу в архив?'}
title={"Вы точно хотите переместить задачу в архив?"}
closeModal={closeAcceptModal}
agreeHandler={deleteTask} />
agreeHandler={deleteTask}
/>
)}
<Footer />
</section>

View File

@ -33,13 +33,13 @@ import { useNotification } from "@hooks/useNotification";
import BaseButton from "@components/Common/BaseButton/BaseButton";
import { Footer } from "@components/Common/Footer/Footer";
import { Loader } from "@components/Common/Loader/Loader";
import AcceptModal from "@components/Modal/AcceptModal/AcceptModal";
import ModalTicket from "@components/Modal/Tracker/ModalTicket/ModalTicket";
import TrackerModal from "@components/Modal/Tracker/TrackerModal/TrackerModal";
import { Navigation } from "@components/Navigation/Navigation";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
import TrackerSelectColumn from "@components/TrackerSelectColumn/TrackerSelectColumn";
import AcceptModal from "@components/Modal/AcceptModal/AcceptModal";
import arrow from "assets/icons/arrows/arrowCalendar.png";
import arrowDown from "assets/icons/arrows/selectArrow.png";
@ -76,7 +76,7 @@ export const ProjectTracker = () => {
edit: false,
});
const [acceptModalOpen, setAcceptModalOpen] = useState(false);
const [currentColumnDelete, setCurrentColumnDelete] = useState(null)
const [currentColumnDelete, setCurrentColumnDelete] = useState(null);
const [color, setColor] = useState("#aabbcc");
const [tagInfo, setTagInfo] = useState({ description: "", name: "" });
const [checkBoxParticipateTasks, setCheckBoxParticipateTasks] =
@ -914,13 +914,12 @@ export const ProjectTracker = () => {
className="column__select__item"
onClick={() => {
if (column.tasks.length) {
setAcceptModalOpen(true)
setCurrentColumnDelete(column)
setAcceptModalOpen(true);
setCurrentColumnDelete(column);
} else {
deleteColumn(column)
}
}
deleteColumn(column);
}
}}
>
<img src={del} alt="delete" />
<span>Удалить</span>
@ -1068,7 +1067,7 @@ export const ProjectTracker = () => {
</div>
{acceptModalOpen && (
<AcceptModal
title={'В колонке еще есть задачи, Вы точно хотите удалить её ?'}
title={"В колонке еще есть задачи, Вы точно хотите удалить её ?"}
closeModal={closeAcceptModal}
agreeHandler={() => deleteColumn(currentColumnDelete)}
/>