Something went wrong. Try again.
cee sky
Something went wrong. Try again.
1234567891011121314151617181920import {useWindowDimensions} from 'react-native'import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {useBreakpoints} from '#/alf'import {IS_NATIVE, IS_WEB} from '#/env'
export function useHeaderOffset() { const {gtMobile} = useBreakpoints() const {fontScale} = useWindowDimensions() const insets = useSafeAreaInsets() if (gtMobile && IS_WEB) { return 0 } const navBarHeight = 52 + (IS_NATIVE ? insets.top : 0) const tabBarPad = 10 + 10 + 3 // padding + border const normalLineHeight = 20 // matches tab bar const tabBarText = normalLineHeight * fontScale return navBarHeight + tabBarPad + tabBarText - 4 // for some reason, this calculation is wrong by 4 pixels, which we adjust}