@momo-kits/foundation 0.92.21-beta.3 → 0.92.21-beta.4
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/BottomTab/BottomTabBar.tsx +2 -2
- package/Application/BottomTab/index.tsx +1 -1
- package/Application/StackScreen.tsx +87 -4
- package/Application/types.ts +9 -2
- package/Icon/types.ts +0 -1
- package/Input/InputDropDown.tsx +2 -2
- package/Layout/FloatingButton.tsx +1 -1
- package/Layout/GridSystem.tsx +1 -1
- package/Title/index.tsx +6 -9
- package/package.json +2 -2
|
@@ -125,7 +125,7 @@ export default function BottomTabBar({
|
|
|
125
125
|
);
|
|
126
126
|
});
|
|
127
127
|
},
|
|
128
|
-
[JSON.stringify(routes), state, descriptors, focusedTab]
|
|
128
|
+
[JSON.stringify(routes), state, descriptors, focusedTab]
|
|
129
129
|
);
|
|
130
130
|
|
|
131
131
|
/**
|
|
@@ -153,7 +153,7 @@ export default function BottomTabBar({
|
|
|
153
153
|
</View>
|
|
154
154
|
<View
|
|
155
155
|
style={{
|
|
156
|
-
top: -
|
|
156
|
+
top: -4,
|
|
157
157
|
backgroundColor: activeTintColor ?? theme.colors.primary,
|
|
158
158
|
borderRadius: Radius.XL,
|
|
159
159
|
paddingHorizontal: 6,
|
|
@@ -101,7 +101,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
101
101
|
name={item.name}
|
|
102
102
|
component={TabScreen}
|
|
103
103
|
initialParams={{...item, nested}}
|
|
104
|
-
listeners={listeners}
|
|
104
|
+
listeners={item.listeners ?? listeners}
|
|
105
105
|
options={{
|
|
106
106
|
tabBarLabel: ({color, focused}) => {
|
|
107
107
|
return (
|
|
@@ -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/Application/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {StackNavigationOptions} from '@react-navigation/stack';
|
|
2
|
+
import {EventArg} from '@react-navigation/core';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import {Animated, ViewProps} from 'react-native';
|
|
4
5
|
import {PopupNotifyProps} from '../Popup/types';
|
|
@@ -198,6 +199,11 @@ export type BottomTabItemProps = {
|
|
|
198
199
|
screen: Screen;
|
|
199
200
|
options: NavigationOptions;
|
|
200
201
|
initialParams?: any;
|
|
202
|
+
listeners?: {
|
|
203
|
+
tabPress?: (e: EventArg<'tabPress', true, undefined>) => void;
|
|
204
|
+
focus?: (e: EventArg<'focus', false, unknown>) => void;
|
|
205
|
+
blur?: (e: EventArg<'blur', false, unknown>) => void;
|
|
206
|
+
};
|
|
201
207
|
};
|
|
202
208
|
|
|
203
209
|
export type BottomTabProps = {
|
|
@@ -206,8 +212,9 @@ export type BottomTabProps = {
|
|
|
206
212
|
initialRouteName?: string;
|
|
207
213
|
navigation: Navigation;
|
|
208
214
|
listeners?: {
|
|
209
|
-
tabPress?:
|
|
210
|
-
focus?:
|
|
215
|
+
tabPress?: (e: EventArg<'tabPress', true, undefined>) => void;
|
|
216
|
+
focus?: (e: EventArg<'focus', false, unknown>) => void;
|
|
217
|
+
blur?: (e: EventArg<'blur', false, unknown>) => void;
|
|
211
218
|
};
|
|
212
219
|
floatingButton?: FloatingButtonProps;
|
|
213
220
|
};
|
package/Icon/types.ts
CHANGED
package/Input/InputDropDown.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import {ApplicationContext, ComponentContext} from '../Application';
|
|
|
4
4
|
import {Styles} from '../Consts';
|
|
5
5
|
import {Icon} from '../Icon';
|
|
6
6
|
import {Loader} from '../Loader';
|
|
7
|
-
import {ErrorView, FloatingView, getSizeStyle} from './common';
|
|
7
|
+
import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
|
|
8
8
|
import {InputDropDownProps} from './index';
|
|
9
9
|
import styles from './styles';
|
|
10
10
|
|
|
@@ -61,7 +61,7 @@ const InputDropDown = ({
|
|
|
61
61
|
styles.inputWrapper,
|
|
62
62
|
{backgroundColor: theme.colors.background.surface},
|
|
63
63
|
getSizeStyle(size),
|
|
64
|
-
|
|
64
|
+
getBorderColor(theme, false, errorMessage, disabled),
|
|
65
65
|
]}>
|
|
66
66
|
<FloatingView
|
|
67
67
|
floatingValue={floatingValue}
|
package/Layout/GridSystem.tsx
CHANGED
|
@@ -53,7 +53,7 @@ const GridSystem: React.FC<any> = ({
|
|
|
53
53
|
{list.map((_, index) => {
|
|
54
54
|
return (
|
|
55
55
|
<View style={{flexDirection: 'row'}} key={index.toString()}>
|
|
56
|
-
{index !==
|
|
56
|
+
{index !== 0 && <View style={{width: grid.gutterSize}} />}
|
|
57
57
|
<View
|
|
58
58
|
key={`Grid${index.toString()}`}
|
|
59
59
|
pointerEvents="none"
|
package/Title/index.tsx
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React, {FC, useContext, useState} from 'react';
|
|
2
2
|
import {Text as RNText, TouchableOpacity, View, ViewStyle} from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
ApplicationContext,
|
|
9
|
-
scaleSize,
|
|
10
|
-
Text,
|
|
11
|
-
} from '@momo-kits/foundation';
|
|
3
|
+
import {Icon} from '../Icon';
|
|
4
|
+
import {scaleSize, Text} from '../Text';
|
|
5
|
+
import {ApplicationContext} from '../Application';
|
|
6
|
+
import {Badge} from '../Badge';
|
|
7
|
+
import {Colors} from '../Consts';
|
|
12
8
|
import styles from './styles';
|
|
13
9
|
import {TitleProps} from './types';
|
|
10
|
+
import {Typography} from '../Text/types';
|
|
14
11
|
|
|
15
12
|
const Title: FC<TitleProps> = ({
|
|
16
13
|
title = 'Title',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.92.21-beta.
|
|
3
|
+
"version": "0.92.21-beta.4",
|
|
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": {
|