From a158f5a0582ea1b0d42d610d838d5a4b709ee26e Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:36:47 +0200 Subject: [PATCH] fix: Navbar overlays mispositioned on startup --- apps/frontend/src/ui/components/Navbar.tsx | 67 +++++++++++----------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/apps/frontend/src/ui/components/Navbar.tsx b/apps/frontend/src/ui/components/Navbar.tsx index c25a48c2..d507cf93 100644 --- a/apps/frontend/src/ui/components/Navbar.tsx +++ b/apps/frontend/src/ui/components/Navbar.tsx @@ -9,7 +9,6 @@ import PolyfrostFull from './logos/PolyfrostFull'; import AccountPopup from './overlay/account/AccountsPopup'; import useAccountController from './overlay/account/AddAccountModal'; import NotificationPopup from './overlay/notifications/NotificationPopup'; -import Popup from './overlay/Popup'; interface NavbarLinkProps { path: string; @@ -37,8 +36,8 @@ function Navbar() { const navigate = useNavigate(); - let profileButton!: HTMLButtonElement; - let notificationButton!: HTMLButtonElement; + let profileButtonContainer!: HTMLDivElement; + let notificationButtonContainer!: HTMLDivElement; return (
@@ -62,14 +61,23 @@ function Navbar() { {/* Notification Manager Button */} - +
+ + + el.classList.add('right-0')} + setVisible={setNotificationMenuOpen} + visible={notificationMenuOpen} + /> +
{/* Launcher Settings Button */} {/* Account Menu Button */} - +
+ + + el.classList.add('right-0')} + setVisible={setProfileMenuOpen} + visible={profileMenuOpen} + /> +
- - Popup.setPos(profileButton, el)} - setVisible={setProfileMenuOpen} - visible={profileMenuOpen} - /> - - Popup.setPos(notificationButton, el)} - setVisible={setNotificationMenuOpen} - visible={notificationMenuOpen} - /> ); }