-
+
+
+
+
-
-
-
{shelter.name}
+
+
+
{shelter.name}
- {isOwner && (
- <>
- {/* TODO ведет на 6.2.1.4 в фигме, оно пока не реализовано */}
-
-
-
- {/* TODO при нажатии попап как на 6.2.1.3 в фигме, попап не сверстан */}
-
- >
- )}
-
-
-
- {shelter.address}
- {`${shelter.working_from_hour} - ${shelter.working_to_hour}`}
- {shelter.phone_number}
- {shelter.email}
- {shelter.web_site && (
-
-
- {shelter.web_site}
-
-
- )}
-
- {shelter.ok_page && (
-
-
-
+ {isOwner && (
+ <>
+ {/* TODO
ведет на 6.2.1.4 в фигме, оно пока не реализовано */}
+
+
+
+ {/* TODO при нажатии попап как на 6.2.1.3 в фигме, попап не сверстан */}
+
+ >
)}
+
- {shelter.vk_page && (
-
-
-
+
+ {shelter.vk_page && (
+
+
+
+ )}
+
+ {shelter.telegram && (
+
+
+
+ )}
+
+
+
-
-
Описание
-
- {shelter.description}
-
+
Описание
+
+ {shelter.description}
+
- {isOwner &&
}
+ {isOwner &&
}
-
- Собрано денег за всё время: {shelter.money_collected}
-
-
- Забрали животных за всё время: {shelter.animals_adopted}
-
+
+ Собрано денег за всё время: {shelter.money_collected}
+
+
+ Забрали животных за всё время: {shelter.animals_adopted}
+
+
+ {isOwner && (
+
+
+ Подключить платежную систему
+
+
+
+ )}
);
};
diff --git a/src/modules/AboutShelter/AboutShelter.scss b/src/modules/AboutShelter/AboutShelter.scss
index 53b8b19d..dbcea5ae 100644
--- a/src/modules/AboutShelter/AboutShelter.scss
+++ b/src/modules/AboutShelter/AboutShelter.scss
@@ -12,3 +12,14 @@
@import url('./styles/shelter-info/__link/shelter-info__link.css');
@import url('./styles/shelter-info/__icons/shelter-info__icons.css');
@import url('./styles/shelter-info/__icon/shelter-info__icon.css');
+
+.shelter-section__about {
+ display: flex;
+ gap: 44px;
+}
+
+.shelter-section__bottom {
+ display: flex;
+ gap: 16px;
+ flex-direction: column;
+}
\ No newline at end of file
diff --git a/src/modules/HelpToShelter/HelpToShelter.css b/src/modules/HelpToShelter/HelpToShelter.css
index 08eb34c5..33a50622 100644
--- a/src/modules/HelpToShelter/HelpToShelter.css
+++ b/src/modules/HelpToShelter/HelpToShelter.css
@@ -1,2 +1,16 @@
-@import url('./help-to-shelter/__title/help-to-shelter__title.css');
-@import url('./help-to-shelter/__button/help-to-shelter__button.css');
\ No newline at end of file
+.help-to-shelter {
+ gap: 40px;
+}
+
+.help-to-shelter__mat {
+ display: flex;
+ flex-direction: column;
+ max-width: 528px;
+ gap: 32px;
+}
+
+.help-to-shelter__nonmat {
+ display: flex;
+ flex-direction: column;
+ gap: 32px;
+}
\ No newline at end of file
diff --git a/src/modules/HelpToShelter/HelpToShelter.jsx b/src/modules/HelpToShelter/HelpToShelter.jsx
index 69f93abc..64e8e513 100644
--- a/src/modules/HelpToShelter/HelpToShelter.jsx
+++ b/src/modules/HelpToShelter/HelpToShelter.jsx
@@ -1,14 +1,38 @@
import React from 'react';
+import { useOutletContext } from 'react-router-dom';
import './HelpToShelter.css';
-import Button from '../../ui/Button/Button';
+import { Button } from '../../ui';
+import DeclarationInput from '../../ui/DeclarationInput/DeclarationInput';
+import * as regex from '../../utils/regex';
+import * as errorMessage from '../../utils/errorMessage';
+import useInput from '../../hooks/useInput';
const HelpToShelter = () => {
+ const materialAid = useInput('', { notEmpty: true, maxLength: 12, regex: regex.NUMBER }, errorMessage.DONATION_AMOUNT);
+ const { isOwner, isAuth, isShelterOwner } = useOutletContext();
+
return (
- Материальная помощь
-
- Нематериальная помощь
-
+ { !isOwner && (
+
+
Материальная помощь
+ { (isShelterOwner || isAuth) && (isAuth || isShelterOwner) && (
+
+ )}
+
+
+ )}
+
+
Нематериальная помощь
+
+
);
};
diff --git a/src/modules/HelpToShelter/help-to-shelter/__button/help-to-shelter__button.css b/src/modules/HelpToShelter/help-to-shelter/__button/help-to-shelter__button.css
deleted file mode 100644
index e79773ef..00000000
--- a/src/modules/HelpToShelter/help-to-shelter/__button/help-to-shelter__button.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.help-to-shelter__button {
- margin: 0 auto 40px 0;
-}
\ No newline at end of file
diff --git a/src/modules/HelpToShelter/help-to-shelter/__title/help-to-shelter__title.css b/src/modules/HelpToShelter/help-to-shelter/__title/help-to-shelter__title.css
deleted file mode 100644
index fc9d56af..00000000
--- a/src/modules/HelpToShelter/help-to-shelter/__title/help-to-shelter__title.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.help-to-shelter__title {
- margin-bottom: 24px;
-}
\ No newline at end of file
diff --git a/src/modules/PetModule/PetModule.jsx b/src/modules/PetModule/PetModule.jsx
index 905a187d..4330ff8d 100644
--- a/src/modules/PetModule/PetModule.jsx
+++ b/src/modules/PetModule/PetModule.jsx
@@ -17,7 +17,7 @@ const PetModule = () => {
SwiperCore.use([Navigation, Pagination, Scrollbar, A11y]);
const { id: shelterId, petId } = useParams();
const { shelter, isOwner } = useOutletContext();
-
+ // eslint-disable-next-line
const [{ name, age, breed, gallery, sex, sheltering_time }, setPet] = useState({}); // информация о питомце
const [isTakedHome, setIsTakedHome] = useState(false);
@@ -121,6 +121,7 @@ const PetModule = () => {
+ {/* eslint-disable-next-line */}
{renderLoadingOrValue(isLoadingReq, sheltering_time >= 0 ? sheltering_time : '~')}
В приюте
diff --git a/src/modules/ShelterVacancies/ShelterVacancies.jsx b/src/modules/ShelterVacancies/ShelterVacancies.jsx
index 691b8520..c902169a 100644
--- a/src/modules/ShelterVacancies/ShelterVacancies.jsx
+++ b/src/modules/ShelterVacancies/ShelterVacancies.jsx
@@ -7,16 +7,19 @@ import AddVacancyForm from './components/AddVacancyForm/AddVacancyForm';
import shelterVacanciesApi from './api';
import imageSuccess from '../../images/icons/ic_success.svg';
import InfoTooltip from '../../components/InfoTooltip/InfoTooltip';
+import EditVacancyForm from '../../components/VacancyCard/EditVacancyForm/EditVacancyForm';
const message = 'Вакансия успешно добавлена!';
+const messageEdit = 'Вакансия успешно изменена!';
const ShelterVacancies = () => {
const [infoTooltipOpen, setInfoTooltipOpen] = useState(false);
-
const [vacanciesList, setVacanciesList] = useState([]);
const [isOpenVacancyForm, setIsOpenVacancyForm] = useState(false);
-
const [isLoading, setIsLoading] = useState(true);
+ const [isEditFormOpen, setIsEditFormOpen] = useState(false);
+ const [editFormData, setEditFormData] = useState(null);
+ const [tooltipMessage, setTooltipMessage] = useState('');
const { shelter, isOwner } = useOutletContext();
@@ -33,6 +36,12 @@ const ShelterVacancies = () => {
});
}, [shelter.id]);
+ const openEditForm = (data) => {
+ setIsEditFormOpen(true);
+ setEditFormData(data);
+ setTooltipMessage(messageEdit);
+ };
+
const toggleVacancyForm = () => {
setIsOpenVacancyForm((prevOpen) => {
return !prevOpen;
@@ -49,10 +58,23 @@ const ShelterVacancies = () => {
setInfoTooltipOpen(false);
};
+ const handleDeleteVacancy = (id) => {
+ const updatedVacancies = vacanciesList.filter((vacancy) => {
+ return vacancy.id !== id;
+ });
+ setVacanciesList(updatedVacancies);
+ };
+
const handleSubmit = () => {
setIsOpenVacancyForm(false);
setInfoTooltipOpen(true);
+ if (isEditFormOpen) {
+ setTooltipMessage(messageEdit);
+ } else {
+ setTooltipMessage(message);
+ }
+
shelterVacanciesApi
.getVacanciesByShelterId(shelter.id)
.then((res) => {
@@ -76,7 +98,7 @@ const ShelterVacancies = () => {
Вакансии приюта «{shelter.name}»
{isOwner && (
-