Better screen transitions for auth flow (#7803)

This commit is contained in:
Samuel Newman
2025-09-23 20:04:22 +03:00
committed by GitHub
parent 6d85fe05d1
commit 7916c73b09
13 changed files with 265 additions and 216 deletions
@@ -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>
)
}