@momo-kits/foundation 0.89.4-react-native.0.74.1 → 0.89.4-tracking.14
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.tsx +0 -2
- package/Application/Components.tsx +18 -4
- package/Application/NavigationContainer.tsx +6 -2
- package/Application/Navigator.ts +51 -31
- package/Application/StackScreen.tsx +45 -4
- package/Application/types.ts +1 -1
- package/Application/utils.tsx +36 -3
- package/Assets/icon.json +5 -5
- package/Button/index.tsx +42 -14
- package/CheckBox/index.tsx +40 -20
- package/CheckBox/types.ts +4 -0
- package/IconButton/index.tsx +30 -7
- package/Image/index.tsx +1 -2
- package/Input/Input.tsx +35 -4
- package/Input/InputDropDown.tsx +24 -4
- package/Input/InputMoney.tsx +35 -4
- package/Input/InputOTP.tsx +25 -7
- package/Input/InputSearch.tsx +56 -26
- package/Input/index.tsx +27 -2
- package/Input/styles.ts +0 -1
- package/Layout/Screen.tsx +1 -1
- package/Layout/index.ts +0 -2
- package/Loader/DotLoader.tsx +1 -1
- package/Loader/Spinner.tsx +2 -1
- package/Radio/index.tsx +39 -19
- package/Radio/types.ts +5 -0
- package/Switch/index.tsx +31 -14
- package/Switch/types.ts +4 -0
- package/package.json +23 -13
package/Switch/index.tsx
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import React, {FC} from 'react';
|
|
1
|
+
import React, {FC, useContext} from 'react';
|
|
2
2
|
import {TouchableOpacity, View} from 'react-native';
|
|
3
3
|
import {SwitchProps} from './types';
|
|
4
4
|
import styles from './styles';
|
|
5
5
|
import {Colors} from '../Consts';
|
|
6
6
|
|
|
7
|
+
const {
|
|
8
|
+
ScreenContext,
|
|
9
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
10
|
+
|
|
7
11
|
const Switch: FC<SwitchProps> = props => {
|
|
8
|
-
const {value, onChange, disabled, style} = props;
|
|
12
|
+
const {value, onChange, disabled, style, params, componentId} = props;
|
|
13
|
+
const screenInfo = useContext<any>(ScreenContext);
|
|
14
|
+
|
|
9
15
|
const circleBackgroundColor = value ? Colors.black_01 : Colors.black_03;
|
|
10
16
|
const circleAlign = value ? 'flex-end' : 'flex-start';
|
|
11
17
|
|
|
@@ -15,18 +21,29 @@ const Switch: FC<SwitchProps> = props => {
|
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
<ScreenContext.Provider
|
|
25
|
+
value={{
|
|
26
|
+
...screenInfo,
|
|
27
|
+
componentName: 'Button',
|
|
28
|
+
params,
|
|
29
|
+
state: disabled ? 'disabled' : 'enabled',
|
|
30
|
+
componentId,
|
|
31
|
+
componentValue: value,
|
|
32
|
+
action: 'click',
|
|
33
|
+
}}>
|
|
34
|
+
<TouchableOpacity
|
|
35
|
+
disabled={disabled}
|
|
36
|
+
onPress={() => onChange?.(!value)}
|
|
37
|
+
style={[
|
|
38
|
+
style,
|
|
39
|
+
styles.container,
|
|
40
|
+
{backgroundColor, alignItems: circleAlign},
|
|
41
|
+
]}>
|
|
42
|
+
<View style={[styles.circle, {backgroundColor: circleBackgroundColor}]}>
|
|
43
|
+
<View style={[styles.circleSmall, {backgroundColor}]} />
|
|
44
|
+
</View>
|
|
45
|
+
</TouchableOpacity>
|
|
46
|
+
</ScreenContext.Provider>
|
|
30
47
|
);
|
|
31
48
|
};
|
|
32
49
|
|
package/Switch/types.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.89.4-
|
|
3
|
+
"version": "0.89.4-tracking.14",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -10,24 +10,34 @@
|
|
|
10
10
|
"@momo-kits/foundation"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@gorhom/bottom-sheet": "
|
|
14
|
-
"react-native-safe-area-context": "
|
|
13
|
+
"@gorhom/bottom-sheet": "git+https://gitlab.com/momo-platform/bottom-sheet.git#main",
|
|
14
|
+
"react-native-safe-area-context": "3.1.4",
|
|
15
15
|
"react-native-linear-gradient": "2.8.3",
|
|
16
|
-
"react-native-gesture-handler": "
|
|
17
|
-
"react-native-fast-image": "8.
|
|
18
|
-
"@react-navigation/bottom-tabs": "
|
|
19
|
-
"@react-navigation/core": "
|
|
20
|
-
"@react-navigation/native": "
|
|
21
|
-
"@react-navigation/routers": "
|
|
22
|
-
"
|
|
23
|
-
"
|
|
16
|
+
"react-native-gesture-handler": "1.10.3",
|
|
17
|
+
"react-native-fast-image": "8.1.5",
|
|
18
|
+
"@react-navigation/bottom-tabs": "git+https://gitlab.com/momo-platform/react-navigation-bottom-tabs.git#main",
|
|
19
|
+
"@react-navigation/core": "5.16.1",
|
|
20
|
+
"@react-navigation/native": "5.9.8",
|
|
21
|
+
"@react-navigation/routers": "5.7.4",
|
|
22
|
+
"lottie-react-native": "3.3.2",
|
|
23
|
+
"@react-navigation/stack": "git+https://gitlab.com/momo-platform/react-navigation-stack.git#main"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react-native": "*"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
29
|
+
"@babel/core": "^7.12.9",
|
|
30
|
+
"@babel/runtime": "^7.12.5",
|
|
31
|
+
"@react-native-community/eslint-config": "^2.0.0",
|
|
32
|
+
"@types/jest": "26.0.23",
|
|
33
|
+
"@types/react-native": "0.64.4",
|
|
34
|
+
"@types/react-test-renderer": "16.9.2",
|
|
35
|
+
"babel-jest": "^26.6.3",
|
|
36
|
+
"eslint": "^7.14.0",
|
|
37
|
+
"jest": "^26.6.3",
|
|
38
|
+
"metro-react-native-babel-preset": "^0.64.0",
|
|
39
|
+
"react-test-renderer": "17.0.1",
|
|
40
|
+
"typescript": "^4.0.3",
|
|
31
41
|
"@momo-platform/versions": "4.1.11",
|
|
32
42
|
"react-scanner": "^1.1.0"
|
|
33
43
|
},
|