@momo-kits/foundation 0.163.1-beta.5 → 0.163.1-beta.6

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.
@@ -17,7 +17,16 @@ import type {
17
17
  import type { NavigationState, PartialState } from '@react-navigation/native';
18
18
  import type { HeaderTitleProps, NavigationOptions } from './types';
19
19
  import { Colors, Spacing } from '../Consts';
20
- import { Animated, AppState, NativeModules, Platform } from 'react-native';
20
+ import {
21
+ Animated,
22
+ AppState,
23
+ NativeModules,
24
+ Platform,
25
+ StyleProp,
26
+ StyleSheet,
27
+ ViewStyle,
28
+ } from 'react-native';
29
+ import { BlurView } from '@sbaiahmed1/react-native-blur';
21
30
  import type { SharedValue } from 'react-native-reanimated';
22
31
  import { useSharedValue } from 'react-native-reanimated';
23
32
  import {
@@ -40,16 +49,35 @@ const forStackTransitionWithOverlay = (
40
49
  cardStyle,
41
50
  shadowStyle,
42
51
  overlayStyle: {
43
- backgroundColor: '#FDEAF4',
44
52
  opacity: props.current.progress.interpolate({
45
53
  inputRange: [0, 1],
46
- outputRange: [0, 0.3],
54
+ outputRange: [0, 1],
47
55
  extrapolate: 'clamp',
48
56
  }),
49
57
  },
50
58
  };
51
59
  };
52
60
 
61
+ /**
62
+ * blur intensity stays fixed so only the wrapper's opacity animates per
63
+ * frame; animating blurAmount itself would re-render the native blur view
64
+ * on every frame of the transition
65
+ */
66
+ const renderStackOverlay = ({
67
+ style,
68
+ }: {
69
+ style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
70
+ }) => (
71
+ <Animated.View pointerEvents="none" style={[StyleSheet.absoluteFill, style]}>
72
+ <BlurView
73
+ style={StyleSheet.absoluteFill}
74
+ blurType="xlight"
75
+ blurAmount={2}
76
+ overlayColor="rgba(253, 234, 244, 0.3)"
77
+ />
78
+ </Animated.View>
79
+ );
80
+
53
81
  /**
54
82
  * default options for stack screen
55
83
  */
@@ -74,6 +102,7 @@ const getStackOptions = (): StackNavigationOptions => {
74
102
  ...TransitionPresets.SlideFromRightIOS,
75
103
  cardStyleInterpolator: forStackTransitionWithOverlay,
76
104
  cardOverlayEnabled: true,
105
+ cardOverlay: renderStackOverlay,
77
106
  };
78
107
  };
79
108
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.163.1-beta.5",
3
+ "version": "0.163.1-beta.6",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
@@ -9,6 +9,7 @@
9
9
  ],
10
10
  "dependencies": {
11
11
  "react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
12
+ "@sbaiahmed1/react-native-blur": "6.0.0",
12
13
  "@react-navigation/bottom-tabs": "7.4.2",
13
14
  "@react-navigation/core": "7.12.1",
14
15
  "@react-navigation/elements": "2.5.2",