rm absoluteFillObject
This commit is contained in:
+5
-8
@@ -2,20 +2,19 @@ import {forwardRef, useCallback, useEffect, useState} from 'react'
|
|||||||
import {
|
import {
|
||||||
AccessibilityInfo,
|
AccessibilityInfo,
|
||||||
Image as RNImage,
|
Image as RNImage,
|
||||||
StyleSheet,
|
|
||||||
useColorScheme,
|
useColorScheme,
|
||||||
View,
|
View,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
Easing,
|
Easing,
|
||||||
interpolate,
|
interpolate,
|
||||||
runOnJS,
|
|
||||||
useAnimatedStyle,
|
useAnimatedStyle,
|
||||||
useSharedValue,
|
useSharedValue,
|
||||||
withTiming,
|
withTiming,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import Svg, {Path, type SvgProps} from 'react-native-svg'
|
import Svg, {Path, type SvgProps} from 'react-native-svg'
|
||||||
|
import {scheduleOnRN} from 'react-native-worklets'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import * as SplashScreen from 'expo-splash-screen'
|
import * as SplashScreen from 'expo-splash-screen'
|
||||||
|
|
||||||
@@ -152,9 +151,7 @@ export function Splash(props: React.PropsWithChildren<Props>) {
|
|||||||
withTiming(
|
withTiming(
|
||||||
1,
|
1,
|
||||||
{duration: 1200, easing: Easing.in(Easing.cubic)},
|
{duration: 1200, easing: Easing.in(Easing.cubic)},
|
||||||
() => {
|
() => scheduleOnRN(onFinish),
|
||||||
runOnJS(onFinish)()
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
outroApp.set(() =>
|
outroApp.set(() =>
|
||||||
@@ -178,7 +175,7 @@ export function Splash(props: React.PropsWithChildren<Props>) {
|
|||||||
}, [onFinish, intro, outroLogo, outroApp, outroAppOpacity, isReady])
|
}, [onFinish, intro, outroLogo, outroApp, outroAppOpacity, isReady])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
AccessibilityInfo.isReduceMotionEnabled().then(setReduceMotion)
|
void AccessibilityInfo.isReduceMotionEnabled().then(setReduceMotion)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const logoAnimations =
|
const logoAnimations =
|
||||||
@@ -189,12 +186,12 @@ export function Splash(props: React.PropsWithChildren<Props>) {
|
|||||||
return (
|
return (
|
||||||
<View style={{flex: 1}} onLayout={onLayout}>
|
<View style={{flex: 1}} onLayout={onLayout}>
|
||||||
{!isAnimationComplete && (
|
{!isAnimationComplete && (
|
||||||
<View style={StyleSheet.absoluteFillObject}>
|
<View style={[a.absolute, a.inset_0]}>
|
||||||
<Image
|
<Image
|
||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
onLoadEnd={onLoadEnd}
|
onLoadEnd={onLoadEnd}
|
||||||
source={{uri: isDarkMode ? darkSplashImageUri : splashImageUri}}
|
source={{uri: isDarkMode ? darkSplashImageUri : splashImageUri}}
|
||||||
style={StyleSheet.absoluteFillObject}
|
style={[a.absolute, a.inset_0]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Animated.View
|
<Animated.View
|
||||||
|
|||||||
Reference in New Issue
Block a user