- {group.id !== "auth" && (
-
- )}
+
);
}
- // Track if we're in browser for portal rendering
- const [isBrowser, setIsBrowser] = useState(false);
- const [menuPosition, setMenuPosition] = useState({ top: 0, right: 0 });
-
- useEffect(() => {
- setIsBrowser(true);
- }, []);
-
- // Calculate menu position based on button location
- useEffect(() => {
- if (showMenu && menuButtonRef && isBrowser) {
- const rect = menuButtonRef.getBoundingClientRect();
- setMenuPosition({
- top: rect.bottom + 8, // 8px below the button
- right: globalThis.innerWidth - rect.right, // Align right edge with button
- });
- }
- }, [showMenu, menuButtonRef, isBrowser]);
-
- if (!showMenu || !menuButtonRef) {
- return null;
- }
-
- // Position menu as fixed overlay using calculated coordinates
- const menuStyle = {
- "--menu-top": `${menuPosition.top}px`,
- "--menu-right": `${menuPosition.right}px`,
- } as React.CSSProperties;
-
- // Backdrop element to be portaled to body
- const backdrop = (
-
+ const groups = getNavigationGroups(
+ isLoggedIn,
+ currentRoute,
+ navigationGroups,
);
- // Menu dropdown element to be portaled to body
- const menu = (
-