@momo-kits/foundation 0.161.2-rn.84.1 → 0.162.2-test.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.
@@ -37,7 +37,8 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
37
37
  const action = useRef<undefined | string>(undefined);
38
38
  const insets = useSafeAreaInsets();
39
39
  const heightHeader = useHeaderHeight();
40
- const keyboardOffset = heightHeader - Math.min(insets.bottom, 21);
40
+ const bottomInset = Platform.OS === 'ios' ? Math.min(insets.bottom, 21) : insets.bottom;
41
+ const keyboardOffset = heightHeader - bottomInset;
41
42
 
42
43
  const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
43
44
 
@@ -311,7 +312,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
311
312
  {useBottomInset && (
312
313
  <View
313
314
  style={{
314
- height: Math.min(insets.bottom, 21),
315
+ height: bottomInset,
315
316
  backgroundColor: backgroundColor,
316
317
  }}
317
318
  />
@@ -320,7 +320,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
320
320
  activeTintColor={theme.colors.primary}
321
321
  style={[
322
322
  {
323
- height: 64 + Math.min(insets.bottom, 21),
323
+ height: 64 + (Platform.OS === 'ios' ? Math.min(insets.bottom, 21) : insets.bottom),
324
324
  },
325
325
  ]}
326
326
  />
@@ -86,7 +86,7 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
86
86
 
87
87
  const styles = StyleSheet.create({
88
88
  headerLeft: {
89
- marginLeft: 8,
89
+ marginLeft: 12,
90
90
  },
91
91
  });
92
92
 
package/Divider/index.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { StyleProp, View, ViewStyle } from 'react-native';
2
+ import { View, ViewStyle } from 'react-native';
3
3
  import { ApplicationContext } from '../Context';
4
4
  import { Spacing } from '../Consts';
5
5
  import { DashDivider } from './DashDivider';
@@ -8,7 +8,7 @@ export interface DividerProps {
8
8
  /**
9
9
  * Custom styles for divider
10
10
  */
11
- style?: StyleProp<ViewStyle>;
11
+ style?: ViewStyle;
12
12
 
13
13
  /**
14
14
  * Enable margin vertical 4px
@@ -30,13 +30,13 @@ const Divider: React.FC<DividerProps> = ({
30
30
  return (
31
31
  <View
32
32
  style={[
33
+ style,
33
34
  {
34
35
  height: 1,
35
36
  width: '100%',
36
37
  backgroundColor: theme.colors.border.default,
37
38
  marginVertical: useMargin ? Spacing.XS : 0,
38
39
  },
39
- style,
40
40
  ]}
41
41
  />
42
42
  );
package/Image/index.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useContext, useRef, useState } from 'react';
2
- import { Image as RNImage, StyleSheet, View } from 'react-native';
2
+ import { StyleSheet, View } from 'react-native';
3
3
  import FastImage from 'react-native-fast-image';
4
4
  import styles from './styles';
5
5
  import {
@@ -23,10 +23,6 @@ export const getImageName = (source: any): string => {
23
23
  return '';
24
24
  };
25
25
 
26
- const isDataUriSource = (source: any): boolean => {
27
- return typeof source?.uri === 'string' && source.uri.startsWith('data:');
28
- };
29
-
30
26
  const Image: React.FC<ImageProps> = ({
31
27
  style,
32
28
  source,
@@ -47,7 +43,6 @@ const Image: React.FC<ImageProps> = ({
47
43
  const [status, setStatus] = useState<Status>('success');
48
44
 
49
45
  const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
50
- const useFastImage = !isDataUriSource(source);
51
46
 
52
47
  let accessibilityLabel: any = `img|${getImageName(source)}`;
53
48
  if (component?.componentId) {
@@ -84,46 +79,6 @@ const Image: React.FC<ImageProps> = ({
84
79
  return children;
85
80
  };
86
81
 
87
- if (!useFastImage) {
88
- return (
89
- <RNImage
90
- {...rest}
91
- {...{
92
- accessibilityLabel: rest.accessibilityLabel ?? accessibilityLabel,
93
- }}
94
- source={source}
95
- style={[
96
- styles.container,
97
- style,
98
- showBaseLineDebug && styles.debugBaseLine,
99
- ]}
100
- onLoadStart={() => {
101
- error.current = false;
102
- if (status !== 'loading' && loading) {
103
- setStatus('loading');
104
- }
105
- }}
106
- onLoad={() => {
107
- error.current = false;
108
- }}
109
- onLoadEnd={() => {
110
- let current: Status = 'success';
111
- if (error.current) {
112
- current = 'error';
113
- }
114
- setStatus(prevState =>
115
- prevState !== current ? current : prevState,
116
- );
117
- }}
118
- onError={() => {
119
- error.current = true;
120
- }}
121
- >
122
- {renderContent()}
123
- </RNImage>
124
- );
125
- }
126
-
127
82
  return (
128
83
  <FastImage
129
84
  {...rest}
package/Layout/Screen.tsx CHANGED
@@ -204,9 +204,10 @@ const Screen = forwardRef(
204
204
  let handleScroll;
205
205
  let Component: any = View;
206
206
 
207
- let keyboardOffset = heightHeader - Math.min(insets.bottom, 21);
207
+ const bottomInset = Platform.OS === 'ios' ? Math.min(insets.bottom, 21) : insets.bottom;
208
+ let keyboardOffset = heightHeader - bottomInset;
208
209
  if (headerType === 'extended' || animatedHeader || inputSearchProps) {
209
- keyboardOffset = -Math.min(insets.bottom, 21);
210
+ keyboardOffset = -bottomInset;
210
211
  }
211
212
 
212
213
  /**
@@ -616,7 +617,7 @@ const Screen = forwardRef(
616
617
  {...floatingButtonProps}
617
618
  animatedValue={animatedValue.current}
618
619
  bottom={
619
- Footer || isTab ? 12 : Math.min(insets.bottom, 21) + Spacing.S
620
+ Footer || isTab ? 12 : bottomInset + Spacing.S
620
621
  }
621
622
  />
622
623
  </View>
@@ -627,7 +628,7 @@ const Screen = forwardRef(
627
628
  style={[
628
629
  styles.shadow,
629
630
  {
630
- paddingBottom: Math.min(insets.bottom, 21) + Spacing.S,
631
+ paddingBottom: bottomInset + Spacing.S,
631
632
  backgroundColor: theme.colors.background.surface,
632
633
  },
633
634
  ]}
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.161.2-rn.84.1",
3
+ "version": "0.162.2-test.1",
4
4
  "description": "React Native Component Kits",
5
+ "main": "index.ts",
6
+ "scripts": {},
5
7
  "keywords": [
6
8
  "@momo-kits/foundation"
7
9
  ],
8
- "license": "MoMo",
9
- "main": "index.ts",
10
- "publishConfig": {
11
- "registry": "https://registry.npmjs.org/"
12
- },
13
- "scripts": {},
14
10
  "dependencies": {
11
+ "react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
15
12
  "@react-navigation/bottom-tabs": "7.4.2",
16
13
  "@react-navigation/core": "7.12.1",
17
14
  "@react-navigation/elements": "2.5.2",
18
15
  "@react-navigation/native": "7.1.14",
19
16
  "@react-navigation/routers": "7.4.1",
20
17
  "@react-navigation/stack": "7.4.2",
21
- "@shopify/flash-list": "2.1.0",
22
- "lottie-react-native": "7.3.4",
23
- "react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
24
- "react-native-gesture-handler": "2.31.0",
18
+ "react-native-gesture-handler": "2.27.1",
25
19
  "react-native-linear-gradient": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-linear-gradient#v3.0.0",
26
20
  "react-native-reanimated": "4.2.2",
27
- "react-native-safe-area-context": "5.7.0"
21
+ "react-native-safe-area-context": "5.5.2",
22
+ "@shopify/flash-list": "2.1.0",
23
+ "lottie-react-native": "7.2.4"
24
+ },
25
+ "peerDependencies": {
26
+ "react-native": "*"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@types/color": "3.0.6"
31
30
  },
32
- "peerDependencies": {
33
- "react-native": "*"
34
- }
31
+ "publishConfig": {
32
+ "registry": "https://registry.npmjs.org/"
33
+ },
34
+ "license": "MoMo"
35
35
  }