From fb36a6149bb9be8dde36fd2e7926fce42abd6412 Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Mon, 9 Nov 2026 18:02:36 -0500 Subject: [PATCH] fix(mobile): keep loading skeletons below navigation headers --- apps/mobile/components/skeletons.tsx | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/apps/mobile/components/skeletons.tsx b/apps/mobile/components/skeletons.tsx index 142b1a6..591a335 100644 --- a/apps/mobile/components/skeletons.tsx +++ b/apps/mobile/components/skeletons.tsx @@ -4,9 +4,11 @@ import { useCollectionHeroLayout, } from "@/components/collection-hero" import { Link } from "expo-router" +import { useHeaderHeight } from "expo-router/react-navigation" import Reanimated from "react-native-reanimated" import { type ReactNode, type ComponentProps } from "react" import { + Platform, ScrollView, StyleSheet, View, @@ -18,7 +20,7 @@ import { import { contentBottomInset } from "@/components/player" import { carouselCardWidth, radius, spacing, useThemeColors } from "@/lib/theme" -/** Match the inset-adjusted lists used once screen data is available. */ +/** Reserve the transparent native header explicitly while skeletons cannot scroll. */ function SkeletonContent({ children, embedded = false, @@ -27,13 +29,17 @@ function SkeletonContent({ embedded?: boolean }) { const colors = useThemeColors() + const headerHeight = useHeaderHeight() if (embedded) return <>{children} return ( @@ -170,12 +176,16 @@ export function CarouselSkeleton() { } export function HomeSkeleton() { + const headerHeight = useHeaderHeight() const colors = useThemeColors() return ( @@ -200,6 +210,7 @@ export function CollectionDetailSkeleton({ onLayout?: () => void }) { const colors = useThemeColors() + const headerHeight = useHeaderHeight() const { landscape, coverSize: tabletCoverSize } = useCollectionHeroLayout() const coverSize = !round && landscape @@ -228,8 +239,11 @@ export function CollectionDetailSkeleton({ { flex: 1, backgroundColor: backgroundColor ?? colors.background }, style, ]} - contentContainerStyle={{ paddingBottom: contentBottomInset }} - contentInsetAdjustmentBehavior="automatic" + contentContainerStyle={{ + paddingTop: Platform.OS === "ios" ? headerHeight : 0, + paddingBottom: contentBottomInset, + }} + contentInsetAdjustmentBehavior="never" scrollEnabled={false} accessibilityLabel="Loading" >