@momo-kits/foundation 0.81.36 → 0.81.37-tracking.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.
@@ -183,7 +183,7 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
183
183
  const canGoBack = navigator?.ref.current?.canGoBack();
184
184
  if (!canGoBack && navigator?.trackingInfo) {
185
185
  const currentRoute = navigator?.ref?.current.getCurrentRoute();
186
- navigator?.maxApi?.trackEvent('service_icon_clicked', {
186
+ navigator?.maxApi?.trackEvent?.('service_icon_clicked', {
187
187
  feature_code: navigator.trackingInfo.code,
188
188
  app_id: navigator.trackingInfo.appId,
189
189
  miniapp_version: navigator.trackingInfo.buildNumber,
@@ -242,9 +242,8 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
242
242
  animatedValue,
243
243
  useBorder = false,
244
244
  }) => {
245
- const {theme, config} = useContext(ApplicationContext);
246
- let headerImage =
247
- config?.navigationBar?.headerBar ?? theme.assets?.headerBackground;
245
+ const {theme} = useContext(ApplicationContext);
246
+ let headerImage = theme.assets?.headerBackground;
248
247
  if (image === null) {
249
248
  headerImage = undefined;
250
249
  }
@@ -95,7 +95,8 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
95
95
  const insets = useSafeAreaInsets();
96
96
  const {theme, navigator} = useContext(ApplicationContext);
97
97
  const [keyboardSnap, setKeyboardSnap] = useState(0);
98
- const {screen, options, snapPoint}: BottomSheetParams = props.route.params;
98
+ const {screen, options, snapPoint, indicatorColor}: BottomSheetParams =
99
+ props.route.params;
99
100
  const Component = useRef(screen).current;
100
101
  const navigation = new Navigation(props.navigation, theme);
101
102
  const params = {
@@ -167,14 +168,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
167
168
  handleComponent={null}
168
169
  backdropComponent={backdropComponent}>
169
170
  <BottomSheetView accessibilityLabel={'BottomSheet'}>
170
- <View
171
- style={[
172
- styles.sheetContainer,
173
- {
174
- backgroundColor,
175
- paddingBottom: Math.min(insets.bottom, 20) + Spacing.S,
176
- },
177
- ]}>
171
+ <View style={[styles.sheetContainer, {backgroundColor}]}>
178
172
  <View style={styles.indicatorContainer}>
179
173
  <View
180
174
  style={[
@@ -233,6 +227,12 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
233
227
  ),
234
228
  }}
235
229
  />
230
+ <View
231
+ style={{
232
+ height: Math.min(insets.bottom, 20),
233
+ backgroundColor: indicatorColor ?? backgroundColor,
234
+ }}
235
+ />
236
236
  </View>
237
237
  </BottomSheetView>
238
238
  </BottomSheetModal>
@@ -29,7 +29,11 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
29
29
  const navigator = useRef(new Navigator(navigationRef));
30
30
  const [showGrid, setShowGrid] = useState(false);
31
31
  const [language, setLanguage] = useState<'vi' | 'en'>('vi');
32
- const [config, setConfig] = useState(undefined);
32
+ const [config, setConfig] = useState<any>(undefined);
33
+ let assets = theme.assets;
34
+ if (config) {
35
+ assets = {...assets, headerBackground: config.navigationBar?.headerBar};
36
+ }
33
37
 
34
38
  /**
35
39
  * handle mini language & listen change
@@ -83,7 +87,10 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
83
87
  <BottomSheetModalProvider>
84
88
  <ApplicationContext.Provider
85
89
  value={{
86
- theme,
90
+ theme: {
91
+ ...theme,
92
+ assets: assets,
93
+ },
87
94
  navigator: navigator.current,
88
95
  showGrid,
89
96
  language,
@@ -5,6 +5,10 @@ import {ApplicationContext} from './index';
5
5
  import {GridSystem} from '../Layout';
6
6
  import {useHeaderHeight} from '@react-navigation/stack';
7
7
 
8
+ const {
9
+ ScreenContext,
10
+ } = require('react-native/Libraries/Components/ScreenContext');
11
+
8
12
  const StackScreen: React.FC<ScreenParams> = props => {
9
13
  const {screen: Component, options}: ScreenParams = props.route.params;
10
14
  const {theme, showGrid, navigator} = useContext(ApplicationContext);
@@ -47,14 +51,14 @@ const StackScreen: React.FC<ScreenParams> = props => {
47
51
  pre_screen_name = routes[routesLength - 2]?.params?.screen?.name;
48
52
  }
49
53
 
50
- navigator?.maxApi?.trackEvent('service_frame_displayed', {
54
+ navigator?.maxApi?.trackEvent?.('service_frame_displayed', {
51
55
  ...tracking,
52
56
  pre_screen_name,
53
57
  trigger_id: '111378000000000000',
54
58
  });
55
59
 
56
60
  return props.navigation.addListener('beforeRemove', () => {
57
- navigator?.maxApi?.trackEvent('service_icon_clicked', {
61
+ navigator?.maxApi?.trackEvent?.('service_icon_clicked', {
58
62
  ...tracking,
59
63
  trigger_id: '111154000000000000',
60
64
  icon_name: 'back',
@@ -64,10 +68,14 @@ const StackScreen: React.FC<ScreenParams> = props => {
64
68
  }, []);
65
69
 
66
70
  return (
67
- <>
71
+ <ScreenContext.Provider
72
+ value={{
73
+ screenName: Component.name,
74
+ elementTracking: navigator?.maxApi?.elementTracking,
75
+ }}>
68
76
  <Component heightHeader={heightHeader} {...params} />
69
77
  {showGrid && <GridSystem />}
70
- </>
78
+ </ScreenContext.Provider>
71
79
  );
72
80
  };
73
81
 
@@ -1,20 +1,21 @@
1
1
  import {NavigationContainer} from './NavigationContainer';
2
2
  import Screen from '../Layout/Screen';
3
3
  import {
4
- NavigationButton,
5
- HeaderTitle,
6
- HeaderLeft,
4
+ HeaderAnimated,
7
5
  HeaderBackground,
6
+ HeaderCustom,
7
+ HeaderLeft,
8
8
  HeaderRightAction,
9
+ HeaderTitle,
9
10
  HeaderToolkitAction,
10
- HeaderCustom,
11
- HeaderAnimated,
11
+ NavigationButton,
12
12
  } from './Components';
13
13
  import BottomTab from './BottomTab';
14
14
  import {createContext} from 'react';
15
15
  import {defaultContext} from '../Consts';
16
16
 
17
17
  const ApplicationContext = createContext(defaultContext);
18
+
18
19
  export {
19
20
  NavigationContainer,
20
21
  ApplicationContext,
@@ -119,6 +119,7 @@ export interface BottomSheetParams extends ScreenParams {
119
119
  [key: string]: any;
120
120
  onDismiss?: () => void;
121
121
  snapPoint?: '30%' | '50%' | '70%' | '90%' | 'content';
122
+ indicatorColor?: string;
122
123
  }
123
124
 
124
125
  export type NavigationButtonProps = {
package/Button/index.tsx CHANGED
@@ -6,7 +6,6 @@ import {
6
6
  TouchableOpacityProps,
7
7
  View,
8
8
  } from 'react-native';
9
-
10
9
  import LinearGradient from 'react-native-linear-gradient';
11
10
  import {ApplicationContext} from '../Application';
12
11
  import {Text} from '../Text';
@@ -16,6 +15,10 @@ import styles from './styles';
16
15
  import {Icon} from '../Icon';
17
16
  import {Loader} from '../Loader';
18
17
 
18
+ const {
19
+ ScreenContext,
20
+ } = require('react-native/Libraries/Components/ScreenContext');
21
+
19
22
  const AnimationLinear = Animated.createAnimatedComponent(LinearGradient);
20
23
 
21
24
  export interface ButtonProps extends TouchableOpacityProps {
@@ -94,6 +97,8 @@ const Button: FC<ButtonProps> = ({
94
97
  end: {x: 0, y: 0.5},
95
98
  };
96
99
  }
100
+
101
+ const screenInfo = useContext<any>(ScreenContext);
97
102
  const getSizeStyle = () => {
98
103
  const styleSheet: {[key: string]: any} = styles;
99
104
  return styleSheet[size ?? 'small'];
@@ -291,20 +296,28 @@ const Button: FC<ButtonProps> = ({
291
296
  const activeOpacity = type === 'disabled' ? 0.75 : 0.5;
292
297
 
293
298
  return (
294
- <TouchableOpacity
295
- {...rest}
296
- accessibilityLabel={`Button/${title}`}
297
- activeOpacity={activeOpacity}
298
- onPress={onPressButton}
299
- style={buttonStyle}>
300
- {renderLeading()}
301
- {renderTitle()}
302
- {renderTrailing()}
303
- {gradientPros && (
304
- <AnimationLinear {...gradientPros} style={styles.gradientView} />
305
- )}
306
- {gradientPros && <View style={styles.strokeView} />}
307
- </TouchableOpacity>
299
+ <ScreenContext.Provider
300
+ value={{
301
+ ...screenInfo,
302
+ componentName: 'Button',
303
+ params: {
304
+ title,
305
+ },
306
+ }}>
307
+ <TouchableOpacity
308
+ {...rest}
309
+ activeOpacity={activeOpacity}
310
+ onPress={onPressButton}
311
+ style={buttonStyle}>
312
+ {renderLeading()}
313
+ {renderTitle()}
314
+ {renderTrailing()}
315
+ {gradientPros && (
316
+ <AnimationLinear {...gradientPros} style={styles.gradientView} />
317
+ )}
318
+ {gradientPros && <View style={styles.strokeView} />}
319
+ </TouchableOpacity>
320
+ </ScreenContext.Provider>
308
321
  );
309
322
  };
310
323
 
@@ -6,6 +6,10 @@ import {ApplicationContext} from '../Application';
6
6
  import {Text} from '../Text';
7
7
  import {Icon} from '../Icon';
8
8
 
9
+ const {
10
+ ScreenContext,
11
+ } = require('react-native/Libraries/Components/ScreenContext');
12
+
9
13
  const CheckBox: FC<CheckBoxProps> = ({
10
14
  value,
11
15
  disabled,
@@ -19,6 +23,7 @@ const CheckBox: FC<CheckBoxProps> = ({
19
23
  const iconSource = indeterminate ? 'ic_minus' : 'ic_checked';
20
24
  let borderColor = theme.colors.text.default;
21
25
  let backgroundColor = theme.colors.background.surface;
26
+ const screenInfo = useContext<any>(ScreenContext);
22
27
 
23
28
  if (haveValue) {
24
29
  borderColor = theme.colors.primary;
@@ -35,27 +40,35 @@ const CheckBox: FC<CheckBoxProps> = ({
35
40
  }
36
41
 
37
42
  return (
38
- <TouchableOpacity
39
- accessibilityLabel={`CheckBox/${label}/${value}`}
40
- activeOpacity={0.8}
41
- onPress={() => onChange?.(!value)}
42
- disabled={disabled}
43
- style={[style, styles.container]}>
44
- <View
45
- style={[
46
- {borderColor, backgroundColor, borderWidth: 1},
47
- styles.checkbox,
48
- ]}>
49
- {haveValue && (
50
- <Icon
51
- color={theme.colors.background.surface}
52
- size={20}
53
- source={iconSource}
54
- />
55
- )}
56
- </View>
57
- {!!label && <Text typography={'description_default'}>{label}</Text>}
58
- </TouchableOpacity>
43
+ <ScreenContext.Provider
44
+ value={{
45
+ ...screenInfo,
46
+ componentName: 'CheckBox',
47
+ params: {
48
+ value,
49
+ },
50
+ }}>
51
+ <TouchableOpacity
52
+ activeOpacity={0.8}
53
+ onPress={() => onChange?.(!value)}
54
+ disabled={disabled}
55
+ style={[style, styles.container]}>
56
+ <View
57
+ style={[
58
+ {borderColor, backgroundColor, borderWidth: 1},
59
+ styles.checkbox,
60
+ ]}>
61
+ {haveValue && (
62
+ <Icon
63
+ color={theme.colors.background.surface}
64
+ size={20}
65
+ source={iconSource}
66
+ />
67
+ )}
68
+ </View>
69
+ {!!label && <Text typography={'description_default'}>{label}</Text>}
70
+ </TouchableOpacity>
71
+ </ScreenContext.Provider>
59
72
  );
60
73
  };
61
74
 
@@ -10,6 +10,10 @@ import {Colors} from '../Consts';
10
10
  import {Icon} from '../Icon';
11
11
  import styles from './styles';
12
12
 
13
+ const {
14
+ ScreenContext,
15
+ } = require('react-native/Libraries/Components/ScreenContext');
16
+
13
17
  export interface IconButtonProps extends TouchableOpacityProps {
14
18
  /**
15
19
  * Represents the name or key of the icon to be displayed on the IconButton.
@@ -36,6 +40,7 @@ const IconButton: React.FC<IconButtonProps> = ({
36
40
  ...rest
37
41
  }) => {
38
42
  const {theme} = useContext(ApplicationContext);
43
+ const screenInfo = useContext<any>(ScreenContext);
39
44
 
40
45
  /**
41
46
  * get size icon button
@@ -121,14 +126,22 @@ const IconButton: React.FC<IconButtonProps> = ({
121
126
  const iconSize = size === 'small' ? 16 : 24;
122
127
 
123
128
  return (
124
- <TouchableOpacity
125
- {...rest}
126
- accessibilityLabel={`IconButton/${icon}`}
127
- activeOpacity={activeOpacity}
128
- onPress={onPressButton}
129
- style={buttonStyle}>
130
- <Icon size={iconSize} source={icon} color={getIconColor()} />
131
- </TouchableOpacity>
129
+ <ScreenContext.Provider
130
+ value={{
131
+ ...screenInfo,
132
+ componentName: 'IconButton',
133
+ params: {
134
+ icon,
135
+ },
136
+ }}>
137
+ <TouchableOpacity
138
+ {...rest}
139
+ activeOpacity={activeOpacity}
140
+ onPress={onPressButton}
141
+ style={buttonStyle}>
142
+ <Icon size={iconSize} source={icon} color={getIconColor()} />
143
+ </TouchableOpacity>
144
+ </ScreenContext.Provider>
132
145
  );
133
146
  };
134
147
 
package/Image/index.tsx CHANGED
@@ -47,6 +47,7 @@ const Image: React.FC<ImageProps> = ({
47
47
  source={source}
48
48
  style={[styles.container, style]}
49
49
  onProgress={() => {
50
+ error.current = false;
50
51
  if (status !== 'loading' && loading) {
51
52
  setStatus('loading');
52
53
  }
package/Input/styles.ts CHANGED
@@ -7,7 +7,6 @@ export default StyleSheet.create({
7
7
  input: {
8
8
  flex: 1,
9
9
  paddingLeft: Spacing.M,
10
- height: '100%',
11
10
  fontSize: scaleSize(15),
12
11
  },
13
12
  wrapper: {
package/Layout/Card.tsx CHANGED
@@ -27,6 +27,7 @@ const Card: React.FC<CardProps> = ({
27
27
  style,
28
28
  backgroundImage,
29
29
  useShadow = false,
30
+ ...props
30
31
  }) => {
31
32
  const {showGrid} = useContext(ApplicationContext);
32
33
  const {numberOfColumns} = useGridSystem();
@@ -141,6 +142,7 @@ const Card: React.FC<CardProps> = ({
141
142
  return (
142
143
  <GridContext.Provider value={gridContext}>
143
144
  <View
145
+ {...props}
144
146
  accessibilityLabel={`Card`}
145
147
  style={[
146
148
  style,
package/Layout/Screen.tsx CHANGED
@@ -12,6 +12,7 @@ import {useHeaderHeight} from '@react-navigation/stack';
12
12
  import {useSafeAreaInsets} from 'react-native-safe-area-context';
13
13
  import React, {
14
14
  forwardRef,
15
+ Fragment,
15
16
  ReactNode,
16
17
  useContext,
17
18
  useEffect,
@@ -101,7 +102,7 @@ const Screen = forwardRef(
101
102
  ref,
102
103
  ) => {
103
104
  const animatedValue = useRef<Animated.Value | undefined>(undefined);
104
- const {theme, config} = useContext(ApplicationContext);
105
+ const {theme} = useContext(ApplicationContext);
105
106
  const insets = useSafeAreaInsets();
106
107
  const heightHeader = useHeaderHeight();
107
108
  const currentTint = useRef(Colors.black_01);
@@ -117,8 +118,7 @@ const Screen = forwardRef(
117
118
  }
118
119
 
119
120
  if (headerType == 'extended') {
120
- headerBackground =
121
- config?.navigationBar?.headerBar ?? theme.assets?.headerBackground;
121
+ headerBackground = theme.assets?.headerBackground;
122
122
  }
123
123
 
124
124
  useEffect(() => {
@@ -260,25 +260,33 @@ const Screen = forwardRef(
260
260
  /**
261
261
  * build content for screen
262
262
  */
263
- const renderContent = () => {
264
- const results = validateChildren(children, [Section, Card]);
263
+ const renderContent = (children: any): any => {
264
+ const results = validateChildren(children, [Section, Card, undefined]);
265
265
  if (Array.isArray(results)) {
266
266
  return results.map((item, index) => {
267
- const space = item.props?.useMargin === false ? 0 : Spacing.M;
268
- return (
269
- <View
270
- key={`ScreenItem${index}`}
271
- style={{
272
- marginTop: space,
273
- flex: item.props?.expanded ? 1 : undefined,
274
- }}>
275
- {item}
276
- </View>
277
- );
267
+ const space = item?.props?.useMargin === false ? 0 : Spacing.M;
268
+ if (item?.type == Fragment) {
269
+ return renderContent(item?.props?.children);
270
+ }
271
+ if (item) {
272
+ return (
273
+ <View
274
+ key={`ScreenItem${index}`}
275
+ style={{
276
+ marginTop: space,
277
+ flex: item.props?.expanded ? 1 : undefined,
278
+ }}>
279
+ {item}
280
+ </View>
281
+ );
282
+ }
278
283
  });
279
284
  } else {
280
285
  const item: any = children;
281
286
  const space = item?.props?.useMargin === false ? 0 : Spacing.M;
287
+ if (item?.type == Fragment) {
288
+ return renderContent(item?.props?.children);
289
+ }
282
290
  return (
283
291
  <View
284
292
  key={`ScreenItem`}
@@ -327,7 +335,7 @@ const Screen = forwardRef(
327
335
  style={[styles.screenBanner, {maxHeight: 210 + layoutOffset}]}>
328
336
  {renderHeader()}
329
337
  </View>
330
- {renderContent()}
338
+ {renderContent(children)}
331
339
  </Component>
332
340
  {Footer && (
333
341
  <View
@@ -33,6 +33,7 @@ const Section: React.FC<SectionProps> = ({
33
33
  useMargin = true,
34
34
  backgroundImage,
35
35
  style,
36
+ ...props
36
37
  }) => {
37
38
  const {showGrid} = useContext(ApplicationContext);
38
39
  const {numberOfColumns} = useGridSystem();
@@ -148,6 +149,7 @@ const Section: React.FC<SectionProps> = ({
148
149
  },
149
150
  }}>
150
151
  <View
152
+ {...props}
151
153
  accessibilityLabel={`Section`}
152
154
  style={[
153
155
  style,
@@ -51,12 +51,12 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
51
51
  component_name: id,
52
52
  error_code: error ? error : undefined,
53
53
  };
54
- navigator?.maxApi?.trackEvent('service_component_displayed', {
54
+ navigator?.maxApi?.trackEvent?.('service_component_displayed', {
55
55
  ...tracking,
56
56
  trigger_id: '111012100000000000',
57
57
  });
58
58
  return () => {
59
- navigator?.maxApi?.trackEvent('service_popup_dismissed', {
59
+ navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
60
60
  ...tracking,
61
61
  trigger_id: '111154100000000001',
62
62
  action_type: closeAction.current,
@@ -34,12 +34,12 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
34
34
  component_type: 'popup',
35
35
  component_name: id,
36
36
  };
37
- navigator?.maxApi?.trackEvent('service_component_displayed', {
37
+ navigator?.maxApi?.trackEvent?.('service_component_displayed', {
38
38
  ...tracking,
39
39
  trigger_id: '111012100000000000',
40
40
  });
41
41
  return () => {
42
- navigator?.maxApi?.trackEvent('service_popup_dismissed', {
42
+ navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
43
43
  ...tracking,
44
44
  trigger_id: '111154100000000001',
45
45
  action_type: closeAction.current,
package/Radio/index.tsx CHANGED
@@ -7,6 +7,10 @@ import styles from './styles';
7
7
  import {ApplicationContext} from '../Application';
8
8
  import {Spacing} from '../Consts';
9
9
 
10
+ const {
11
+ ScreenContext,
12
+ } = require('react-native/Libraries/Components/ScreenContext');
13
+
10
14
  const Radio: FC<RadioProps> = ({
11
15
  value,
12
16
  groupValue,
@@ -37,28 +41,38 @@ const Radio: FC<RadioProps> = ({
37
41
  };
38
42
  }
39
43
 
44
+ const screenInfo = useContext<any>(ScreenContext);
45
+
40
46
  return (
41
- <TouchableOpacity
42
- accessibilityLabel={`Radio/${label}/${value}`}
43
- onPress={onChange}
44
- disabled={disabled}
45
- style={[
46
- style,
47
- {
48
- flexDirection: 'row',
49
- alignItems: 'center',
47
+ <ScreenContext.Provider
48
+ value={{
49
+ ...screenInfo,
50
+ componentName: 'Radio',
51
+ params: {
52
+ value,
50
53
  },
51
- ]}>
52
- <View
54
+ }}>
55
+ <TouchableOpacity
56
+ onPress={onChange}
57
+ disabled={disabled}
53
58
  style={[
54
- styles.radio,
55
- checkBoxStyle,
56
- disabledStyle,
57
- {marginRight: label ? Spacing.XS : 0},
58
- ]}
59
- />
60
- {!!label && <Text typography={'description_default'}>{label}</Text>}
61
- </TouchableOpacity>
59
+ style,
60
+ {
61
+ flexDirection: 'row',
62
+ alignItems: 'center',
63
+ },
64
+ ]}>
65
+ <View
66
+ style={[
67
+ styles.radio,
68
+ checkBoxStyle,
69
+ disabledStyle,
70
+ {marginRight: label ? Spacing.XS : 0},
71
+ ]}
72
+ />
73
+ {!!label && <Text typography={'description_default'}>{label}</Text>}
74
+ </TouchableOpacity>
75
+ </ScreenContext.Provider>
62
76
  );
63
77
  };
64
78
 
package/Switch/index.tsx CHANGED
@@ -1,13 +1,18 @@
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
12
  const {value, onChange, disabled, style} = props;
9
13
  const circleBackgroundColor = value ? Colors.black_01 : Colors.black_03;
10
14
  const circleAlign = value ? 'flex-end' : 'flex-start';
15
+ const screenInfo = useContext<any>(ScreenContext);
11
16
 
12
17
  let backgroundColor = value ? Colors.green_03 : Colors.black_07;
13
18
  if (disabled) {
@@ -15,19 +20,27 @@ const Switch: FC<SwitchProps> = props => {
15
20
  }
16
21
 
17
22
  return (
18
- <TouchableOpacity
19
- accessibilityLabel={'Switch'}
20
- disabled={disabled}
21
- onPress={() => onChange?.(!value)}
22
- style={[
23
- style,
24
- styles.container,
25
- {backgroundColor, alignItems: circleAlign},
26
- ]}>
27
- <View style={[styles.circle, {backgroundColor: circleBackgroundColor}]}>
28
- <View style={[styles.circleSmall, {backgroundColor}]} />
29
- </View>
30
- </TouchableOpacity>
23
+ <ScreenContext.Provider
24
+ value={{
25
+ ...screenInfo,
26
+ componentName: 'Switch',
27
+ params: {
28
+ value,
29
+ },
30
+ }}>
31
+ <TouchableOpacity
32
+ disabled={disabled}
33
+ onPress={() => onChange?.(!value)}
34
+ style={[
35
+ style,
36
+ styles.container,
37
+ {backgroundColor, alignItems: circleAlign},
38
+ ]}>
39
+ <View style={[styles.circle, {backgroundColor: circleBackgroundColor}]}>
40
+ <View style={[styles.circleSmall, {backgroundColor}]} />
41
+ </View>
42
+ </TouchableOpacity>
43
+ </ScreenContext.Provider>
31
44
  );
32
45
  };
33
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.81.36",
3
+ "version": "0.81.37-tracking.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {