Skip to content

Commit

Permalink
Merge pull request #69 from Elizabethhub/dmytro-prymache-header-start…
Browse files Browse the repository at this point in the history
…-page

Update HeaderModal.jsx
  • Loading branch information
Elizabethhub authored Mar 19, 2024
2 parents 5784177 + 7729e74 commit ad6222f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/Header/HeaderModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,23 @@ const HeaderModal = () => {
}, [isModalOpen, isHeaderModalOpen, isHeaderModalLogOut]);

useEffect(() => {
if (isModalOpen || isHeaderModalOpen || isHeaderModalLogOut) {
if (isModalOpen || isHeaderModalLogOut) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = 'auto';
}
}, [isModalOpen, isHeaderModalOpen, isHeaderModalLogOut]);

useEffect(() => {
if (userProfile) {
userProfile?.avatarURL;
setImageUser(userProfile.avatarURL);
if (userProfile && userProfile.avatarURL) {
let avatarURL = userProfile.avatarURL;

if (avatarURL.startsWith('avatars')) {
avatarURL = `https://byte-water-back.onrender.com/${avatarURL}`;
}
setImageUser(avatarURL);
}
}, [userProfile, userProfile?.avatarURL]);
}, [userProfile]);

const openModal = () => {
setIsModalOpen(true);
Expand Down

0 comments on commit ad6222f

Please sign in to comment.