Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Jan 8, 2025
1 parent 56e3388 commit b601e41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const PrimaryNavToggle = (props: PrimaryNavToggleProps) => {
},
},
}}
placement="left"
placement="top-end"
title={isCollapsed ? 'pin side menu' : 'unpin side menu'}
>
<StyledIconButton
Expand Down
8 changes: 8 additions & 0 deletions packages/manager/src/components/PrimaryNav/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const linkIsActive = (
return isPathOneOf([href, ...activeLinks], locationPathname);
};

/**
* This hook is used to determine if the page is scrollable.
* It is used to determine if the side menu should be sticky.
*/
export const useIsPageScrollable = (
contentRef: React.RefObject<HTMLElement>
): { isPageScrollable: boolean } => {
Expand Down Expand Up @@ -55,6 +59,10 @@ export const useIsPageScrollable = (
return { isPageScrollable };
};

/**
* This hook is used to determine if the window is at the bottom of the page.
* It is used to adjust the position of the pin menu button with the footer.
*/
export const useIsWindowAtBottom = () => {
const isAtBottom = useScrollTrigger({
disableHysteresis: true,
Expand Down

0 comments on commit b601e41

Please sign in to comment.