From 7d7b9fdf07848db938a410826a2719b7e946581b Mon Sep 17 00:00:00 2001 From: Notsmartname Date: Sun, 19 May 2024 21:44:14 +0500 Subject: [PATCH 1/6] Added NEWS_NAME and NEWS_TEXT --- src/utils/errorMessage.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/utils/errorMessage.js b/src/utils/errorMessage.js index ea8d00a6..7caed5c1 100644 --- a/src/utils/errorMessage.js +++ b/src/utils/errorMessage.js @@ -124,4 +124,16 @@ export const DONATION_AMOUNT = { TOO_LONG: tooLong, NOT_FOUND: 'Введите сумму пожертвования', IS_ZERO: 'Cумма должно превышать нулевое значение', +}; + +// название новости +export const NEWS_NAME = { + NOT_FOUND: 'Введите название новости', + TOO_LONG: 'Название новости не может превышать 1 500 симоволов', +}; + +// текст новости +export const NEWS_TEXT = { + NOT_FOUND: 'Введите текст новости', + TOO_SHORT: 'Текст новости не может быть меньше 15 000 симоволов', }; \ No newline at end of file From def8c80ebfe49b96b5d32a26ab3ab407f33f9f02 Mon Sep 17 00:00:00 2001 From: Notsmartname Date: Sun, 19 May 2024 21:49:12 +0500 Subject: [PATCH 2/6] =?UTF-8?q?=D0=92=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D1=85=D0=BE=D0=B4=D0=B0=20=D0=BD=D0=B0=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BD=D0=BE=D0=B2=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/ShelterNews/ShelterNews.jsx | 10 ++++++---- src/modules/ShelterNews/ShelterNews.scss | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/ShelterNews/ShelterNews.jsx b/src/modules/ShelterNews/ShelterNews.jsx index 2d2361b1..6602fcf6 100644 --- a/src/modules/ShelterNews/ShelterNews.jsx +++ b/src/modules/ShelterNews/ShelterNews.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { useOutletContext, useParams } from 'react-router-dom'; +import { useOutletContext, useParams, Link } from 'react-router-dom'; import './ShelterNews.scss'; import NewsSection from '../NewsSection/NewsSection'; import { Button } from '../../ui'; @@ -12,10 +12,12 @@ const ShelterNews = () => {

Новости приюта

