@momo-kits/foundation 0.103.2-beta.2 → 0.103.2-beta.3

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.
@@ -19,7 +19,7 @@ import {Icon} from '../Icon';
19
19
 
20
20
  const BottomSheet: React.FC<BottomSheetParams> = props => {
21
21
  const {theme, navigator} = useContext(ApplicationContext);
22
- const heightDevice = Dimensions.get('screen').height; // lấy chiều cao thiết bị
22
+ const heightDevice = Dimensions.get('screen').height;
23
23
  const insets = useSafeAreaInsets();
24
24
  const {
25
25
  screen: Screen,
@@ -18,7 +18,6 @@ const Stack = createStackNavigator();
18
18
 
19
19
  const TabScreen: React.FC<NavigationScreenProps> = ({route}) => {
20
20
  let options = {};
21
-
22
21
  if (route.params?.options) {
23
22
  options = getOptions(route.params?.options);
24
23
  }
@@ -378,7 +378,7 @@ const HeaderToolkitAction: React.FC<any> = ({
378
378
  {runtimeTools},
379
379
  (res: {item: {action?: string; key: string}}) => {
380
380
  const {item} = res;
381
- navigator?.toolkitCallback?.(item.key);
381
+ navigator?.toolkitCallback?.(item?.key);
382
382
  getToolkitConfig();
383
383
  }
384
384
  );
@@ -430,7 +430,7 @@ const HeaderToolkitAction: React.FC<any> = ({
430
430
  getToolkitConfig();
431
431
  }
432
432
  );
433
- navigator?.toolkitCallback?.(pinTool.key);
433
+ navigator?.toolkitCallback?.(pinTool?.key);
434
434
  }}
435
435
  />
436
436
  );
@@ -13,12 +13,13 @@ import {getDialogOptions, getModalOptions, getStackOptions} from './utils';
13
13
  import {NavigationContainerProps} from './types';
14
14
  import {ApplicationContext} from './index';
15
15
  import Localize from './Localize';
16
+ import {defaultTheme} from '../Consts';
16
17
 
17
18
  const Stack = createStackNavigator();
18
19
 
19
- const NavigationContainer: React.FC<NavigationContainerProps> = ({ // screen: Screen; options?: NavigationOptions; theme: Theme; maxApi: any; initialParams?: any; localize: Localize;
20
+ const NavigationContainer: React.FC<NavigationContainerProps> = ({
20
21
  screen,
21
- theme,
22
+ theme = defaultTheme,
22
23
  options,
23
24
  maxApi,
24
25
  initialParams,
@@ -73,7 +73,6 @@ class Navigator {
73
73
  * @param params
74
74
  */
75
75
  showBottomSheet = (params: BottomSheetParams) => {
76
- // console.log(this);
77
76
  if (this.isReady.current) {
78
77
  this.ref.current?.dispatch?.(
79
78
  StackActions.push('Modal', {
@@ -14,7 +14,7 @@ import {Colors, Radius, Spacing} from '../Consts';
14
14
  * @constructor
15
15
  */
16
16
  const StackScreen: React.FC<ScreenParams> = props => {
17
- const {showGrid, navigator} = useContext(ApplicationContext); //showGrid: false, navigator: undefined,
17
+ const {showGrid, navigator} = useContext(ApplicationContext);
18
18
  const tracking = useRef<any>({
19
19
  timeoutLoad: undefined,
20
20
  timeoutInteraction: undefined,
@@ -31,7 +31,6 @@ const StackScreen: React.FC<ScreenParams> = props => {
31
31
 
32
32
  const context = useContext<any>(MiniAppContext);
33
33
  const {screen: Component, options, initialParams} = props.route.params;
34
- console.log(props.route.params);
35
34
  const navigation = new Navigation(props.navigation);
36
35
  const heightHeader = useHeaderHeight();
37
36
 
package/Layout/styles.ts CHANGED
@@ -42,7 +42,6 @@ export default StyleSheet.create({
42
42
  padding: 12,
43
43
  },
44
44
  item: {
45
- overflow: 'hidden',
46
45
  margin: undefined,
47
46
  marginTop: undefined,
48
47
  marginBottom: undefined,
@@ -5,7 +5,7 @@ import {ApplicationContext} from '../Application';
5
5
  import {hexToRGBA} from './utils';
6
6
  import {LoaderProps} from './types';
7
7
 
8
- const DotLoader: FC<LoaderProps> = ({color}) => {
8
+ const DotLoader: FC<LoaderProps> = ({color, style}) => {
9
9
  const {theme} = useContext(ApplicationContext);
10
10
 
11
11
  const arrayColor = [
@@ -28,7 +28,7 @@ const DotLoader: FC<LoaderProps> = ({color}) => {
28
28
  return (
29
29
  <AnimatedLottieView
30
30
  source={source}
31
- style={{width: 52, height: 18}}
31
+ style={[{width: 52, height: 18}, style]}
32
32
  autoPlay
33
33
  />
34
34
  );
@@ -5,7 +5,7 @@ import {hexToRGBA} from './utils';
5
5
  import {ApplicationContext} from '../Application';
6
6
  import {LoaderProps} from './types';
7
7
 
8
- const Spinner: FC<LoaderProps> = ({color}) => {
8
+ const Spinner: FC<LoaderProps> = ({color, style}) => {
9
9
  const {theme} = useContext(ApplicationContext);
10
10
 
11
11
  let source: any = animation;
@@ -20,7 +20,7 @@ const Spinner: FC<LoaderProps> = ({color}) => {
20
20
  return (
21
21
  <AnimatedLottieView
22
22
  source={source}
23
- style={{width: 24, height: 24}}
23
+ style={[{width: 24, height: 24}, style]}
24
24
  autoPlay
25
25
  />
26
26
  );
package/Text/index.tsx CHANGED
@@ -109,18 +109,19 @@ const Text: React.FC<TextProps> = ({
109
109
  };
110
110
  };
111
111
 
112
+
112
113
  const textStyle = getTypoStyle(typography);
113
114
 
114
115
  if (deprecatedValues.includes(typography)) {
115
116
  console.warn(
116
- `Warning: The typography value "${typography}" is deprecated.`
117
+ `Warning: The typography value "${typography}" is deprecated.`,
117
118
  );
118
119
  }
119
120
 
120
121
  return (
121
122
  <RNText
122
123
  {...rest}
123
- {...getAccessibilityID(rest.accessibilityLabel)}
124
+ {...getAccessibilityID((rest.accessibilityLabel))}
124
125
  style={[style, textStyle, {color: color ?? theme.colors.text.default}]}>
125
126
  {children ?? ''}
126
127
  </RNText>
package/Text/utils.ts CHANGED
@@ -4,6 +4,7 @@ const deviceWidth = Dimensions.get('window').width;
4
4
  const DEFAULT_SCREEN_SIZE = 375;
5
5
  const scaleSize = (size: number) => {
6
6
  const scaleRate = deviceWidth / DEFAULT_SCREEN_SIZE;
7
+
7
8
  if (scaleRate > 1) {
8
9
  return Math.min(Math.round(size * scaleRate), size + 3);
9
10
  }
@@ -15,6 +16,7 @@ const getAccessibilityID = (accessibilityLabel = '') => {
15
16
  return {
16
17
  accessible: true,
17
18
  testID: accessibilityLabel,
19
+ accessibilityLabel: undefined,
18
20
  };
19
21
  } else {
20
22
  return {
package/index.ts CHANGED
@@ -49,3 +49,10 @@ export * from './Title';
49
49
  export * from './Title/types';
50
50
  export * from './Badge';
51
51
  export * from './Badge/types';
52
+
53
+ /**
54
+ * export trick for keep old mini app working
55
+ * @deprecated
56
+ */
57
+ export * from 'react-native-modalize';
58
+ export * from '@gorhom/bottom-sheet';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.103.2-beta.2",
3
+ "version": "0.103.2-beta.3",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
@@ -8,9 +8,11 @@
8
8
  "@momo-kits/foundation"
9
9
  ],
10
10
  "dependencies": {
11
+ "@gorhom/bottom-sheet": "2.4.1",
11
12
  "react-native-safe-area-context": "3.1.4",
12
13
  "react-native-linear-gradient": "2.8.3",
13
14
  "react-native-gesture-handler": "1.10.3",
15
+ "react-native-modalize": "2.1.1",
14
16
  "react-native-fast-image": "8.1.5",
15
17
  "@react-navigation/bottom-tabs": "https://gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
16
18
  "@react-navigation/core": "5.16.1",