@momo-kits/foundation 0.75.1-beta.9 → 0.76.1-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/{Navigation → Application}/BottomTab.tsx +19 -6
- package/{Navigation → Application}/Components.tsx +24 -15
- package/{Navigation → Application}/ModalScreen.tsx +17 -13
- package/{Navigation → Application}/Navigation.ts +5 -5
- package/{Navigation → Application}/NavigationContainer.tsx +3 -3
- package/{Navigation → Application}/StackScreen.tsx +7 -7
- package/{Navigation → Application}/index.ts +7 -3
- package/{Navigation → Application}/types.ts +23 -5
- package/{Navigation → Application}/utils.tsx +4 -6
- package/Assets/icon.json +6 -0
- package/Button/index.tsx +1 -1
- package/CheckBox/index.tsx +1 -1
- package/Consts/theme.ts +1 -1
- package/Divider/index.tsx +1 -1
- package/Icon/index.tsx +2 -2
- package/IconButton/index.tsx +1 -1
- package/Image/index.tsx +4 -2
- package/Input/Input.tsx +2 -1
- package/Input/InputMoney.tsx +2 -1
- package/Input/InputSearch.tsx +4 -2
- package/Input/InputTextArea.tsx +20 -19
- package/Input/common.tsx +1 -1
- package/Input/index.tsx +2 -0
- package/Layout/Card.tsx +13 -12
- package/Layout/GridSystem.tsx +4 -2
- package/Layout/Item.tsx +14 -14
- package/Layout/Screen.tsx +188 -0
- package/Layout/Section.tsx +9 -3
- package/Layout/types.ts +3 -1
- package/Layout/utils.ts +24 -4
- package/Pagination/Dot.tsx +1 -1
- package/Pagination/PaginationDot.tsx +1 -1
- package/Pagination/PaginationNumber.tsx +1 -2
- package/Pagination/PaginationScroll.tsx +2 -1
- package/Pagination/PaginationWhiteDot.tsx +1 -1
- package/Popup/PopupNotify.tsx +1 -1
- package/Popup/PopupPromotion.tsx +1 -1
- package/Radio/index.tsx +1 -1
- package/Switch/index.tsx +1 -1
- package/Tag/index.tsx +3 -1
- package/Text/index.tsx +5 -4
- package/Text/utils.ts +14 -0
- package/index.ts +9 -2
- package/package.json +40 -40
- package/publish.sh +2 -5
- package/Layout/ScreenContainer.tsx +0 -121
- package/Navigation/Observer.ts +0 -79
- /package/{Navigation → Application}/NavigationButton.tsx +0 -0
- /package/{Navigation → Application}/Navigator.ts +0 -0
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import React, {FC} from 'react';
|
|
1
|
+
import React, {FC, useContext} from 'react';
|
|
2
2
|
import {BottomTabProps} from './types';
|
|
3
3
|
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
|
|
4
4
|
import {Icon} from '../Icon';
|
|
5
|
+
import {Text} from '../Text';
|
|
6
|
+
import {ApplicationContext} from './index';
|
|
5
7
|
|
|
6
8
|
const Tab = createBottomTabNavigator();
|
|
7
9
|
|
|
8
|
-
const BottomTab: FC<BottomTabProps> = ({tabs}) => {
|
|
10
|
+
const BottomTab: FC<BottomTabProps> = ({tabs, listeners}) => {
|
|
11
|
+
const {theme} = useContext(ApplicationContext);
|
|
9
12
|
return (
|
|
10
13
|
<Tab.Navigator>
|
|
11
|
-
{tabs.map(
|
|
14
|
+
{tabs.map(item => {
|
|
12
15
|
return (
|
|
13
16
|
<Tab.Screen
|
|
14
|
-
key={
|
|
15
|
-
name={item.
|
|
17
|
+
key={item.name}
|
|
18
|
+
name={item.name}
|
|
16
19
|
component={item.screen}
|
|
20
|
+
listeners={listeners}
|
|
17
21
|
options={{
|
|
18
|
-
tabBarLabel:
|
|
22
|
+
tabBarLabel: ({color, focused}) => {
|
|
23
|
+
return (
|
|
24
|
+
<Text
|
|
25
|
+
typography={focused ? 'label_xs' : 'description_xs'}
|
|
26
|
+
color={color}>
|
|
27
|
+
{item.label}
|
|
28
|
+
</Text>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
19
31
|
tabBarBadge: item?.badgeLabel,
|
|
20
32
|
tabBarBadgeStyle: {
|
|
21
33
|
borderColor: 'white',
|
|
@@ -24,6 +36,7 @@ const BottomTab: FC<BottomTabProps> = ({tabs}) => {
|
|
|
24
36
|
lineHeight: 14,
|
|
25
37
|
fontWeight: 'bold',
|
|
26
38
|
alignSelf: 'center',
|
|
39
|
+
fontFamily: `${theme.font}-Bold`,
|
|
27
40
|
},
|
|
28
41
|
tabBarIcon: ({color, size}) => (
|
|
29
42
|
<Icon source={item.icon} color={color} size={size} />
|
|
@@ -16,9 +16,8 @@ import {
|
|
|
16
16
|
HeaderToolkitProps,
|
|
17
17
|
TitleCustomProps,
|
|
18
18
|
} from './types';
|
|
19
|
-
import {Text} from '../Text';
|
|
19
|
+
import {scaleSize, Text} from '../Text';
|
|
20
20
|
import {Icon} from '../Icon';
|
|
21
|
-
import Observer from './Observer';
|
|
22
21
|
import {PopupNotify} from '../Popup';
|
|
23
22
|
|
|
24
23
|
const styles = StyleSheet.create({
|
|
@@ -45,12 +44,13 @@ const styles = StyleSheet.create({
|
|
|
45
44
|
borderWidth: 1,
|
|
46
45
|
borderColor: Colors.black_01,
|
|
47
46
|
},
|
|
47
|
+
headerButton: {paddingHorizontal: 4},
|
|
48
48
|
headerRightButton: {
|
|
49
49
|
flexDirection: 'row',
|
|
50
50
|
overflow: 'hidden',
|
|
51
51
|
justifyContent: 'center',
|
|
52
52
|
alignItems: 'center',
|
|
53
|
-
paddingRight: Spacing.
|
|
53
|
+
paddingRight: Spacing.S,
|
|
54
54
|
},
|
|
55
55
|
toolkitContainer: {
|
|
56
56
|
marginLeft: Spacing.S,
|
|
@@ -70,7 +70,11 @@ const styles = StyleSheet.create({
|
|
|
70
70
|
headerLeft: {
|
|
71
71
|
marginLeft: 12,
|
|
72
72
|
},
|
|
73
|
-
title: {
|
|
73
|
+
title: {
|
|
74
|
+
fontSize: scaleSize(15),
|
|
75
|
+
lineHeight: scaleSize(22),
|
|
76
|
+
fontWeight: 'bold',
|
|
77
|
+
},
|
|
74
78
|
});
|
|
75
79
|
|
|
76
80
|
const HeaderTitle: React.FC<any> = props => {
|
|
@@ -80,6 +84,7 @@ const HeaderTitle: React.FC<any> = props => {
|
|
|
80
84
|
outputRange: [0, 1],
|
|
81
85
|
extrapolate: 'clamp',
|
|
82
86
|
});
|
|
87
|
+
|
|
83
88
|
return (
|
|
84
89
|
<Animated.Text
|
|
85
90
|
{...props}
|
|
@@ -145,6 +150,7 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
|
|
|
145
150
|
image,
|
|
146
151
|
backgroundColor,
|
|
147
152
|
animatedValue,
|
|
153
|
+
useBorder = false,
|
|
148
154
|
}) => {
|
|
149
155
|
const {theme} = useContext(ApplicationContext);
|
|
150
156
|
let headerImage = theme.assets?.headerBackground;
|
|
@@ -164,7 +170,7 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
|
|
|
164
170
|
{
|
|
165
171
|
backgroundColor: backgroundColor ?? theme.colors.background.default,
|
|
166
172
|
overflow: 'hidden',
|
|
167
|
-
borderBottomWidth:
|
|
173
|
+
borderBottomWidth: useBorder ? 1 : 0,
|
|
168
174
|
borderColor: theme.colors.border.default,
|
|
169
175
|
opacity,
|
|
170
176
|
},
|
|
@@ -212,7 +218,7 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
212
218
|
|
|
213
219
|
const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
|
|
214
220
|
const validType = (item: any) => {
|
|
215
|
-
if (item.type !== NavigationButton) {
|
|
221
|
+
if (__DEV__ && item.type !== NavigationButton) {
|
|
216
222
|
console.warn(
|
|
217
223
|
'element type of NavigationButton, Please migrate to use NavigationButton of kits.',
|
|
218
224
|
);
|
|
@@ -222,19 +228,21 @@ const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
|
|
|
222
228
|
const renderAction = () => {
|
|
223
229
|
if (Array.isArray(children)) {
|
|
224
230
|
return children.map((child, index) => {
|
|
225
|
-
|
|
226
|
-
validType(child);
|
|
227
|
-
}
|
|
231
|
+
validType(child);
|
|
228
232
|
return (
|
|
229
|
-
<
|
|
233
|
+
<View key={index} style={styles.headerButton}>
|
|
230
234
|
{React.cloneElement(child, {...restProps})}
|
|
231
|
-
</
|
|
235
|
+
</View>
|
|
232
236
|
);
|
|
233
237
|
});
|
|
234
238
|
}
|
|
235
239
|
|
|
236
240
|
validType(children);
|
|
237
|
-
return
|
|
241
|
+
return (
|
|
242
|
+
<View style={styles.headerButton}>
|
|
243
|
+
{React.cloneElement(children, {...restProps})}
|
|
244
|
+
</View>
|
|
245
|
+
);
|
|
238
246
|
};
|
|
239
247
|
return <View style={styles.headerRightButton}>{renderAction()}</View>;
|
|
240
248
|
};
|
|
@@ -250,7 +258,7 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
|
|
|
250
258
|
}
|
|
251
259
|
|
|
252
260
|
useEffect(() => {
|
|
253
|
-
navigator?.getToolkit().then(toolConfig => {
|
|
261
|
+
navigator?.getToolkit().then((toolConfig: any) => {
|
|
254
262
|
setToolConfig(toolConfig);
|
|
255
263
|
});
|
|
256
264
|
}, []);
|
|
@@ -309,9 +317,10 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
|
|
|
309
317
|
};
|
|
310
318
|
|
|
311
319
|
const renderUtilityTool = () => {
|
|
312
|
-
if (
|
|
320
|
+
if (hidden === false) {
|
|
313
321
|
return (
|
|
314
322
|
<NavigationButton
|
|
323
|
+
accessibilityLabel={'UtilityTool'}
|
|
315
324
|
icon={type as string}
|
|
316
325
|
tintColor={tintColor}
|
|
317
326
|
onPress={onUtilityTool}
|
|
@@ -339,7 +348,7 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
|
|
|
339
348
|
</TouchableOpacity>
|
|
340
349
|
<View style={[styles.divider, {backgroundColor: tintColor}]} />
|
|
341
350
|
<TouchableOpacity
|
|
342
|
-
accessibilityLabel={
|
|
351
|
+
accessibilityLabel={`Toolkit/Close`}
|
|
343
352
|
onPress={onClose}>
|
|
344
353
|
<Icon
|
|
345
354
|
color={tintColor}
|
|
@@ -33,21 +33,23 @@ const ModalScreen: React.FC<any> = props => {
|
|
|
33
33
|
return <Modal {...props} />;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
const Modal: React.FC<ModalParams> =
|
|
37
|
-
const {theme} = useContext(ApplicationContext);
|
|
38
|
-
const {screen, barrierDismissible}: ModalParams = route.params;
|
|
36
|
+
const Modal: React.FC<ModalParams> = props => {
|
|
37
|
+
const {theme, navigator} = useContext(ApplicationContext);
|
|
38
|
+
const {screen, barrierDismissible}: ModalParams = props.route.params;
|
|
39
39
|
const Component = useRef(screen).current;
|
|
40
|
+
const navigation = new Navigation(props.navigation, theme);
|
|
40
41
|
const params = {
|
|
41
|
-
...route.params,
|
|
42
|
-
navigation
|
|
42
|
+
...props.route.params,
|
|
43
|
+
navigation,
|
|
43
44
|
};
|
|
45
|
+
|
|
44
46
|
delete params.screen;
|
|
45
47
|
|
|
46
|
-
const onDismiss = (
|
|
48
|
+
const onDismiss = () => {
|
|
47
49
|
if (barrierDismissible) {
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
navigator?.pop();
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
return (
|
|
@@ -81,14 +83,16 @@ const Modal: React.FC<ModalParams> = ({navigation, route}) => {
|
|
|
81
83
|
);
|
|
82
84
|
};
|
|
83
85
|
|
|
84
|
-
const BottomSheet: React.FC<BottomSheetParams> =
|
|
85
|
-
const {theme} = useContext(ApplicationContext);
|
|
86
|
-
const {screen, options}: BottomSheetParams = route.params;
|
|
86
|
+
const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
87
|
+
const {theme, navigator} = useContext(ApplicationContext);
|
|
88
|
+
const {screen, options}: BottomSheetParams = props.route.params;
|
|
87
89
|
const Component = useRef(screen).current;
|
|
90
|
+
const navigation = new Navigation(props.navigation, theme);
|
|
88
91
|
const params = {
|
|
89
|
-
...route.params,
|
|
90
|
-
navigation
|
|
92
|
+
...props.route.params,
|
|
93
|
+
navigation,
|
|
91
94
|
};
|
|
95
|
+
|
|
92
96
|
delete params.screen;
|
|
93
97
|
|
|
94
98
|
const snapPoints = useMemo(() => ['50%', '90%'], []);
|
|
@@ -123,7 +127,7 @@ const BottomSheet: React.FC<BottomSheetParams> = ({navigation, route}) => {
|
|
|
123
127
|
snapPoints={snapPoints}
|
|
124
128
|
onDismiss={() => {
|
|
125
129
|
if (mountedRef.current) {
|
|
126
|
-
|
|
130
|
+
navigator?.pop();
|
|
127
131
|
}
|
|
128
132
|
}}
|
|
129
133
|
handleComponent={null}
|
|
@@ -5,15 +5,15 @@ import {getOptions} from './utils';
|
|
|
5
5
|
import {HeaderToolkitAction} from './Components';
|
|
6
6
|
|
|
7
7
|
class Navigation {
|
|
8
|
-
instance: NavigationProp<any>;
|
|
9
|
-
theme: Theme;
|
|
8
|
+
private instance: NavigationProp<any>;
|
|
9
|
+
private readonly theme: Theme;
|
|
10
10
|
|
|
11
11
|
constructor(instance: any, theme: Theme) {
|
|
12
12
|
this.instance = instance;
|
|
13
13
|
this.theme = theme;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
verifyParams = (params: NavigationOptions) => {
|
|
16
|
+
private verifyParams = (params: NavigationOptions) => {
|
|
17
17
|
if (params.headerRight) {
|
|
18
18
|
const headerRight = params.headerRight?.();
|
|
19
19
|
if (
|
|
@@ -28,13 +28,13 @@ class Navigation {
|
|
|
28
28
|
return params;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
filterParams = (params: NavigationOptions) => {
|
|
31
|
+
private filterParams = (params: NavigationOptions) => {
|
|
32
32
|
return params;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
setOptions = (params: NavigationOptions) => {
|
|
36
36
|
if (__DEV__) {
|
|
37
|
-
params = this.
|
|
37
|
+
params = this.filterParams(params);
|
|
38
38
|
}
|
|
39
39
|
params = getOptions(params, this.theme);
|
|
40
40
|
this.instance.setOptions(params);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {useRef} from 'react';
|
|
2
2
|
import {BottomSheetModalProvider} from '@gorhom/bottom-sheet';
|
|
3
3
|
import {SafeAreaProvider} from 'react-native-safe-area-context';
|
|
4
4
|
import {
|
|
@@ -11,12 +11,12 @@ import ModalScreen from './ModalScreen';
|
|
|
11
11
|
import Navigator from './Navigator';
|
|
12
12
|
import {getDialogOptions, getModalOptions, getStackOptions} from './utils';
|
|
13
13
|
import {GridSystem} from '../Layout';
|
|
14
|
-
import {
|
|
14
|
+
import {GRIDVIEW} from '../Consts';
|
|
15
15
|
import {NavigationContainerProps} from './types';
|
|
16
|
+
import {ApplicationContext} from './index';
|
|
16
17
|
|
|
17
18
|
const Stack = createStackNavigator();
|
|
18
19
|
|
|
19
|
-
const ApplicationContext = createContext(defaultContext);
|
|
20
20
|
const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
21
21
|
screen,
|
|
22
22
|
theme,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import React, {useContext, useEffect} from 'react';
|
|
2
2
|
import {ScreenParams} from './types';
|
|
3
3
|
import Navigation from './Navigation';
|
|
4
|
-
import {ApplicationContext} from './
|
|
4
|
+
import {ApplicationContext} from './index';
|
|
5
5
|
|
|
6
|
-
const StackScreen: React.FC<
|
|
7
|
-
const {
|
|
8
|
-
const {screen: Component, options}: ScreenParams = route.params;
|
|
6
|
+
const StackScreen: React.FC<ScreenParams> = props => {
|
|
7
|
+
const {screen: Component, options}: ScreenParams = props.route.params;
|
|
9
8
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
9
|
+
const navigation = new Navigation(props.navigation, theme);
|
|
10
10
|
|
|
11
11
|
const params = {
|
|
12
|
-
...route.params,
|
|
13
|
-
navigation
|
|
12
|
+
...props.route.params,
|
|
13
|
+
navigation,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
delete params.screen;
|
|
17
17
|
|
|
18
18
|
useEffect(() => {
|
|
19
19
|
if (options) {
|
|
20
|
-
|
|
20
|
+
navigation.setOptions(options);
|
|
21
21
|
}
|
|
22
22
|
}, [options]);
|
|
23
23
|
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {NavigationContainer
|
|
2
|
-
import
|
|
1
|
+
import {NavigationContainer} from './NavigationContainer';
|
|
2
|
+
import Screen from '../Layout/Screen';
|
|
3
3
|
import NavigationButton from './NavigationButton';
|
|
4
4
|
import {HeaderRightAction} from './Components';
|
|
5
5
|
import BottomTab from './BottomTab';
|
|
6
|
+
import {createContext} from 'react';
|
|
7
|
+
import {defaultContext} from '../Consts';
|
|
8
|
+
|
|
9
|
+
const ApplicationContext = createContext(defaultContext);
|
|
6
10
|
|
|
7
11
|
export {
|
|
8
12
|
NavigationContainer,
|
|
9
13
|
ApplicationContext,
|
|
10
|
-
|
|
14
|
+
Screen,
|
|
11
15
|
NavigationButton,
|
|
12
16
|
HeaderRightAction,
|
|
13
17
|
BottomTab,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {Animated, ScrollViewProps, ViewProps} from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, {ReactNode} from 'react';
|
|
3
3
|
import Navigator from './Navigator';
|
|
4
4
|
import {PopupNotifyProps} from '../Popup/types';
|
|
5
|
+
import Navigation from './Navigation';
|
|
5
6
|
|
|
6
7
|
export type Theme = {
|
|
7
8
|
dark: boolean;
|
|
@@ -70,13 +71,22 @@ export type NavigationContainerProps = {
|
|
|
70
71
|
maxApi?: any;
|
|
71
72
|
};
|
|
72
73
|
|
|
73
|
-
export
|
|
74
|
+
export type NavigationScreenProps = {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
options?: NavigationOptions;
|
|
77
|
+
navigation: Navigation;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export interface ScreenProps extends ViewProps {
|
|
81
|
+
navigation?: Navigation;
|
|
74
82
|
enableKeyboardAvoidingView?: boolean;
|
|
75
83
|
headerBackground?: string;
|
|
76
84
|
scrollable?: boolean;
|
|
77
|
-
|
|
85
|
+
useAnimatedHeader?: boolean;
|
|
86
|
+
useExtendedHeader?: boolean;
|
|
78
87
|
scrollViewProps?: ScrollViewProps;
|
|
79
|
-
footerComponent?:
|
|
88
|
+
footerComponent?: ReactNode;
|
|
89
|
+
marginHeader?: number;
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
export type ScreenParams = {
|
|
@@ -88,7 +98,7 @@ export type ScreenParams = {
|
|
|
88
98
|
export interface ModalParams extends ScreenParams {
|
|
89
99
|
[key: string]: any;
|
|
90
100
|
screen: React.ElementType;
|
|
91
|
-
onDismiss?: (
|
|
101
|
+
onDismiss?: () => void;
|
|
92
102
|
barrierDismissible?: boolean;
|
|
93
103
|
}
|
|
94
104
|
|
|
@@ -109,7 +119,9 @@ export type NavigationButtonProps = {
|
|
|
109
119
|
export type NavigationOptions = {
|
|
110
120
|
preventBack?: PopupNotifyProps;
|
|
111
121
|
surface?: boolean;
|
|
122
|
+
headerTransparent?: boolean;
|
|
112
123
|
title?: string;
|
|
124
|
+
headerTitle?: (props?: any) => React.ReactElement;
|
|
113
125
|
headerTitleAlign?: 'left' | 'center';
|
|
114
126
|
customTitle?: TitleCustomProps;
|
|
115
127
|
headerRight?: (props?: any) => React.ReactElement;
|
|
@@ -124,6 +136,7 @@ export type HeaderBackgroundProps = {
|
|
|
124
136
|
image?: string | null;
|
|
125
137
|
backgroundColor?: string | null;
|
|
126
138
|
animatedValue?: Animated.Value;
|
|
139
|
+
useBorder?: boolean;
|
|
127
140
|
};
|
|
128
141
|
|
|
129
142
|
export type TitleCustomProps = {
|
|
@@ -145,6 +158,7 @@ export type HeaderToolkitProps = {
|
|
|
145
158
|
};
|
|
146
159
|
|
|
147
160
|
export type BottomTabItemProps = {
|
|
161
|
+
name: string;
|
|
148
162
|
label: string;
|
|
149
163
|
icon: string;
|
|
150
164
|
showDot?: boolean;
|
|
@@ -154,4 +168,8 @@ export type BottomTabItemProps = {
|
|
|
154
168
|
|
|
155
169
|
export type BottomTabProps = {
|
|
156
170
|
tabs: BottomTabItemProps[];
|
|
171
|
+
listeners?: {
|
|
172
|
+
tabPress?: any;
|
|
173
|
+
focus?: any;
|
|
174
|
+
};
|
|
157
175
|
};
|
|
@@ -26,7 +26,7 @@ const getTintColor = (theme: Theme): any => {
|
|
|
26
26
|
|
|
27
27
|
const getStackOptions = (theme: Theme): StackNavigationOptions => {
|
|
28
28
|
return {
|
|
29
|
-
headerTitleAlign: '
|
|
29
|
+
headerTitleAlign: 'left',
|
|
30
30
|
headerTitle: HeaderTitle,
|
|
31
31
|
headerBackground: HeaderBackground,
|
|
32
32
|
headerLeft: (props: any) => <HeaderLeft {...props} />,
|
|
@@ -37,7 +37,7 @@ const getStackOptions = (theme: Theme): StackNavigationOptions => {
|
|
|
37
37
|
|
|
38
38
|
const getDialogOptions = (theme: Theme): StackNavigationOptions => {
|
|
39
39
|
return {
|
|
40
|
-
headerTitleAlign: '
|
|
40
|
+
headerTitleAlign: 'left',
|
|
41
41
|
headerTitle: HeaderTitle,
|
|
42
42
|
headerLeft: (props: any) => <HeaderLeft {...props} />,
|
|
43
43
|
headerBackground: HeaderBackground,
|
|
@@ -96,6 +96,7 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
96
96
|
...backgroundProps,
|
|
97
97
|
image: null,
|
|
98
98
|
backgroundColor: theme.colors.background.surface,
|
|
99
|
+
useBorder: true,
|
|
99
100
|
};
|
|
100
101
|
} else {
|
|
101
102
|
backgroundProps = {};
|
|
@@ -105,9 +106,6 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
105
106
|
if (params.animatedValue) {
|
|
106
107
|
backgroundProps = {...backgroundProps, animatedValue: params.animatedValue};
|
|
107
108
|
titleProps = {...titleProps, animatedValue: params.animatedValue};
|
|
108
|
-
options = {...options, headerTransparent: true};
|
|
109
|
-
} else {
|
|
110
|
-
options = {...options, headerTransparent: false};
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
if (params.customTitle) {
|
|
@@ -118,7 +116,7 @@ const getOptions = (params: NavigationOptions, theme: Theme) => {
|
|
|
118
116
|
return <HeaderCustom {...params.customTitle} {...props} />;
|
|
119
117
|
},
|
|
120
118
|
};
|
|
121
|
-
} else {
|
|
119
|
+
} else if (!params.headerTitle) {
|
|
122
120
|
options = {
|
|
123
121
|
...options,
|
|
124
122
|
headerTitle: (props: any) => {
|
package/Assets/icon.json
CHANGED
|
@@ -3943,5 +3943,11 @@
|
|
|
3943
3943
|
},
|
|
3944
3944
|
"ic_minus": {
|
|
3945
3945
|
"uri": "https://img.mservice.com.vn/app/img/kits/minus.png"
|
|
3946
|
+
},
|
|
3947
|
+
"ic_navigation": {
|
|
3948
|
+
"uri": "https://static.momocdn.net/app/img/kits/ic_navigation.png"
|
|
3949
|
+
},
|
|
3950
|
+
"ic_money_bag": {
|
|
3951
|
+
"uri": "https://static.momocdn.net/app/img/kits/ic_money_bag.png"
|
|
3946
3952
|
}
|
|
3947
3953
|
}
|
package/Button/index.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TouchableOpacityProps,
|
|
6
6
|
View,
|
|
7
7
|
} from 'react-native';
|
|
8
|
-
import {ApplicationContext} from '../
|
|
8
|
+
import {ApplicationContext} from '../Application';
|
|
9
9
|
import {Text} from '../Text';
|
|
10
10
|
import {Typography} from '../Text/types';
|
|
11
11
|
import {Colors} from '../Consts';
|
package/CheckBox/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, {FC, useContext} from 'react';
|
|
|
2
2
|
import {TouchableOpacity, View} from 'react-native';
|
|
3
3
|
import {CheckBoxProps} from './types';
|
|
4
4
|
import styles from './styles';
|
|
5
|
-
import {ApplicationContext} from '../
|
|
5
|
+
import {ApplicationContext} from '../Application';
|
|
6
6
|
import {Text} from '../Text';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
|
package/Consts/theme.ts
CHANGED
package/Divider/index.tsx
CHANGED
package/Icon/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, {useContext} from 'react';
|
|
2
2
|
import IconSources from '../Assets/icon.json';
|
|
3
3
|
import {IconProps} from './types';
|
|
4
|
-
import {ApplicationContext} from '../
|
|
4
|
+
import {ApplicationContext} from '../Application';
|
|
5
5
|
import {Image} from '../Image';
|
|
6
6
|
|
|
7
7
|
const Icon: React.FC<IconProps> = ({source, size, color, style = {}}) => {
|
|
@@ -20,7 +20,7 @@ const Icon: React.FC<IconProps> = ({source, size, color, style = {}}) => {
|
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<Image
|
|
23
|
-
accessibilityLabel={`Icon/${getIconSource()}`}
|
|
23
|
+
accessibilityLabel={`Icon/${getIconSource()?.uri}`}
|
|
24
24
|
loading={false}
|
|
25
25
|
source={getIconSource()}
|
|
26
26
|
style={[style, {width: size, height: size}]}
|
package/IconButton/index.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TouchableOpacity,
|
|
6
6
|
TouchableOpacityProps,
|
|
7
7
|
} from 'react-native';
|
|
8
|
-
import {ApplicationContext} from '../
|
|
8
|
+
import {ApplicationContext} from '../Application';
|
|
9
9
|
import {Colors} from '../Consts';
|
|
10
10
|
import {Icon} from '../Icon';
|
|
11
11
|
import styles from './styles';
|
package/Image/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, {useContext, useState} from 'react';
|
|
|
2
2
|
import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native';
|
|
3
3
|
import FastImage from 'react-native-fast-image';
|
|
4
4
|
import styles from './styles';
|
|
5
|
-
import {ApplicationContext} from '../
|
|
5
|
+
import {ApplicationContext} from '../Application';
|
|
6
6
|
import {Skeleton} from '../Skeleton';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
import {Styles} from '../Consts';
|
|
@@ -56,7 +56,9 @@ const Image: React.FC<ImageProps> = ({
|
|
|
56
56
|
return (
|
|
57
57
|
<View
|
|
58
58
|
style={[styles.container, style]}
|
|
59
|
-
accessibilityLabel={`Image/${
|
|
59
|
+
accessibilityLabel={`Image/${
|
|
60
|
+
accessibilityLabel ?? (typeof source === 'number' ? source : source.uri)
|
|
61
|
+
}`}>
|
|
60
62
|
<FastImage
|
|
61
63
|
{...rest}
|
|
62
64
|
source={source}
|
package/Input/Input.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
TouchableOpacity,
|
|
7
7
|
View,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import {ApplicationContext} from '../
|
|
9
|
+
import {ApplicationContext} from '../Application';
|
|
10
10
|
import styles from './styles';
|
|
11
11
|
import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
|
|
12
12
|
import {InputProps} from './index';
|
|
@@ -86,6 +86,7 @@ const Input: FC<InputProps> = ({
|
|
|
86
86
|
<View style={styles.inputView}>
|
|
87
87
|
<TextInput
|
|
88
88
|
{...props}
|
|
89
|
+
accessibilityLabel={`TextInput`}
|
|
89
90
|
editable={!disabled}
|
|
90
91
|
textAlignVertical="top"
|
|
91
92
|
ref={inputRef}
|
package/Input/InputMoney.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
TouchableOpacity,
|
|
7
7
|
View,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import {ApplicationContext} from '../
|
|
9
|
+
import {ApplicationContext} from '../Application';
|
|
10
10
|
import styles from './styles';
|
|
11
11
|
import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
|
|
12
12
|
import {InputMoneyProps} from './index';
|
|
@@ -86,6 +86,7 @@ const InputMoney: FC<InputMoneyProps> = ({
|
|
|
86
86
|
<View style={styles.inputView}>
|
|
87
87
|
<TextInput
|
|
88
88
|
{...props}
|
|
89
|
+
accessibilityLabel={`TextInput`}
|
|
89
90
|
editable={!disabled}
|
|
90
91
|
textAlignVertical="top"
|
|
91
92
|
ref={inputRef}
|
package/Input/InputSearch.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
View,
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import {InputSearchProps} from './index';
|
|
10
|
-
import {ApplicationContext} from '../
|
|
10
|
+
import {ApplicationContext} from '../Application';
|
|
11
11
|
import styles from './styles';
|
|
12
12
|
import {Icon} from '../Icon';
|
|
13
13
|
import {Text} from '../Text';
|
|
@@ -26,6 +26,7 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
26
26
|
showBorder = true,
|
|
27
27
|
style,
|
|
28
28
|
defaultValue,
|
|
29
|
+
onPressButtonText,
|
|
29
30
|
...props
|
|
30
31
|
}) => {
|
|
31
32
|
const {theme} = useContext(ApplicationContext);
|
|
@@ -73,6 +74,7 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
73
74
|
return (
|
|
74
75
|
<TextInput
|
|
75
76
|
{...props}
|
|
77
|
+
accessibilityLabel={`TextInput`}
|
|
76
78
|
textAlignVertical="top"
|
|
77
79
|
ref={inputRef}
|
|
78
80
|
style={[
|
|
@@ -148,7 +150,7 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
148
150
|
{renderIconView()}
|
|
149
151
|
</View>
|
|
150
152
|
{showButtonText && (
|
|
151
|
-
<TouchableOpacity>
|
|
153
|
+
<TouchableOpacity onPress={onPressButtonText}>
|
|
152
154
|
<Text typography={'action_default'} style={styles.textButton}>
|
|
153
155
|
{buttonText}
|
|
154
156
|
</Text>
|