@@ -11,11 +11,9 @@ import ReanimatedAnimated, {
1111 useAnimatedStyle ,
1212 withTiming ,
1313 withDelay ,
14- withSpring ,
1514} from 'react-native-reanimated' ;
1615import { SafeAreaView } from 'react-native-safe-area-context' ;
1716import { NativeStackNavigationProp } from '@react-navigation/native-stack' ;
18- import Icon from 'react-native-vector-icons/Feather' ;
1917import { Button } from '../components' ;
2018import { useTheme , useThemedStyles } from '../theme' ;
2119import type { ThemeColors , ThemeShadows } from '../theme' ;
@@ -29,20 +27,16 @@ type OnboardingScreenProps = {
2927
3028const { width } = Dimensions . get ( 'window' ) ;
3129
32- /** Animated slide with staggered entrance for icon, title, description */
30+ /** Animated slide with staggered entrance for title and description */
3331const SlideContent : React . FC < {
3432 item : typeof ONBOARDING_SLIDES [ 0 ] ;
3533 isActive : boolean ;
3634 styles : ReturnType < typeof createStyles > ;
37- primaryColor : string ;
3835} > = ( {
3936 item,
4037 isActive,
4138 styles,
42- primaryColor,
4339} ) => {
44- const iconScale = useSharedValue ( 0.6 ) ;
45- const iconOpacity = useSharedValue ( 0 ) ;
4640 const titleOpacity = useSharedValue ( 0 ) ;
4741 const titleTranslateY = useSharedValue ( 16 ) ;
4842 const descOpacity = useSharedValue ( 0 ) ;
@@ -51,29 +45,20 @@ const SlideContent: React.FC<{
5145 useEffect ( ( ) => {
5246 if ( isActive ) {
5347 // Reset
54- iconScale . value = 0.6 ;
55- iconOpacity . value = 0 ;
5648 titleOpacity . value = 0 ;
5749 titleTranslateY . value = 16 ;
5850 descOpacity . value = 0 ;
5951 descTranslateY . value = 16 ;
6052
6153 // Stagger in
62- iconScale . value = withSpring ( 1 , { damping : 12 , stiffness : 150 } ) ;
63- iconOpacity . value = withTiming ( 1 , { duration : 300 } ) ;
64- titleOpacity . value = withDelay ( 150 , withTiming ( 1 , { duration : 300 } ) ) ;
65- titleTranslateY . value = withDelay ( 150 , withTiming ( 0 , { duration : 300 } ) ) ;
66- descOpacity . value = withDelay ( 300 , withTiming ( 1 , { duration : 300 } ) ) ;
67- descTranslateY . value = withDelay ( 300 , withTiming ( 0 , { duration : 300 } ) ) ;
54+ titleOpacity . value = withTiming ( 1 , { duration : 400 } ) ;
55+ titleTranslateY . value = withTiming ( 0 , { duration : 400 } ) ;
56+ descOpacity . value = withDelay ( 200 , withTiming ( 1 , { duration : 400 } ) ) ;
57+ descTranslateY . value = withDelay ( 200 , withTiming ( 0 , { duration : 400 } ) ) ;
6858 }
6959 // eslint-disable-next-line react-hooks/exhaustive-deps
7060 } , [ isActive ] ) ;
7161
72- const iconStyle = useAnimatedStyle ( ( ) => ( {
73- opacity : iconOpacity . value ,
74- transform : [ { scale : iconScale . value } ] ,
75- } ) ) ;
76-
7762 const titleStyle = useAnimatedStyle ( ( ) => ( {
7863 opacity : titleOpacity . value ,
7964 transform : [ { translateY : titleTranslateY . value } ] ,
@@ -86,9 +71,6 @@ const SlideContent: React.FC<{
8671
8772 return (
8873 < View style = { styles . slide } >
89- < ReanimatedAnimated . View style = { [ styles . iconContainer , iconStyle ] } >
90- < Icon name = { item . icon } size = { 64 } color = { primaryColor } />
91- </ ReanimatedAnimated . View >
9274 < ReanimatedAnimated . View style = { titleStyle } >
9375 < Text style = { styles . title } > { item . title } </ Text >
9476 </ ReanimatedAnimated . View >
@@ -130,7 +112,7 @@ export const OnboardingScreen: React.FC<OnboardingScreenProps> = ({
130112 } ;
131113
132114 const renderSlide = ( { item, index } : { item : typeof ONBOARDING_SLIDES [ 0 ] ; index : number } ) => (
133- < SlideContent item = { item } isActive = { currentIndex === index } styles = { styles } primaryColor = { colors . primary } />
115+ < SlideContent item = { item } isActive = { currentIndex === index } styles = { styles } />
134116 ) ;
135117
136118 const renderDots = ( ) => (
@@ -214,7 +196,7 @@ export const OnboardingScreen: React.FC<OnboardingScreenProps> = ({
214196 ) ;
215197} ;
216198
217- const createStyles = ( colors : ThemeColors , shadows : ThemeShadows ) => ( {
199+ const createStyles = ( colors : ThemeColors , _shadows : ThemeShadows ) => ( {
218200 container : {
219201 flex : 1 ,
220202 backgroundColor : colors . background ,
@@ -232,18 +214,6 @@ const createStyles = (colors: ThemeColors, shadows: ThemeShadows) => ({
232214 justifyContent : 'center' as const ,
233215 alignItems : 'center' as const ,
234216 } ,
235- iconContainer : {
236- width : 120 ,
237- height : 120 ,
238- borderRadius : 8 ,
239- borderWidth : 1 ,
240- borderColor : colors . border ,
241- backgroundColor : colors . surface ,
242- justifyContent : 'center' as const ,
243- alignItems : 'center' as const ,
244- marginBottom : SPACING . xxl ,
245- ...shadows . medium ,
246- } ,
247217 title : {
248218 ...TYPOGRAPHY . h1 ,
249219 color : colors . text ,
0 commit comments