diff --git a/packages/common/hooks/useStickyPosition.ts b/packages/common/hooks/useStickyPosition.ts index e344684ca..5c84a3e09 100644 --- a/packages/common/hooks/useStickyPosition.ts +++ b/packages/common/hooks/useStickyPosition.ts @@ -1,6 +1,6 @@ "use client" -import { useCallback, useEffect, useState } from "react" +import { useCallback, useEffect } from "react" import useStickyPositionStore, { type StickyElement, @@ -43,15 +43,7 @@ export default function useStickyPosition({ updateHeights, getAllElements, } = useStickyPositionStore() - - /* Used for Current mobile header since that doesn't use this hook. - * - * Instead, calculate if the mobile header is shown and add the height of - * that "manually" to all offsets using this hook. - * - * TODO: Remove this and just use 0 when the current header has been removed. - */ - const [baseTopOffset, setBaseTopOffset] = useState(0) + const baseTopOffset = 0 useEffect(() => { if (ref && name) { @@ -119,13 +111,6 @@ export default function useStickyPosition({ if (!resizeObserver) { const debouncedResizeHandler = debounce(() => { updateHeights() - - // Only do this special handling if we have the current header - if (document.body.clientWidth > 950) { - setBaseTopOffset(0) - } else { - setBaseTopOffset(52.41) // The height of current mobile header - } }, 100) resizeObserver = new ResizeObserver(debouncedResizeHandler)