Bluesky app fork with some witchin' additions 馃挮
at main 996 B view raw
1import {type StyleProp, type ViewStyle} from 'react-native' 2import Animated, { 3 Easing, 4 FadeIn, 5 FadeOut, 6 SlideInLeft, 7 SlideInRight, 8} from 'react-native-reanimated' 9import type React from 'react' 10 11import {isWeb} from '#/platform/detection' 12 13export function ScreenTransition({ 14 direction, 15 style, 16 children, 17 enabledWeb, 18}: { 19 direction: 'Backward' | 'Forward' 20 style?: StyleProp<ViewStyle> 21 children: React.ReactNode 22 enabledWeb?: boolean 23}) { 24 const entering = 25 direction === 'Forward' 26 ? SlideInRight.easing(Easing.out(Easing.exp)) 27 : SlideInLeft.easing(Easing.out(Easing.exp)) 28 const webEntering = enabledWeb ? FadeIn.duration(90) : undefined 29 const exiting = FadeOut.duration(90) // Totally vibes based 30 const webExiting = enabledWeb ? FadeOut.duration(90) : undefined 31 32 return ( 33 <Animated.View 34 entering={isWeb ? webEntering : entering} 35 exiting={isWeb ? webExiting : exiting} 36 style={style}> 37 {children} 38 </Animated.View> 39 ) 40}