- + > + +
diff --git a/src/modules/ShelterNews/ShelterNews.scss b/src/modules/ShelterNews/ShelterNews.scss index 5f63c380..80cb6348 100644 --- a/src/modules/ShelterNews/ShelterNews.scss +++ b/src/modules/ShelterNews/ShelterNews.scss @@ -11,10 +11,7 @@ } .shelter-section__btn-news { - padding: 12px 26px; - font-size: 16px; min-width: 250px; - height: 44px; } .shelter-section__btn-more { From eb8e7e8c3b9313aa3e1e9de83682f79379ea2538 Mon Sep 17 00:00:00 2001 From: Notsmartname Date: Sun, 19 May 2024 21:50:31 +0500 Subject: [PATCH 3/6] Fix Label in AddPhotoBlock --- src/ui/AddPhotoBlock/styles/__label/add-photo-block__label.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ui/AddPhotoBlock/styles/__label/add-photo-block__label.scss b/src/ui/AddPhotoBlock/styles/__label/add-photo-block__label.scss index 672d64d8..0d2f1863 100644 --- a/src/ui/AddPhotoBlock/styles/__label/add-photo-block__label.scss +++ b/src/ui/AddPhotoBlock/styles/__label/add-photo-block__label.scss @@ -1,9 +1,7 @@ .add-photo-block__label { display: flex; - margin: 0 0 8px; padding: 0; font-size: 16px; - line-height: 19px; font-weight: 500; &-tooltop-svg { From 69268491a76a4b012744c70ba7de45ec83513ecb Mon Sep 17 00:00:00 2001 From: Notsmartname Date: Sun, 19 May 2024 21:51:37 +0500 Subject: [PATCH 4/6] Added component ConfirmPopup --- src/components/ConfirmPopup/ConfirmPopup.jsx | 75 ++++++++++++++++ src/components/ConfirmPopup/ConfirmPopup.scss | 89 +++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 src/components/ConfirmPopup/ConfirmPopup.jsx create mode 100644 src/components/ConfirmPopup/ConfirmPopup.scss diff --git a/src/components/ConfirmPopup/ConfirmPopup.jsx b/src/components/ConfirmPopup/ConfirmPopup.jsx new file mode 100644 index 00000000..5cb87765 --- /dev/null +++ b/src/components/ConfirmPopup/ConfirmPopup.jsx @@ -0,0 +1,75 @@ +import React, { useEffect, useRef } from 'react'; +import { useNavigate } from 'react-router-dom'; +import './ConfirmPopup.scss'; +import { Button } from '../../ui'; +import DeleteIcon from '../../images/DeleteIcon/DeleteIcon'; + +const ConfirmPopup = ({ isOpen, question, onClose, desc = '', confirmBtnText, rejectBtnText, iconBasket }) => { + const popup = useRef(null); + const navigate = useNavigate(); + + const handleOverlayClose = (e) => { + const confirmPopup = e.target.classList; + if (confirmPopup.contains('popup_opened') || confirmPopup.contains('popup__button-close')) { + onClose(); + } + }; + + const handleEscClose = (e) => { + if (e.key === 'Escape') { + onClose(); + } + }; + + const handleCloseToNews = () => { + navigate(-1); + onClose(); + }; + + useEffect(() => { + document.addEventListener('keydown', handleEscClose); + document.addEventListener('click', handleOverlayClose); + return () => { + document.removeEventListener('keydown', handleEscClose); + document.removeEventListener('click', handleOverlayClose); + }; + }, []); + + return ( +
+
+

{question}

+ + {desc !== '' &&

{desc}

} + + + +
+
+ + ); +}; + +export default ConfirmPopup; diff --git a/src/components/ConfirmPopup/ConfirmPopup.scss b/src/components/ConfirmPopup/ConfirmPopup.scss new file mode 100644 index 00000000..776585cc --- /dev/null +++ b/src/components/ConfirmPopup/ConfirmPopup.scss @@ -0,0 +1,89 @@ +$images-path: '../../images'; + +.popup { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + background: rgba(0, 0, 0, 0.36); + position: fixed; + left: 0; + top: 0; + visibility: hidden; + opacity: 0; + transition: visibility 0.5s, opacity 0.5s ease-in-out; + z-index: 1; + + &_opened { + display: flex; + visibility: visible; + opacity: 1; + z-index: 2; + } + + &__content { + width: 100%; + max-width: 576px; + height: fit-content; + background-color: var(--color-background-additional); + border-radius: 30px; + display: flex; + flex-direction: column; + align-items: center; + position: relative; + padding: 80px 106px 60px; + + &-question, + &-descr { + text-align: center; + font-family: var(--font-family-title); + color: var(--color-text-base); + } + + &-question { + font-weight: 600; + line-height: normal; + font-size: 40px; + } + + &-descr { + font-weight: 500; + font-size: 24px; + } + + &-close { + background-image: url('#{$images-path}/icons/ic_button_close.svg'); + background-size: contain; + border: none; + width: 28px; + height: 28px; + background-color: rgba(0, 0, 0, 0); + padding: 0; + margin: 0; + transition: opacity 0.2s; + position: absolute; + top: 34px; + right: 80px; + + &:hover { + opacity: 0.6; + cursor: pointer; + } + } + + &-btn-group { + display: flex; + align-items: center; + gap: 20px; + margin-top: 20px; + + &-confirm { + display: flex; + align-items: center; + gap: 6px; + } + } + } + +} \ No newline at end of file From 99be3d22168dcef75bc1eb7764427f121d9a1ae5 Mon Sep 17 00:00:00 2001 From: Notsmartname Date: Sun, 19 May 2024 21:52:30 +0500 Subject: [PATCH 5/6] Added component DeclarationTextarea --- .../DeclarationTextarea.jsx | 27 +++++++++++ .../DeclarationTextarea.scss | 48 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/ui/DeclarationTextarea/DeclarationTextarea.jsx create mode 100644 src/ui/DeclarationTextarea/DeclarationTextarea.scss diff --git a/src/ui/DeclarationTextarea/DeclarationTextarea.jsx b/src/ui/DeclarationTextarea/DeclarationTextarea.jsx new file mode 100644 index 00000000..cb841fda --- /dev/null +++ b/src/ui/DeclarationTextarea/DeclarationTextarea.jsx @@ -0,0 +1,27 @@ +import React from 'react'; +import './DeclarationTextarea.scss'; + +const DeclarationTextarea = ({ caption, inputState, name, placeholder, textRows, textCols, required, showError = true }) => { + return ( +
+ +