diff --git a/src/components/AuthBlock/authBlock.scss b/src/components/AuthBlock/authBlock.scss index b59fe3ec..7884f9d2 100644 --- a/src/components/AuthBlock/authBlock.scss +++ b/src/components/AuthBlock/authBlock.scss @@ -101,6 +101,21 @@ line-height: 32px; color: white; height: 45px; + + @media (max-width: 900px) { + max-width: 185px; + } + + @media (max-width: 450px) { + width: 100%; + max-width: none; + margin-right: 0; + } + } + + @media (max-width: 450px) { + flex-direction: column; + row-gap: 10px; } } @@ -139,6 +154,11 @@ transform: scale(1.03); color: white; } + + @media (max-width: 450px) { + width: 100%; + max-width: none; + } } &__img { diff --git a/src/components/Modal/ModalTrackerRegistration/ModalTrackerRegistration.js b/src/components/Modal/ModalTrackerRegistration/ModalTrackerRegistration.js index 049a0871..fb609a3e 100644 --- a/src/components/Modal/ModalTrackerRegistration/ModalTrackerRegistration.js +++ b/src/components/Modal/ModalTrackerRegistration/ModalTrackerRegistration.js @@ -1,5 +1,6 @@ import React from "react"; +import { Link } from "react-router-dom"; import close from "assets/icons/closeProjectPersons.svg"; import "./modalTrackerRegistration.scss"; @@ -16,12 +17,13 @@ export const ModalTrackerRegistration = ({ setModalReset, email }) => { для активации вашего аккаунта на почту
{email}

- + setModalReset(false)} src={close} diff --git a/src/components/PartnerPersonCard/PartnerPersonCard.jsx b/src/components/PartnerPersonCard/PartnerPersonCard.jsx new file mode 100644 index 00000000..7d7db5b3 --- /dev/null +++ b/src/components/PartnerPersonCard/PartnerPersonCard.jsx @@ -0,0 +1,28 @@ +import React from "react"; +import { Link } from "react-router-dom"; +import { urlForLocal } from "@utils/helper"; + +import rightArrow from "assets/icons/arrows/arrowRight.svg"; + +import "./partnerPersonCard.scss"; + +export const PartnerPersonCard = ({name, img, userId}) => { + return ( +
+
+ avatar +
+
+

{name}

+ + Подробный отчет +
+ arrow +
+ +
+
+ ); +}; + +export default PartnerPersonCard; diff --git a/src/components/PartnerPersonCard/partnerPersonCard.scss b/src/components/PartnerPersonCard/partnerPersonCard.scss new file mode 100644 index 00000000..5ca095f4 --- /dev/null +++ b/src/components/PartnerPersonCard/partnerPersonCard.scss @@ -0,0 +1,45 @@ +.partnerPersonCard { + display: flex; + position: relative; + + &__img { + background: white; + border-radius: 12px; + padding: 25px; + z-index: 2; + img { + width: 77px; + height: 77px; + } + } + + &__info { + position: relative; + background: #E1FCCF; + z-index: 1; + padding: 15px 15px 15px 30px; + left: -15px; + border-radius: 12px; + display: flex; + flex-direction: column; + justify-content: space-between; + } + + &__report { + display: flex; + column-gap: 10px; + color: black; + font-size: 16px; + align-items: center; + } + + &__more { + width: 41px; + height: 41px; + background: white; + border-radius: 50px; + display: flex; + justify-content: center; + align-items: center; + } +} diff --git a/src/pages/PartnerСategories/partnerСategories.scss b/src/pages/PartnerСategories/partnerСategories.scss index 36cf1a7f..6b01d99a 100644 --- a/src/pages/PartnerСategories/partnerСategories.scss +++ b/src/pages/PartnerСategories/partnerСategories.scss @@ -14,6 +14,7 @@ &__items { display: flex; gap: 10px; + flex-wrap: wrap; //flex-wrap: wrap; //margin-top: 25px; //row-gap: 24px; diff --git a/src/pages/TrackerRegistration/TrackerRegistration.js b/src/pages/TrackerRegistration/TrackerRegistration.js index 2aa01647..76bd9d82 100644 --- a/src/pages/TrackerRegistration/TrackerRegistration.js +++ b/src/pages/TrackerRegistration/TrackerRegistration.js @@ -5,6 +5,9 @@ import { Footer } from "@components/Common/Footer/Footer"; import ModalLayout from "@components/Common/ModalLayout/ModalLayout"; import { ModalTrackerRegistration } from "@components/Modal/ModalTrackerRegistration/ModalTrackerRegistration"; import SideBar from "@components/SideBar/SideBar"; +import { useFormValidation } from "@hooks/useFormValidation"; +import { useNotification } from "@hooks/useNotification"; +import { Navigate } from "react-router-dom"; import arrowInfo from "assets/icons/trackerIntroInfo.svg"; import authImg from "assets/images/partnerProfile/authCandidateFormImg.png"; @@ -14,9 +17,42 @@ import "./trackerRegistration.scss"; export const TrackerRegistration = () => { const [modalConfirmOpen, setModalConfirm] = useState(false); - const [inputs, setInputs] = useState({ - email: "" - }); + const fields = { + username: "", + email: "", + password: "", + secondPassword: "" + }; + + const apiEndpoint = "/register/sign-up"; + + const { showNotification } = useNotification(); + const showNotificationError = () => { + showNotification({ + show: true, + text: "Аккаунт с таким логином или email уже существует", + type: "error" + }); + }; + const showNotificationTrue = () => { + showNotification({ + show: true, + text: "Аккаунт успешно создан", + type: "success" + }); + }; + + const { + formData, + validationErrors, + handleChange, + handleSubmit, + } = useFormValidation( + apiEndpoint, + fields, + showNotificationError, + showNotificationTrue, + ); return (
@@ -34,33 +70,64 @@ export const TrackerRegistration = () => {
- Ваше имя - -
-
- Ваш e-mail +
Ваше имя
- setInputs((prevState) => ({ - ...prevState, - email: e.target.value - })) - } - type="email" + placeholder="Имя" + className={validationErrors.username ? "error" : ""} + onChange={handleChange} + value={formData.username} + id="username" /> + {validationErrors.username}
- Придумайте пароль - +
Ваш e-mail
+ + {validationErrors.email}
- Повторите пароль - +
Придумайте пароль
+ + {validationErrors.password} +
+
+
Повторите пароль
+ + {validationErrors.secondPassword}
- +
img

@@ -80,7 +147,7 @@ export const TrackerRegistration = () => { )} diff --git a/src/pages/TrackerRegistration/trackerRegistration.scss b/src/pages/TrackerRegistration/trackerRegistration.scss index 12eb2d12..c5089fe4 100644 --- a/src/pages/TrackerRegistration/trackerRegistration.scss +++ b/src/pages/TrackerRegistration/trackerRegistration.scss @@ -41,6 +41,7 @@ &__submit { display: flex; align-items: center; + margin-top: 5px; button { border-radius: 44px; @@ -106,15 +107,18 @@ &__inputContainer { display: flex; flex-direction: column; - row-gap: 15px; max-width: 300px; width: 100%; margin-bottom: 44px; + h5 { + font-size: 15px; + } + span { font-weight: 400; - font-size: 15px; - color: #000; + font-size: 12px; + color: red; } input { @@ -122,6 +126,7 @@ padding: 8px 12px 9px; background-color: #EFF2F7; border-radius: 8px; + margin: 10px 0; border: none; font-weight: 400; font-size: 15px; @@ -132,5 +137,9 @@ margin-bottom: 0; max-width: none; } + + .error { + border: 1px solid red; + } } }