2dc6932f29
* Rework discover-feed trending interstitial to take one row * Fix loading state * Try putting it at the top * Color consistency * Tweak some spacing * Show trending when progress guide is there
17 lines
603 B
TypeScript
17 lines
603 B
TypeScript
import {useWindowDimensions} from 'react-native'
|
|
|
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
|
|
|
export function useHeaderOffset() {
|
|
const {isDesktop, isTablet} = useWebMediaQueries()
|
|
const {fontScale} = useWindowDimensions()
|
|
if (isDesktop || isTablet) {
|
|
return 0
|
|
}
|
|
const navBarHeight = 52
|
|
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
|
|
}
|