about summary refs log tree commit diff
path: root/src/view/com/feeds
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-02-27 02:33:23 +0000
committerGitHub <noreply@github.com>2024-02-27 02:33:23 +0000
commit3ec4e034b79950b0d2ce43b6048dee3dd37c3747 (patch)
treeea90cc4f694d3e7d1f9b2f1d0e19782ff55ccfeb /src/view/com/feeds
parent771999761e9a69d4f884c1c75cf20fde5d149791 (diff)
downloadvoidsky-3ec4e034b79950b0d2ce43b6048dee3dd37c3747.tar.zst
Fix imprecise header height calculation (#2995)
* Remove dead code

* Fix header height calculation
Diffstat (limited to 'src/view/com/feeds')
-rw-r--r--src/view/com/feeds/FeedPage.tsx19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/view/com/feeds/FeedPage.tsx b/src/view/com/feeds/FeedPage.tsx
index 60814e837..2aacdb89d 100644
--- a/src/view/com/feeds/FeedPage.tsx
+++ b/src/view/com/feeds/FeedPage.tsx
@@ -200,21 +200,12 @@ export function FeedPage({
 function useHeaderOffset() {
   const {isDesktop, isTablet} = useWebMediaQueries()
   const {fontScale} = useWindowDimensions()
-  const {hasSession} = useSession()
   if (isDesktop || isTablet) {
     return 0
   }
-  if (hasSession) {
-    const navBarPad = 16
-    const navBarText = 21 * fontScale
-    const tabBarPad = 20 + 3 // nav bar padding + border
-    const tabBarText = 16 * fontScale
-    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
-  }
+  const navBarHeight = 42
+  const tabBarPad = 10 + 10 + 3 // padding + border
+  const normalLineHeight = 1.2
+  const tabBarText = 16 * normalLineHeight * fontScale
+  return navBarHeight + tabBarPad + tabBarText
 }