From c9bae9404beb0be74ffc7cfb1165f926a2af7174 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 24 Jan 2025 10:50:14 +0800 Subject: [PATCH] fix: scroll header height --- apps/mobile/src/modules/entry-list/entry-list.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/mobile/src/modules/entry-list/entry-list.tsx b/apps/mobile/src/modules/entry-list/entry-list.tsx index 78396c643..41649f34a 100644 --- a/apps/mobile/src/modules/entry-list/entry-list.tsx +++ b/apps/mobile/src/modules/entry-list/entry-list.tsx @@ -1,7 +1,6 @@ import { FeedViewType } from "@follow/constants" import { useTypeScriptHappyCallback } from "@follow/hooks" import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs" -import { useHeaderHeight } from "@react-navigation/elements" import { FlashList } from "@shopify/flash-list" import { Image } from "expo-image" import { router } from "expo-router" @@ -14,6 +13,7 @@ import { NavigationContext, } from "@/src/components/common/SafeNavigationScrollView" import { ItemPressable } from "@/src/components/ui/pressable/item-pressable" +import { useDefaultHeaderHeight } from "@/src/hooks/useDefaultHeaderHeight" import { useSelectedFeed, useSelectedFeedTitle } from "@/src/modules/feed-drawer/atoms" import { useEntry } from "@/src/store/entry/hooks" @@ -21,6 +21,8 @@ import { ViewSelector } from "../feed-drawer/view-selector" import { LeftAction, RightAction } from "./action" import { EntryListContentGrid } from "./entry-list-gird" +const headerHideableBottomHeight = 58 + export function EntryListScreen({ entryIds }: { entryIds: string[] }) { const scrollY = useAnimatedValue(0) const selectedFeed = useSelectedFeed() @@ -31,7 +33,7 @@ export function EntryListScreen({ entryIds }: { entryIds: string[] }) { ({ scrollY }), [scrollY])}> ( @@ -44,7 +46,7 @@ export function EntryListScreen({ entryIds }: { entryIds: string[] }) { ), [], )} - headerHideableBottomHeight={45} + headerHideableBottomHeight={headerHideableBottomHeight} headerHideableBottom={ViewSelector} /> {view === FeedViewType.Pictures || view === FeedViewType.Videos ? ( @@ -59,7 +61,8 @@ export function EntryListScreen({ entryIds }: { entryIds: string[] }) { function EntryListContent({ entryIds }: { entryIds: string[] }) { const insets = useSafeAreaInsets() const tabBarHeight = useBottomTabBarHeight() - const headerHeight = useHeaderHeight() + const originalDefaultHeaderHeight = useDefaultHeaderHeight() + const headerHeight = originalDefaultHeaderHeight + headerHideableBottomHeight const { scrollY } = useContext(NavigationContext)! return (