keep content away from the bottom safe area

This commit is contained in:
Samuel Newman
2025-01-19 11:23:34 +00:00
parent ac58486e6a
commit b52eaa1826
2 changed files with 45 additions and 44 deletions
@@ -191,12 +191,14 @@ export function Scrubber({
a.justify_end, a.justify_end,
a.py_lg, a.py_lg,
{ {
paddingBottom: insets.bottom + tokens.space.md, paddingBottom: insets.bottom,
paddingTop: tokens.space.md,
height: height:
// bottom padding // bottom padding
insets.bottom + insets.bottom +
// actual height // actual height
tokens.space.xl + tokens.space.xl +
// top padding
tokens.space.md, tokens.space.md,
}, },
a.z_10, a.z_10,
+4 -5
View File
@@ -18,7 +18,6 @@ import Animated, {
useSharedValue, useSharedValue,
} from 'react-native-reanimated' } from 'react-native-reanimated'
import { import {
SafeAreaView,
useSafeAreaFrame, useSafeAreaFrame,
useSafeAreaInsets, useSafeAreaInsets,
} from 'react-native-safe-area-context' } from 'react-native-safe-area-context'
@@ -495,7 +494,6 @@ function VideoItem({
return ( return (
<View style={[a.relative, {height, width}]}> <View style={[a.relative, {height, width}]}>
<SafeAreaView edges={['left', 'right', 'bottom']} style={[a.flex_1]}>
{postShadow === POST_TOMBSTONE ? ( {postShadow === POST_TOMBSTONE ? (
<View <View
style={[ style={[
@@ -536,7 +534,6 @@ function VideoItem({
)} )}
</> </>
)} )}
</SafeAreaView>
</View> </View>
) )
} }
@@ -550,6 +547,7 @@ function VideoItemInner({
embed: AppBskyEmbedVideo.View embed: AppBskyEmbedVideo.View
active: boolean active: boolean
}) { }) {
const {bottom} = useSafeAreaInsets()
const {status} = useEvent(player, 'statusChange', {status: player.status}) const {status} = useEvent(player, 'statusChange', {status: player.status})
return ( return (
@@ -559,7 +557,7 @@ function VideoItemInner({
accessible={false} accessible={false}
style={[ style={[
a.absolute, a.absolute,
a.inset_0, {top: 0, left: 0, right: 0, bottom},
isAndroid && status === 'loading' && {opacity: 0}, isAndroid && status === 'loading' && {opacity: 0},
]} ]}
player={player} player={player}
@@ -914,6 +912,7 @@ function VideoItemPlaceholder({
style?: ImageStyle style?: ImageStyle
blur?: boolean blur?: boolean
}) { }) {
const {bottom} = useSafeAreaInsets()
const src = embed.thumbnail const src = embed.thumbnail
let contentFit = isTallAspectRatio(embed.aspectRatio) let contentFit = isTallAspectRatio(embed.aspectRatio)
? ('cover' as const) ? ('cover' as const)
@@ -925,7 +924,7 @@ function VideoItemPlaceholder({
<Image <Image
accessibilityIgnoresInvertColors accessibilityIgnoresInvertColors
source={{uri: src}} source={{uri: src}}
style={[a.absolute, a.inset_0, style]} style={[a.absolute, {top: 0, left: 0, right: 0, bottom}, style]}
contentFit={contentFit} contentFit={contentFit}
blurRadius={blur ? 40 : 0} blurRadius={blur ? 40 : 0}
/> />