loaders, outSelectClose, notifications

This commit is contained in:
Mikola
2024-02-13 15:32:32 +03:00
parent 4d2ccf91eb
commit 992afead80
3 changed files with 38 additions and 3 deletions

View File

@ -56,6 +56,7 @@ export const PartnerAddRequest = () => {
}
useEffect(() => {
initListeners();
apiRequest(`/profile/positions-list`).then((el) =>
setSpecializationList(el)
);
@ -141,6 +142,31 @@ export const PartnerAddRequest = () => {
}
};
const initListeners = () => {
document.addEventListener("click", closeByClickingOut);
};
const closeByClickingOut = (event) => {
const path = event.path || (event.composedPath && event.composedPath());
if (
event &&
!path.find(
(div) =>
div.classList &&
(div.classList.contains("form__block__section__selects") ||
div.classList.contains("form__block__dropDown")
|| div.classList.contains("form__block__skills") ||
div.classList.contains("form__block__section__select"))
)
) {
setOpenSkillsSelect(false)
setOpenSpecializationListOpen(false)
setOpenLevelList(false)
setOpenCountList(false)
}
};
return (
<div className="partnerAddRequest">
<ProfileHeader />