@momo-kits/foundation 0.89.4-react-native.0.71.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/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
- <TouchableOpacity
19
- disabled={disabled}
20
- onPress={() => onChange?.(!value)}
21
- style={[
22
- style,
23
- styles.container,
24
- {backgroundColor, alignItems: circleAlign},
25
- ]}>
26
- <View style={[styles.circle, {backgroundColor: circleBackgroundColor}]}>
27
- <View style={[styles.circleSmall, {backgroundColor}]} />
28
- </View>
29
- </TouchableOpacity>
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
@@ -23,4 +23,8 @@ export type SwitchProps = {
23
23
  * Accepts an object of style properties.
24
24
  */
25
25
  style?: ViewStyle;
26
+
27
+ params?: any
28
+
29
+ componentId?: string
26
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.89.4-react-native.0.71.1",
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": "4.6.1",
14
- "react-native-safe-area-context": "4.9.0",
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": "2.16.0",
17
- "react-native-fast-image": "8.6.3",
18
- "@react-navigation/bottom-tabs": "6.5.20",
19
- "@react-navigation/core": "6.4.16",
20
- "@react-navigation/native": "6.1.17",
21
- "@react-navigation/routers": "6.1.9",
22
- "@react-navigation/stack": "6.3.29",
23
- "lottie-react-native": "6.7.2"
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
- "@types/react": "^18.2.6",
30
- "typescript": "5.0.4",
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
  },