Skip to content

Commit 713dc47

Browse files
committed
feat(mobile): add PortalProvider to EntryContentWebView and adjust ActivityIndicator
- Wrap EntryItem content with PortalProvider for better portal management - Simplify ActivityIndicator by removing explicit size prop - Improve WebView content loading experience in entry list Signed-off-by: Innei <tukon479@gmail.com>
1 parent 8e99f1a commit 713dc47

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

apps/mobile/src/components/native/webview/EntryContentWebView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function EntryContentWebView(props: EntryContentWebViewProps) {
6060
<Portal>
6161
{!entry.content && (
6262
<View className="absolute inset-0 items-center justify-center">
63-
<ActivityIndicator size={"large"} />
63+
<ActivityIndicator />
6464
</View>
6565
)}
6666
</Portal>

apps/mobile/src/modules/entry-list/entry-list.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FeedViewType } from "@follow/constants"
22
import { useTypeScriptHappyCallback } from "@follow/hooks"
3+
import { PortalProvider } from "@gorhom/portal"
34
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs"
45
import { FlashList } from "@shopify/flash-list"
56
import { Image } from "expo-image"
@@ -151,12 +152,14 @@ function EntryItem({ entryId }: { entryId: string }) {
151152
<ContextMenu.Content>
152153
<ContextMenu.Preview size="STRETCH" onPress={handlePress}>
153154
{() => (
154-
<View className="bg-system-background flex-1">
155-
<Text className="text-label mt-5 p-4 text-2xl font-semibold" numberOfLines={2}>
156-
{title}
157-
</Text>
158-
<EntryContentWebView entry={entry} />
159-
</View>
155+
<PortalProvider>
156+
<View className="bg-system-background flex-1">
157+
<Text className="text-label mt-5 p-4 text-2xl font-semibold" numberOfLines={2}>
158+
{title}
159+
</Text>
160+
<EntryContentWebView entry={entry} />
161+
</View>
162+
</PortalProvider>
160163
)}
161164
</ContextMenu.Preview>
162165
</ContextMenu.Content>

0 commit comments

Comments
 (0)