Better screen transitions for auth flow (#7803)
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import {type StyleProp, type ViewStyle} from 'react-native'
|
||||
import Animated, {
|
||||
FadeIn,
|
||||
FadeOut,
|
||||
SlideInLeft,
|
||||
SlideInRight,
|
||||
} from 'react-native-reanimated'
|
||||
import type React from 'react'
|
||||
|
||||
import {isWeb} from '#/platform/detection'
|
||||
|
||||
export function ScreenTransition({
|
||||
direction,
|
||||
style,
|
||||
children,
|
||||
}: {
|
||||
direction: 'Backward' | 'Forward'
|
||||
style?: StyleProp<ViewStyle>
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const entering = direction === 'Forward' ? SlideInRight : SlideInLeft
|
||||
|
||||
return (
|
||||
<Animated.View
|
||||
entering={isWeb ? FadeIn.duration(90) : entering}
|
||||
exiting={FadeOut.duration(90)} // Totally vibes based
|
||||
style={style}>
|
||||
{children}
|
||||
</Animated.View>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user