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

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.
@@ -20,22 +20,37 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
20
20
  const {nested, options, screen, initialParams} = route?.params;
21
21
 
22
22
  const opacity = new Animated.Value(0.25);
23
+ const translateX = new Animated.Value(100);
23
24
 
24
25
  useEffect(() => {
25
26
  const unsubscribeFocus = navigation.addListener('focus', () => {
26
- Animated.timing(opacity, {
27
- toValue: 1,
28
- duration: 300,
29
- useNativeDriver: true,
30
- }).start();
27
+ Animated.parallel([
28
+ Animated.timing(translateX, {
29
+ toValue: 0,
30
+ duration: 300,
31
+ useNativeDriver: true,
32
+ }),
33
+ Animated.timing(opacity, {
34
+ toValue: 1,
35
+ duration: 300,
36
+ useNativeDriver: true,
37
+ }),
38
+ ]).start();
31
39
  });
32
40
 
33
41
  const unsubscribeBlur = navigation.addListener('blur', () => {
34
- Animated.timing(opacity, {
35
- toValue: 0.25,
36
- duration: 300,
37
- useNativeDriver: true,
38
- }).start();
42
+ Animated.parallel([
43
+ Animated.timing(translateX, {
44
+ toValue: 100,
45
+ duration: 300,
46
+ useNativeDriver: true,
47
+ }),
48
+ Animated.timing(opacity, {
49
+ toValue: 0.25,
50
+ duration: 300,
51
+ useNativeDriver: true,
52
+ }),
53
+ ]).start();
39
54
  });
40
55
 
41
56
  return () => {
@@ -51,7 +66,7 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
51
66
 
52
67
  if (nested) {
53
68
  return (
54
- <Animated.View style={{flex: 1, opacity}}>
69
+ <Animated.View style={{flex: 1, transform: [{translateX: translateX}]}}>
55
70
  <Stack.Navigator>
56
71
  <Stack.Screen
57
72
  name="Stack"
@@ -69,7 +84,8 @@ const TabScreen: React.FC<any> = ({route, navigation}) => {
69
84
  }
70
85
 
71
86
  return (
72
- <Animated.View style={{flex: 1, opacity}}>
87
+ <Animated.View
88
+ style={{flex: 1, opacity, transform: [{translateX: translateX}]}}>
73
89
  <NavigationContainer independent={true}>
74
90
  <Stack.Navigator>
75
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.0",
3
+ "version": "0.112.1-beta.1",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},