diff --git a/packages/manager/src/MainContent.tsx b/packages/manager/src/MainContent.tsx index bdfb168bd59..cb97cea4b27 100644 --- a/packages/manager/src/MainContent.tsx +++ b/packages/manager/src/MainContent.tsx @@ -9,17 +9,18 @@ import { makeStyles } from 'tss-react/mui'; import Logo from 'src/assets/logo/akamai-logo.svg'; import { MainContentBanner } from 'src/components/MainContentBanner'; import { MaintenanceScreen } from 'src/components/MaintenanceScreen'; +import { SIDEBAR_WIDTH } from 'src/components/PrimaryNav/constants'; import { SideMenu } from 'src/components/PrimaryNav/SideMenu'; -import { SIDEBAR_WIDTH } from 'src/components/PrimaryNav/SideMenu'; +import { useIsPageScrollable } from 'src/components/PrimaryNav/utils'; import { SuspenseLoader } from 'src/components/SuspenseLoader'; import { useDialogContext } from 'src/context/useDialogContext'; -import { Footer } from 'src/features/Footer'; +import { FOOTER_HEIGHT, Footer } from 'src/features/Footer'; import { GlobalNotifications } from 'src/features/GlobalNotifications/GlobalNotifications'; import { notificationCenterContext, useNotificationContext, } from 'src/features/NotificationCenter/NotificationCenterContext'; -import { TopMenu } from 'src/features/TopMenu/TopMenu'; +import { TOPMENU_HEIGHT, TopMenu } from 'src/features/TopMenu/TopMenu'; import { useMutatePreferences, usePreferences, @@ -199,6 +200,7 @@ const IAM = React.lazy(() => ); export const MainContent = () => { + const contentRef = React.useRef(null); const { classes, cx } = useStyles(); const { data: isDesktopSidebarOpenPreference } = usePreferences( (preferences) => preferences?.desktop_sidebar_open @@ -239,6 +241,8 @@ export const MainContent = () => { const { isIAMEnabled } = useIsIAMEnabled(); + const { isPageScrollable } = useIsPageScrollable(contentRef); + /** * this is the case where the user has successfully completed signup * but needs a manual review from Customer Support. In this case, @@ -292,6 +296,11 @@ export const MainContent = () => { }); }; + const sideMenuContainerHeight = + isPageScrollable === true + ? '100vh' + : `calc(100vh - ${FOOTER_HEIGHT + TOPMENU_HEIGHT}px)`; + return (
@@ -303,90 +312,100 @@ export const MainContent = () => { openSideMenu={() => toggleMenu(true)} username={username} /> - toggleMenu(false)} - collapse={desktopMenuIsOpen || false} - desktopMenuToggle={desktopMenuToggle} - open={menuIsOpen} - /> -
- -
+ + toggleMenu(false)} + collapse={desktopMenuIsOpen || false} + desktopMenuToggle={desktopMenuToggle} + isPageScrollable={isPageScrollable} + open={menuIsOpen} + /> + +
- - - - }> - - - {isPlacementGroupsEnabled && ( + +
+ + + + }> + + + {isPlacementGroupsEnabled && ( + + )} - )} - - - - - - - - {isIAMEnabled && ( - - )} - - - - - - - {isDatabasesEnabled && ( - - )} - - {isACLPEnabled && ( - - )} - - {/** We don't want to break any bookmarks. This can probably be removed eventually. */} - - {/** - * This is the catch all routes that allows TanStack Router to take over. - * When a route is not found here, it will be handled by the migration router, which in turns handles the NotFound component. - * It is currently set to the migration router in order to incrementally migrate the app to the new routing. - * This is a temporary solution until we are ready to fully migrate to TanStack Router. - */} - - + + + + - - - + + {isIAMEnabled && ( + + )} + + + + + + + {isDatabasesEnabled && ( + + )} + + {isACLPEnabled && ( + + )} + + {/** We don't want to break any bookmarks. This can probably be removed eventually. */} + + {/** + * This is the catch all routes that allows TanStack Router to take over. + * When a route is not found here, it will be handled by the migration router, which in turns handles the NotFound component. + * It is currently set to the migration router in order to incrementally migrate the app to the new routing. + * This is a temporary solution until we are ready to fully migrate to TanStack Router. + */} + + + + + + - -
-
+
+
+