Skip to content

Commit

Permalink
fixes: bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ayussh-2 committed Oct 25, 2024
1 parent 0cdbfd0 commit 3b58209
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/Marginals/navbar/navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ const Navbar = () => {
</HamburgerContainer>

<AnimatePresence mode='wait'>
{isProfileOpen && <ProfileMenu handleProfileToggle={handleProfileToggle} />}
{isProfileOpen && (
<ProfileMenu handleProfileToggle={handleProfileToggle} handleNavClose={setIsOpen} />
)}
</AnimatePresence>

<MobileMenu
Expand Down
9 changes: 7 additions & 2 deletions src/components/ProfileMenu/ProfileMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
menuTransition,
} from './ProfileMenu.styles';

function ProfileMenu({ handleProfileToggle }) {
function ProfileMenu({ handleProfileToggle, handleNavClose }) {
const { handleSignOut } = useContext(AuthContext);
const getUserDetails = useUserDetails();
const user = getUserDetails();
Expand All @@ -26,6 +26,11 @@ function ProfileMenu({ handleProfileToggle }) {
handleProfileToggle();
};

const handleCloseMenu = () => {
handleProfileToggle();
handleNavClose(false);
};

return (
<Container>
<MenuCard
Expand All @@ -36,7 +41,7 @@ function ProfileMenu({ handleProfileToggle }) {
key='profile-menu'
>
<MenuContent>
<CloseButton onClick={handleProfileToggle}>X</CloseButton>
<CloseButton onClick={handleCloseMenu}>X</CloseButton>
<UserName>{user?.name}</UserName>
<UserEmail>{user?.email}</UserEmail>
<MenuLinks>
Expand Down

0 comments on commit 3b58209

Please sign in to comment.