Skip to content

Commit bf97861

Browse files
committed
fix(mobile): sheet modal corners and view
background - Updated the `EntryNormalItem` component to improve styling with rounded corners and overflow handling. - Integrated `ThemedBlurView` for a better visual effect in the play button area. - Modified layout structure in `_layout.tsx` and `(stack)/_layout.tsx` to ensure consistent background and overflow behavior. - Enhanced the animated stack with dynamic border radius based on scaling. Signed-off-by: Innei <tukon479@gmail.com>
1 parent ef4c864 commit bf97861

File tree

3 files changed

+34
-24
lines changed

3 files changed

+34
-24
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import { FeedViewType } from "@follow/constants"
22
import { formatEstimatedMins } from "@follow/utils"
33
import { router } from "expo-router"
44
import { useCallback, useEffect } from "react"
5-
import { ActivityIndicator, Text, TouchableOpacity, View } from "react-native"
5+
import { ActivityIndicator, StyleSheet, Text, TouchableOpacity, View } from "react-native"
66
import ReAnimated, { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated"
77

88
import { useUISettingKey } from "@/src/atoms/settings/ui"
9+
import { ThemedBlurView } from "@/src/components/common/ThemedBlurView"
910
import { preloadWebViewEntry } from "@/src/components/native/webview/EntryContentWebView"
1011
import { RelativeDateTime } from "@/src/components/ui/datetime/RelativeDateTime"
1112
import { FeedIcon } from "@/src/components/ui/icon/feed-icon"
@@ -127,7 +128,7 @@ export function EntryNormalItem({ entryId, extraData }: { entryId: string; extra
127128
uri: image,
128129
}}
129130
blurhash={blurhash}
130-
className="border-secondary-system-background size-24 rounded-md border"
131+
className="border-secondary-system-background size-24 overflow-hidden rounded-lg border"
131132
contentFit="cover"
132133
/>
133134
) : (
@@ -156,7 +157,8 @@ export function EntryNormalItem({ entryId, extraData }: { entryId: string; extra
156157
})
157158
}}
158159
>
159-
<View className="bg-gray-6/50 rounded-full p-2">
160+
<View className="overflow-hidden rounded-full p-2">
161+
<ThemedBlurView style={StyleSheet.absoluteFillObject} intensity={30} />
160162
{isPlaying ? (
161163
<PauseCuteFiIcon color="white" width={24} height={24} />
162164
) : isLoading ? (
@@ -222,7 +224,7 @@ const AspectRatioImage = ({
222224
height: scaledHeight,
223225
}}
224226
blurhash={blurhash}
225-
className="border-secondary-system-background border"
227+
className="border-secondary-system-background rounded-md border"
226228
contentFit="cover"
227229
/>
228230
</View>
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import { Stack } from "expo-router"
2+
import Animated, { interpolate, useAnimatedStyle } from "react-native-reanimated"
3+
import { useSheet } from "react-native-sheet-transitions"
24

35
export default function AppRootLayout() {
6+
const { scale } = useSheet()
7+
8+
const style = useAnimatedStyle(() => ({
9+
borderRadius: interpolate(scale.value, [0.8, 0.99, 1], [0, 50, 0]),
10+
}))
411
return (
5-
<Stack
6-
screenOptions={{
7-
headerShown: false,
8-
}}
9-
/>
12+
<Animated.View className={"flex-1 overflow-hidden"} style={style}>
13+
<Stack
14+
screenOptions={{
15+
headerShown: false,
16+
}}
17+
/>
18+
</Animated.View>
1019
)
1120
}

apps/mobile/src/screens/_layout.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import analytics from "@react-native-firebase/analytics"
44
import { Stack, usePathname } from "expo-router"
55
import { useColorScheme } from "nativewind"
66
import { useEffect } from "react"
7-
import { useSheet } from "react-native-sheet-transitions"
7+
import { View } from "react-native"
88

99
import { FullWindowOverlay } from "../components/common/FullWindowOverlay"
1010
import { useIntentHandler } from "../hooks/useIntentHandler"
1111
import { DebugButton, EnvProfileIndicator } from "../modules/debug"
1212
import { RootProviders } from "../providers"
1313
import { usePrefetchSessionUser } from "../store/user/hooks"
14-
import { getSystemBackgroundColor } from "../theme/utils"
1514

1615
export default function RootLayout() {
1716
useColorScheme()
@@ -34,35 +33,35 @@ export default function RootLayout() {
3433
}, [pathname])
3534

3635
return (
37-
<RootProviders>
38-
<Session />
39-
<AnimatedStack />
36+
<View className="flex-1 bg-black">
37+
<RootProviders>
38+
<Session />
39+
<AnimatedStack />
4040

41-
{__DEV__ && <DebugButton />}
42-
<FullWindowOverlay>
43-
<EnvProfileIndicator />
44-
</FullWindowOverlay>
45-
</RootProviders>
41+
{__DEV__ && <DebugButton />}
42+
<FullWindowOverlay>
43+
<EnvProfileIndicator />
44+
</FullWindowOverlay>
45+
</RootProviders>
46+
</View>
4647
)
4748
}
4849

4950
function AnimatedStack() {
50-
const systemBackgroundColor = getSystemBackgroundColor()
51-
const { isScaling } = useSheet()
52-
5351
return (
5452
<Stack
5553
screenOptions={{
56-
contentStyle: { backgroundColor: systemBackgroundColor },
5754
headerShown: false,
55+
contentStyle: {
56+
backgroundColor: "#000",
57+
},
5858
}}
5959
>
6060
<Stack.Screen
6161
name="(stack)"
6262
options={{
6363
title: "Follow",
6464
headerShown: false,
65-
contentStyle: isScaling ? { borderRadius: 50, overflow: "hidden" } : {},
6665
}}
6766
/>
6867
<Stack.Screen name="(headless)" options={{ headerShown: false, title: "Follow" }} />

0 commit comments

Comments
 (0)