@momo-kits/foundation 0.103.2-beta.0 → 0.103.2-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.
- package/Application/BottomSheet.tsx +1 -1
- package/Application/BottomTab/index.tsx +1 -0
- package/Application/Components.tsx +2 -2
- package/Application/NavigationContainer.tsx +9 -10
- package/Application/Navigator.ts +1 -0
- package/Application/StackScreen.tsx +2 -1
- package/Layout/styles.ts +1 -0
- package/Text/index.tsx +2 -3
- package/Text/utils.ts +2 -4
- package/index.ts +0 -7
- package/package.json +1 -3
|
@@ -19,7 +19,7 @@ import {Icon} from '../Icon';
|
|
|
19
19
|
|
|
20
20
|
const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
21
21
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
22
|
-
const heightDevice = Dimensions.get('screen').height;
|
|
22
|
+
const heightDevice = Dimensions.get('screen').height; // lấy chiều cao thiết bị
|
|
23
23
|
const insets = useSafeAreaInsets();
|
|
24
24
|
const {
|
|
25
25
|
screen: Screen,
|
|
@@ -378,7 +378,7 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
378
378
|
{runtimeTools},
|
|
379
379
|
(res: {item: {action?: string; key: string}}) => {
|
|
380
380
|
const {item} = res;
|
|
381
|
-
navigator?.toolkitCallback?.(item
|
|
381
|
+
navigator?.toolkitCallback?.(item.key);
|
|
382
382
|
getToolkitConfig();
|
|
383
383
|
}
|
|
384
384
|
);
|
|
@@ -430,7 +430,7 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
430
430
|
getToolkitConfig();
|
|
431
431
|
}
|
|
432
432
|
);
|
|
433
|
-
navigator?.toolkitCallback?.(pinTool
|
|
433
|
+
navigator?.toolkitCallback?.(pinTool.key);
|
|
434
434
|
}}
|
|
435
435
|
/>
|
|
436
436
|
);
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
+
import React, {useEffect, useRef, useState} from 'react';
|
|
2
|
+
import {SafeAreaProvider} from 'react-native-safe-area-context';
|
|
1
3
|
import {
|
|
2
|
-
NavigationContainerRef,
|
|
3
4
|
NavigationContainer as ReactNavigationContainer,
|
|
5
|
+
NavigationContainerRef,
|
|
4
6
|
} from '@react-navigation/native';
|
|
5
7
|
import {createStackNavigator} from '@react-navigation/stack';
|
|
6
|
-
import React, {useEffect, useRef, useState} from 'react';
|
|
7
8
|
import {DeviceEventEmitter} from 'react-native';
|
|
8
|
-
import
|
|
9
|
-
import {defaultTheme} from '../Consts';
|
|
10
|
-
import {ApplicationContext} from './index';
|
|
11
|
-
import Localize from './Localize';
|
|
9
|
+
import StackScreen from './StackScreen';
|
|
12
10
|
import ModalScreen from './ModalScreen';
|
|
13
11
|
import Navigator from './Navigator';
|
|
14
|
-
import StackScreen from './StackScreen';
|
|
15
|
-
import {NavigationContainerProps} from './types';
|
|
16
12
|
import {getDialogOptions, getModalOptions, getStackOptions} from './utils';
|
|
13
|
+
import {NavigationContainerProps} from './types';
|
|
14
|
+
import {ApplicationContext} from './index';
|
|
15
|
+
import Localize from './Localize';
|
|
17
16
|
|
|
18
17
|
const Stack = createStackNavigator();
|
|
19
18
|
|
|
20
|
-
const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
19
|
+
const NavigationContainer: React.FC<NavigationContainerProps> = ({ // screen: Screen; options?: NavigationOptions; theme: Theme; maxApi: any; initialParams?: any; localize: Localize;
|
|
21
20
|
screen,
|
|
22
|
-
theme
|
|
21
|
+
theme,
|
|
23
22
|
options,
|
|
24
23
|
maxApi,
|
|
25
24
|
initialParams,
|
package/Application/Navigator.ts
CHANGED
|
@@ -14,7 +14,7 @@ import {Colors, Radius, Spacing} from '../Consts';
|
|
|
14
14
|
* @constructor
|
|
15
15
|
*/
|
|
16
16
|
const StackScreen: React.FC<ScreenParams> = props => {
|
|
17
|
-
const {showGrid, navigator} = useContext(ApplicationContext);
|
|
17
|
+
const {showGrid, navigator} = useContext(ApplicationContext); //showGrid: false, navigator: undefined,
|
|
18
18
|
const tracking = useRef<any>({
|
|
19
19
|
timeoutLoad: undefined,
|
|
20
20
|
timeoutInteraction: undefined,
|
|
@@ -31,6 +31,7 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
31
31
|
|
|
32
32
|
const context = useContext<any>(MiniAppContext);
|
|
33
33
|
const {screen: Component, options, initialParams} = props.route.params;
|
|
34
|
+
console.log(props.route.params);
|
|
34
35
|
const navigation = new Navigation(props.navigation);
|
|
35
36
|
const heightHeader = useHeaderHeight();
|
|
36
37
|
|
package/Layout/styles.ts
CHANGED
package/Text/index.tsx
CHANGED
|
@@ -109,19 +109,18 @@ const Text: React.FC<TextProps> = ({
|
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
|
|
113
112
|
const textStyle = getTypoStyle(typography);
|
|
114
113
|
|
|
115
114
|
if (deprecatedValues.includes(typography)) {
|
|
116
115
|
console.warn(
|
|
117
|
-
`Warning: The typography value "${typography}" is deprecated
|
|
116
|
+
`Warning: The typography value "${typography}" is deprecated.`
|
|
118
117
|
);
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
return (
|
|
122
121
|
<RNText
|
|
123
122
|
{...rest}
|
|
124
|
-
{...getAccessibilityID(
|
|
123
|
+
{...getAccessibilityID(rest.accessibilityLabel)}
|
|
125
124
|
style={[style, textStyle, {color: color ?? theme.colors.text.default}]}>
|
|
126
125
|
{children ?? ''}
|
|
127
126
|
</RNText>
|
package/Text/utils.ts
CHANGED
|
@@ -4,7 +4,6 @@ const deviceWidth = Dimensions.get('window').width;
|
|
|
4
4
|
const DEFAULT_SCREEN_SIZE = 375;
|
|
5
5
|
const scaleSize = (size: number) => {
|
|
6
6
|
const scaleRate = deviceWidth / DEFAULT_SCREEN_SIZE;
|
|
7
|
-
|
|
8
7
|
if (scaleRate > 1) {
|
|
9
8
|
return Math.min(Math.round(size * scaleRate), size + 3);
|
|
10
9
|
}
|
|
@@ -12,11 +11,10 @@ const scaleSize = (size: number) => {
|
|
|
12
11
|
return size;
|
|
13
12
|
};
|
|
14
13
|
const getAccessibilityID = (accessibilityLabel = '') => {
|
|
15
|
-
if (Platform.OS ==='ios') {
|
|
14
|
+
if (Platform.OS === 'ios') {
|
|
16
15
|
return {
|
|
17
16
|
accessible: true,
|
|
18
17
|
testID: accessibilityLabel,
|
|
19
|
-
accessibilityLabel:undefined
|
|
20
18
|
};
|
|
21
19
|
} else {
|
|
22
20
|
return {
|
|
@@ -24,4 +22,4 @@ const getAccessibilityID = (accessibilityLabel = '') => {
|
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
|
-
export {scaleSize,getAccessibilityID};
|
|
25
|
+
export {scaleSize, getAccessibilityID};
|
package/index.ts
CHANGED
|
@@ -49,10 +49,3 @@ export * from './Title';
|
|
|
49
49
|
export * from './Title/types';
|
|
50
50
|
export * from './Badge';
|
|
51
51
|
export * from './Badge/types';
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* export trick for keep old mini app working
|
|
55
|
-
* @deprecated
|
|
56
|
-
*/
|
|
57
|
-
export * from 'react-native-modalize';
|
|
58
|
-
export * from '@gorhom/bottom-sheet';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.103.2-beta.
|
|
3
|
+
"version": "0.103.2-beta.2",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {},
|
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
"@momo-kits/foundation"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@gorhom/bottom-sheet": "2.4.1",
|
|
12
11
|
"react-native-safe-area-context": "3.1.4",
|
|
13
12
|
"react-native-linear-gradient": "2.8.3",
|
|
14
13
|
"react-native-gesture-handler": "1.10.3",
|
|
15
|
-
"react-native-modalize": "2.1.1",
|
|
16
14
|
"react-native-fast-image": "8.1.5",
|
|
17
15
|
"@react-navigation/bottom-tabs": "https://gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
|
|
18
16
|
"@react-navigation/core": "5.16.1",
|