@momo-kits/foundation 0.92.17 → 0.92.19
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/StackScreen.tsx +87 -4
- package/package.json +3 -3
- package/publish.sh +6 -6
|
@@ -1,11 +1,92 @@
|
|
|
1
1
|
import React, {useContext, useEffect, useLayoutEffect, useRef} from 'react';
|
|
2
|
+
import {useHeaderHeight} from '@react-navigation/stack';
|
|
3
|
+
import {InteractionManager, Linking, View} from 'react-native';
|
|
2
4
|
import {ScreenParams} from './types';
|
|
3
5
|
import Navigation from './Navigation';
|
|
4
6
|
import {ApplicationContext, MiniAppContext, ScreenContext} from './index';
|
|
5
7
|
import {GridSystem} from '../Layout';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
+
import {Text} from '../Text';
|
|
9
|
+
import {Colors, Radius, Spacing} from '../Consts';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Empty screen for unvalidated screen name
|
|
13
|
+
* @constructor
|
|
14
|
+
*/
|
|
15
|
+
const EmptyScreen: React.FC = () => {
|
|
16
|
+
return (
|
|
17
|
+
<View
|
|
18
|
+
style={{
|
|
19
|
+
backgroundColor: Colors.black_01,
|
|
20
|
+
padding: Spacing.M,
|
|
21
|
+
borderRadius: Radius.M,
|
|
22
|
+
}}>
|
|
23
|
+
<Text typography={'header_m_bold'}>Unvalidated screen name</Text>
|
|
24
|
+
<Text
|
|
25
|
+
typography={'description_default_regular'}
|
|
26
|
+
style={{paddingVertical: Spacing.S}}>
|
|
27
|
+
Your screen has not been rendered because Platform has not detected the
|
|
28
|
+
screen name. Please migrate to support this feature.
|
|
29
|
+
</Text>
|
|
30
|
+
<Text typography={'header_default'} style={{width: '100%'}}>
|
|
31
|
+
Possible fixes:
|
|
32
|
+
</Text>
|
|
33
|
+
<View style={{marginLeft: Spacing.S}}>
|
|
34
|
+
<Text typography={'body_default_regular'}>1. Off webpack config</Text>
|
|
35
|
+
<Text typography={'body_default_regular'}>
|
|
36
|
+
2. Screen name refactoring
|
|
37
|
+
</Text>
|
|
38
|
+
<View style={{marginLeft: Spacing.S}}>
|
|
39
|
+
<Text
|
|
40
|
+
typography={'description_default_regular'}
|
|
41
|
+
style={{marginBottom: Spacing.S}}>
|
|
42
|
+
- Với các screen push/import dạng arrow function ={'>'} đổi thành
|
|
43
|
+
named function
|
|
44
|
+
</Text>
|
|
45
|
+
<Text
|
|
46
|
+
typography={'description_default_regular'}
|
|
47
|
+
style={{marginBottom: Spacing.S}}>
|
|
48
|
+
- Với các screen import dạng High Order Component ={'>'} rename
|
|
49
|
+
generic function thành named function
|
|
50
|
+
</Text>
|
|
51
|
+
<Text
|
|
52
|
+
typography={'description_default_regular'}
|
|
53
|
+
style={{marginBottom: Spacing.S}}>
|
|
54
|
+
- Với Tab Navigator, Platform sẽ lấy Tab Container làm screen name.
|
|
55
|
+
Trong trường hợp miniapp muốn track riêng action cho từng tab, tham
|
|
56
|
+
khảo theo docs
|
|
57
|
+
</Text>
|
|
58
|
+
</View>
|
|
59
|
+
</View>
|
|
60
|
+
<Text typography={'header_s_semibold'}>More information: </Text>
|
|
61
|
+
<Text
|
|
62
|
+
typography={'body_default_regular'}
|
|
63
|
+
color={Colors.blue_01}
|
|
64
|
+
onPress={() => {
|
|
65
|
+
Linking.openURL(
|
|
66
|
+
'https://gitlab.mservice.com.vn/momo-platform/mini-app/-/tree/vn.momo.uikits/dev/app'
|
|
67
|
+
);
|
|
68
|
+
}}>
|
|
69
|
+
Mini App: vn.momo.uikits/dev
|
|
70
|
+
</Text>
|
|
71
|
+
<Text
|
|
72
|
+
typography={'body_default_regular'}
|
|
73
|
+
color={Colors.blue_01}
|
|
74
|
+
onPress={() => {
|
|
75
|
+
Linking.openURL(
|
|
76
|
+
'https://docs.google.com/presentation/d/1bIFoh8gRXb6hsnGJz4O1Kxg4_oNikB1KuuEt2wULCDM/edit?usp=sharing'
|
|
77
|
+
);
|
|
78
|
+
}}>
|
|
79
|
+
https://docs.google.com/presentation/d/1bIFoh8gRXb6hsnGJz4O1Kxg4_oNikB1KuuEt2wULCDM/edit?usp=sharing
|
|
80
|
+
</Text>
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
8
84
|
|
|
85
|
+
/**
|
|
86
|
+
* container for stack screen
|
|
87
|
+
* @param props
|
|
88
|
+
* @constructor
|
|
89
|
+
*/
|
|
9
90
|
const StackScreen: React.FC<ScreenParams> = props => {
|
|
10
91
|
const {theme, showGrid, navigator} = useContext(ApplicationContext);
|
|
11
92
|
const startTime = useRef(Date.now());
|
|
@@ -50,8 +131,10 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
50
131
|
* tracking for screen
|
|
51
132
|
*/
|
|
52
133
|
useEffect(() => {
|
|
53
|
-
if (
|
|
54
|
-
|
|
134
|
+
if (['Invalid', 'screen'].includes(screenName) && context.enableAutoId) {
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
navigator?.showModal({screen: EmptyScreen});
|
|
137
|
+
}, 300);
|
|
55
138
|
}
|
|
56
139
|
|
|
57
140
|
navigator?.maxApi?.of?.({screenName});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.92.
|
|
3
|
+
"version": "0.92.19",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@react-navigation/core": "5.16.1",
|
|
19
19
|
"@react-navigation/native": "5.9.8",
|
|
20
20
|
"@react-navigation/routers": "5.7.4",
|
|
21
|
-
"lottie-react-native": "
|
|
21
|
+
"lottie-react-native": "git+https://gitlab.mservice.com.vn/momo-platform/momo-lottie-react-native.git",
|
|
22
22
|
"@react-navigation/stack": "https://oauth2:eX-jVhzQdLc343AjD3Sc@gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
},
|
|
44
44
|
"author": "@momo-kits/foundation",
|
|
45
45
|
"license": "ISC"
|
|
46
|
-
}
|
|
46
|
+
}
|
package/publish.sh
CHANGED
|
@@ -7,16 +7,16 @@ rsync -r --exclude=/dist ./* dist
|
|
|
7
7
|
cd dist
|
|
8
8
|
|
|
9
9
|
if [ "$1" == "stable" ]; then
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
npm version $(npm view @momo-kits/foundation@stable version)
|
|
11
|
+
npm version patch
|
|
12
12
|
npm publish --tag stable --access=public
|
|
13
13
|
elif [ "$1" == "latest" ]; then
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
npm version $(npm view @momo-kits/foundation@latest version)
|
|
15
|
+
npm version prerelease --preid=rc
|
|
16
16
|
npm publish --tag latest --access=public
|
|
17
17
|
else
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
npm version $(npm view @momo-kits/foundation@beta version)
|
|
19
|
+
npm version prerelease --preid=beta
|
|
20
20
|
npm publish --tag beta --access=public
|
|
21
21
|
fi
|
|
22
22
|
|