Fix imprecise header height calculation (#2995)
* Remove dead code * Fix header height calculationzio/stable
parent
771999761e
commit
3ec4e034b7
|
@ -200,21 +200,12 @@ export function FeedPage({
|
||||||
function useHeaderOffset() {
|
function useHeaderOffset() {
|
||||||
const {isDesktop, isTablet} = useWebMediaQueries()
|
const {isDesktop, isTablet} = useWebMediaQueries()
|
||||||
const {fontScale} = useWindowDimensions()
|
const {fontScale} = useWindowDimensions()
|
||||||
const {hasSession} = useSession()
|
|
||||||
if (isDesktop || isTablet) {
|
if (isDesktop || isTablet) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
if (hasSession) {
|
const navBarHeight = 42
|
||||||
const navBarPad = 16
|
const tabBarPad = 10 + 10 + 3 // padding + border
|
||||||
const navBarText = 21 * fontScale
|
const normalLineHeight = 1.2
|
||||||
const tabBarPad = 20 + 3 // nav bar padding + border
|
const tabBarText = 16 * normalLineHeight * fontScale
|
||||||
const tabBarText = 16 * fontScale
|
return navBarHeight + tabBarPad + tabBarText
|
||||||
const magic = 7 * fontScale
|
|
||||||
return navBarPad + navBarText + tabBarPad + tabBarText + magic
|
|
||||||
} else {
|
|
||||||
const navBarPad = 16
|
|
||||||
const navBarText = 21 * fontScale
|
|
||||||
const magic = 4 * fontScale
|
|
||||||
return navBarPad + navBarText + magic
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue