Merged in chore/remove-unused-env-vars (pull request #2463)
chore: Remove unused env vars and feature toggles * Remove unused env vars and feature toggles Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
"use client"
|
||||
|
||||
import { env } from "@/env/client"
|
||||
|
||||
import useLang from "./useLang"
|
||||
|
||||
export function useIsLangLive(): boolean {
|
||||
const lang = useLang()
|
||||
return env.isLangLive(lang)
|
||||
}
|
||||
@@ -9,8 +9,6 @@ import useStickyPositionStore, {
|
||||
|
||||
import { debounce } from "@/utils/debounce"
|
||||
|
||||
import { useIsLangLive } from "./useIsLangLive"
|
||||
|
||||
interface UseStickyPositionProps {
|
||||
ref?: React.RefObject<HTMLElement | null>
|
||||
name?: StickyElementNameEnum
|
||||
@@ -47,7 +45,6 @@ export default function useStickyPosition({
|
||||
getAllElements,
|
||||
} = useStickyPositionStore()
|
||||
|
||||
const isLangLive = useIsLangLive()
|
||||
/* 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
|
||||
@@ -125,12 +122,10 @@ export default function useStickyPosition({
|
||||
updateHeights()
|
||||
|
||||
// Only do this special handling if we have the current header
|
||||
if (!isLangLive) {
|
||||
if (document.body.clientWidth > 950) {
|
||||
setBaseTopOffset(0)
|
||||
} else {
|
||||
setBaseTopOffset(52.41) // The height of current mobile header
|
||||
}
|
||||
if (document.body.clientWidth > 950) {
|
||||
setBaseTopOffset(0)
|
||||
} else {
|
||||
setBaseTopOffset(52.41) // The height of current mobile header
|
||||
}
|
||||
}, 100)
|
||||
|
||||
@@ -144,7 +139,7 @@ export default function useStickyPosition({
|
||||
resizeObserver.unobserve(document.body)
|
||||
}
|
||||
}
|
||||
}, [updateHeights, isLangLive])
|
||||
}, [updateHeights])
|
||||
|
||||
return {
|
||||
currentHeight: ref?.current?.offsetHeight || null,
|
||||
|
||||
Reference in New Issue
Block a user