@momo-kits/foundation 0.112.1-beta.1 → 0.112.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
2
2
  import {NavigationContainer} from '@react-navigation/native';
3
3
  import {createStackNavigator} from '@react-navigation/stack';
4
4
  import React, {useContext, useEffect} from 'react';
5
- import {Animated, Platform, StatusBar} from 'react-native';
5
+ import {Animated, Easing, Platform, StatusBar} from 'react-native';
6
6
  import {useSafeAreaInsets} from 'react-native-safe-area-context';
7
7
  import {Colors} from '../../Consts';
8
8
  import {Icon} from '../../Icon';
@@ -19,20 +19,21 @@ const Stack = createStackNavigator();
19
19
  const TabScreen: React.FC<any> = ({route, navigation}) => {
20
20
  const {nested, options, screen, initialParams} = route?.params;
21
21
 
22
- const opacity = new Animated.Value(0.25);
23
- const translateX = new Animated.Value(100);
22
+ const opacity = new Animated.Value(0);
23
+ const scale = new Animated.Value(0.9);
24
24
 
25
25
  useEffect(() => {
26
26
  const unsubscribeFocus = navigation.addListener('focus', () => {
27
27
  Animated.parallel([
28
- Animated.timing(translateX, {
29
- toValue: 0,
30
- duration: 300,
28
+ Animated.timing(opacity, {
29
+ toValue: 1,
30
+ duration: 200,
31
31
  useNativeDriver: true,
32
32
  }),
33
- Animated.timing(opacity, {
33
+ Animated.timing(scale, {
34
34
  toValue: 1,
35
35
  duration: 300,
36
+ easing: Easing.bezier(0.4, 0.0, 0.2, 1),
36
37
  useNativeDriver: true,
37
38
  }),
38
39
  ]).start();
@@ -40,14 +41,14 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
40
41
 
41
42
  const unsubscribeBlur = navigation.addListener('blur', () => {
42
43
  Animated.parallel([
43
- Animated.timing(translateX, {
44
- toValue: 100,
45
- duration: 300,
44
+ Animated.timing(opacity, {
45
+ toValue: 0,
46
+ duration: 200,
46
47
  useNativeDriver: true,
47
48
  }),
48
- Animated.timing(opacity, {
49
- toValue: 0.25,
50
- duration: 300,
49
+ Animated.timing(scale, {
50
+ toValue: 0.9,
51
+ duration: 200,
51
52
  useNativeDriver: true,
52
53
  }),
53
54
  ]).start();
@@ -66,7 +67,7 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
66
67
 
67
68
  if (nested) {
68
69
  return (
69
- <Animated.View style={{flex: 1, transform: [{translateX: translateX}]}}>
70
+ <Animated.View style={{flex: 1, transform: [{scale}]}}>
70
71
  <Stack.Navigator>
71
72
  <Stack.Screen
72
73
  name="Stack"
@@ -84,8 +85,7 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
84
85
  }
85
86
 
86
87
  return (
87
- <Animated.View
88
- style={{flex: 1, opacity, transform: [{translateX: translateX}]}}>
88
+ <Animated.View style={{flex: 1, opacity, transform: [{scale}]}}>
89
89
  <NavigationContainer independent={true}>
90
90
  <Stack.Navigator>
91
91
  <Stack.Screen
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.112.1-beta.1",
3
+ "version": "0.112.1-beta.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},