@momo-kits/foundation 0.81.21 → 0.81.23-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.
- package/Application/Components.tsx +0 -13
- package/Application/ModalScreen.tsx +6 -1
- package/Application/StackScreen.tsx +18 -5
- package/Image/index.tsx +8 -1
- package/Image/styles.ts +0 -2
- package/Layout/Screen.tsx +6 -1
- package/Popup/PopupNotify.tsx +1 -2
- package/Text/index.tsx +1 -0
- package/package.json +1 -1
|
@@ -159,19 +159,6 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
159
159
|
|
|
160
160
|
const goBack = () => {
|
|
161
161
|
const canGoBack = navigator?.ref.current?.canGoBack();
|
|
162
|
-
const currentRoute = navigator?.ref?.current.getCurrentRoute();
|
|
163
|
-
|
|
164
|
-
if (navigator?.trackingInfo) {
|
|
165
|
-
navigator?.maxApi?.trackEvent('service_icon_clicked', {
|
|
166
|
-
feature_code: navigator.trackingInfo.code,
|
|
167
|
-
app_id: navigator.trackingInfo.appId,
|
|
168
|
-
miniapp_version: navigator.trackingInfo.buildNumber,
|
|
169
|
-
flow_partner_id: navigator.trackingInfo.flowPartnerId,
|
|
170
|
-
screen_name: currentRoute?.params?.screen?.name ?? currentRoute?.name,
|
|
171
|
-
trigger_id: '111154000000000000',
|
|
172
|
-
icon_name: 'back',
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
162
|
|
|
176
163
|
if (canGoBack) {
|
|
177
164
|
if (preventBack) {
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Platform,
|
|
7
7
|
Pressable,
|
|
8
8
|
StyleSheet,
|
|
9
|
+
TouchableHighlight,
|
|
9
10
|
View,
|
|
10
11
|
} from 'react-native';
|
|
11
12
|
import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context';
|
|
@@ -190,7 +191,11 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
190
191
|
...theme,
|
|
191
192
|
assets: {...theme.assets, headerBackground: undefined},
|
|
192
193
|
}}
|
|
193
|
-
screen={props =>
|
|
194
|
+
screen={props => (
|
|
195
|
+
<TouchableHighlight style={Styles.flex}>
|
|
196
|
+
<Component {...props} {...params} />
|
|
197
|
+
</TouchableHighlight>
|
|
198
|
+
)}
|
|
194
199
|
options={{
|
|
195
200
|
...options,
|
|
196
201
|
...{
|
|
@@ -32,21 +32,34 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
32
32
|
*/
|
|
33
33
|
useEffect(() => {
|
|
34
34
|
if (navigator?.trackingInfo) {
|
|
35
|
+
const tracking = {
|
|
36
|
+
feature_code: navigator.trackingInfo.code,
|
|
37
|
+
app_id: navigator.trackingInfo.appId,
|
|
38
|
+
miniapp_version: navigator.trackingInfo.buildNumber,
|
|
39
|
+
flow_partner_id: navigator.trackingInfo.flowPartnerId,
|
|
40
|
+
screen_name: Component.name,
|
|
41
|
+
};
|
|
42
|
+
|
|
35
43
|
const routes = props.navigation.getState()?.routes || [];
|
|
36
44
|
const routesLength = routes.length;
|
|
37
45
|
let pre_screen_name = '';
|
|
38
46
|
if (routesLength > 1) {
|
|
39
47
|
pre_screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
40
48
|
}
|
|
49
|
+
|
|
41
50
|
navigator?.maxApi?.trackEvent('service_frame_displayed', {
|
|
42
|
-
|
|
43
|
-
app_id: navigator.trackingInfo.appId,
|
|
44
|
-
miniapp_version: navigator.trackingInfo.buildNumber,
|
|
45
|
-
flow_partner_id: navigator.trackingInfo.flowPartnerId,
|
|
46
|
-
screen_name: Component.name,
|
|
51
|
+
...tracking,
|
|
47
52
|
pre_screen_name,
|
|
48
53
|
trigger_id: '111378000000000000',
|
|
49
54
|
});
|
|
55
|
+
|
|
56
|
+
return props.navigation.addListener('beforeRemove', () => {
|
|
57
|
+
navigator?.maxApi?.trackEvent('service_icon_clicked', {
|
|
58
|
+
...tracking,
|
|
59
|
+
trigger_id: '111154000000000000',
|
|
60
|
+
icon_name: 'back',
|
|
61
|
+
});
|
|
62
|
+
});
|
|
50
63
|
}
|
|
51
64
|
}, []);
|
|
52
65
|
|
package/Image/index.tsx
CHANGED
|
@@ -10,7 +10,13 @@ import {ImageProps} from './types';
|
|
|
10
10
|
|
|
11
11
|
type Status = 'success' | 'loading' | 'error';
|
|
12
12
|
|
|
13
|
-
const Image: React.FC<ImageProps> = ({
|
|
13
|
+
const Image: React.FC<ImageProps> = ({
|
|
14
|
+
style,
|
|
15
|
+
source,
|
|
16
|
+
loading,
|
|
17
|
+
children,
|
|
18
|
+
...rest
|
|
19
|
+
}) => {
|
|
14
20
|
const {theme} = useContext(ApplicationContext);
|
|
15
21
|
const error = useRef(false);
|
|
16
22
|
const [status, setStatus] = useState<Status>('success');
|
|
@@ -32,6 +38,7 @@ const Image: React.FC<ImageProps> = ({style, source, loading, ...rest}) => {
|
|
|
32
38
|
</View>
|
|
33
39
|
);
|
|
34
40
|
}
|
|
41
|
+
return children;
|
|
35
42
|
};
|
|
36
43
|
|
|
37
44
|
return (
|
package/Image/styles.ts
CHANGED
package/Layout/Screen.tsx
CHANGED
|
@@ -108,8 +108,13 @@ const Screen = forwardRef(
|
|
|
108
108
|
let handleScroll;
|
|
109
109
|
let headerBackground: string | undefined = undefined;
|
|
110
110
|
let Component: any = View;
|
|
111
|
+
let keyboardVerticalOffset = heightHeader - 20;
|
|
111
112
|
animatedValue.current = undefined;
|
|
112
113
|
|
|
114
|
+
if (useExtendedHeader || animatedHeader) {
|
|
115
|
+
keyboardVerticalOffset = -20;
|
|
116
|
+
}
|
|
117
|
+
|
|
113
118
|
if (useExtendedHeader) {
|
|
114
119
|
headerBackground = theme.assets?.headerBackground;
|
|
115
120
|
}
|
|
@@ -267,7 +272,7 @@ const Screen = forwardRef(
|
|
|
267
272
|
<KeyboardAvoidingView
|
|
268
273
|
style={Styles.flex}
|
|
269
274
|
enabled={enableKeyboardAvoidingView}
|
|
270
|
-
keyboardVerticalOffset={
|
|
275
|
+
keyboardVerticalOffset={keyboardVerticalOffset}
|
|
271
276
|
behavior={Platform.select({
|
|
272
277
|
ios: 'padding',
|
|
273
278
|
android: undefined,
|
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -71,7 +71,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
71
71
|
screen_name,
|
|
72
72
|
component_type: 'popup',
|
|
73
73
|
component_name: 'PopupNotify',
|
|
74
|
-
error_code: error,
|
|
74
|
+
error_code: error ? error : undefined,
|
|
75
75
|
trigger_id,
|
|
76
76
|
action_type: actionType,
|
|
77
77
|
});
|
|
@@ -206,7 +206,6 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
206
206
|
<Description style={[styles.description, descriptionStyle]}>
|
|
207
207
|
<Text
|
|
208
208
|
typography={'paragraph_default'}
|
|
209
|
-
numberOfLines={4}
|
|
210
209
|
onTextLayout={({nativeEvent: {lines}}) => {
|
|
211
210
|
const enableScroll = lines.length > 3;
|
|
212
211
|
if (enableScroll != scrollContent) {
|
package/Text/index.tsx
CHANGED