fix(mobile): improve loading indicator visibility in NavigationHeader and feeds context menu

- Added z-index to the loading indicator in NavigationHeader to ensure it appears above other elements.
- Integrated PlatformActivityIndicator in the SubscriptionFeedCategoryContextMenu to display a loading state when fetching entries.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-04-17 23:42:41 +08:00
parent 8e9b92babc
commit 7801aef62b
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 6 additions and 2 deletions

View File

@ -334,7 +334,7 @@ export const InternalNavigationHeader = ({
{/* Only show loading indicator when headerTitle is not absolute */}
{!headerTitleAbsolute && isLoading && (
<View
className="absolute right-0"
className="absolute right-0 z-10"
style={{ transform: [{ translateX: "100%" }, { scale: 0.74 }] }}
>
<PlatformActivityIndicator size="small" />

View File

@ -9,6 +9,7 @@ import type { ListRenderItemInfo } from "react-native"
import { Alert, FlatList, View } from "react-native"
import { ContextMenu } from "@/src/components/ui/context-menu"
import { PlatformActivityIndicator } from "@/src/components/ui/loading/PlatformActivityIndicator"
import { views } from "@/src/constants/views"
import { useNavigation } from "@/src/lib/navigation/hooks"
import type { Navigation } from "@/src/lib/navigation/Navigation"
@ -322,7 +323,7 @@ export const SubscriptionFeedCategoryContextMenu = ({
const PreviewFeeds = (props: { id: string; view: FeedViewType }) => {
const { id: feedId } = props
const entryIds = useEntryIdsByFeedId(feedId)
usePrefetchEntries({ feedId, limit: 5 })
const { isLoading } = usePrefetchEntries({ feedId, limit: 5 })
const renderItem = useCallback(
({ item: id }: ListRenderItemInfo<string>) => (
@ -332,6 +333,9 @@ const PreviewFeeds = (props: { id: string; view: FeedViewType }) => {
)
return (
<View className="bg-system-background size-full flex-1">
{isLoading && !entryIds?.length && (
<PlatformActivityIndicator className="absolute inset-0 flex items-center justify-center" />
)}
<FlatList
scrollEnabled={false}
data={useMemo(() => entryIds?.slice(0, 5), [entryIds])}