@momo-kits/foundation 0.162.2-beta.15 → 0.162.2-beta.17

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/Button/index.tsx CHANGED
@@ -49,6 +49,12 @@ export interface ButtonProps extends TouchableOpacityProps {
49
49
  iconRight?: string;
50
50
  iconLeft?: string;
51
51
  title: string;
52
+ /**
53
+ * When true, hides the label and renders only the centered icon.
54
+ * `title` stays required and is used as the accessibility label.
55
+ * Icon-only buttons hug their icon, so the `full` prop is ignored.
56
+ */
57
+ iconOnly?: boolean;
52
58
  tintColor?: string;
53
59
  loading?: boolean;
54
60
  onPress: () => void;
@@ -62,6 +68,7 @@ const Button: FC<ButtonProps> = ({
62
68
  full = true,
63
69
  iconRight,
64
70
  iconLeft,
71
+ iconOnly = false,
65
72
  loading = false,
66
73
  title = 'Button',
67
74
  params,
@@ -263,8 +270,8 @@ const Button: FC<ButtonProps> = ({
263
270
  {
264
271
  width: iconSize,
265
272
  height: iconSize,
266
- marginRight: isLeft ? space : 0,
267
- marginLeft: isLeft ? 0 : space,
273
+ marginRight: !iconOnly && isLeft ? space : 0,
274
+ marginLeft: !iconOnly && !isLeft ? space : 0,
268
275
  },
269
276
  ];
270
277
 
@@ -312,10 +319,14 @@ const Button: FC<ButtonProps> = ({
312
319
  const sizeStyle = getSizeStyle();
313
320
  const typeStyle = getTypeStyle();
314
321
  const containerStyle: ViewStyle = StyleSheet.flatten([
315
- full && { width: '100%' },
322
+ full && !iconOnly && { width: '100%' },
316
323
  loading && { opacity: 0.75 },
317
324
  ]);
318
- const buttonStyle = StyleSheet.flatten([sizeStyle, typeStyle]);
325
+ const buttonStyle = StyleSheet.flatten([
326
+ sizeStyle,
327
+ typeStyle,
328
+ iconOnly && styles.iconOnly,
329
+ ]);
319
330
 
320
331
  const animatedStyle = useAnimatedStyle(() => {
321
332
  return {
@@ -352,8 +363,8 @@ const Button: FC<ButtonProps> = ({
352
363
  onPressOut={animateOut}
353
364
  >
354
365
  <Reanimated.View style={[buttonStyle, animatedStyle]}>
355
- {renderIcon('left')}
356
- {renderTitle()}
366
+ {renderIcon('left')}
367
+ {!iconOnly && renderTitle()}
357
368
  {renderIcon('right')}
358
369
  {gradientPros && (
359
370
  <LinearGradient {...gradientPros} style={styles.gradientView} />
package/Button/styles.ts CHANGED
@@ -29,6 +29,9 @@ export default StyleSheet.create({
29
29
  paddingHorizontal: 8,
30
30
  minWidth: 60,
31
31
  },
32
+ iconOnly: {
33
+ minWidth: 0,
34
+ },
32
35
  leading: {
33
36
  overflow: 'hidden',
34
37
  alignItems: 'center',
package/Layout/Screen.tsx CHANGED
@@ -650,7 +650,14 @@ const Screen = forwardRef(
650
650
  onScroll={handleScroll}
651
651
  onScrollEndDrag={handleScrollEnd}
652
652
  scrollEventThrottle={16}
653
- style={Styles.flex}
653
+ style={[
654
+ Styles.flex,
655
+ !scrollable && !Footer && !isTab && { paddingBottom: bottomInset },
656
+ ]}
657
+ contentContainerStyle={[
658
+ scrollable && !Footer && !isTab && { paddingBottom: bottomInset },
659
+ scrollViewProps?.contentContainerStyle,
660
+ ]}
654
661
  >
655
662
  {renderAnimatedHeader()}
656
663
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.162.2-beta.15",
3
+ "version": "0.162.2-beta.17",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
@@ -8,19 +8,19 @@
8
8
  "@momo-kits/foundation"
9
9
  ],
10
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",
12
11
  "@react-navigation/bottom-tabs": "7.4.2",
13
12
  "@react-navigation/core": "7.12.1",
14
13
  "@react-navigation/elements": "2.5.2",
15
14
  "@react-navigation/native": "7.1.14",
16
15
  "@react-navigation/routers": "7.4.1",
17
16
  "@react-navigation/stack": "7.4.2",
17
+ "@shopify/flash-list": "2.1.0",
18
+ "lottie-react-native": "7.2.4",
19
+ "react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
18
20
  "react-native-gesture-handler": "2.27.1",
19
21
  "react-native-linear-gradient": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-linear-gradient#v3.0.0",
20
22
  "react-native-reanimated": "4.2.2",
21
- "react-native-safe-area-context": "5.5.2",
22
- "@shopify/flash-list": "2.1.0",
23
- "lottie-react-native": "7.2.4"
23
+ "react-native-safe-area-context": "5.5.2"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react-native": "*"
@@ -32,4 +32,4 @@
32
32
  "registry": "https://registry.npmjs.org/"
33
33
  },
34
34
  "license": "MoMo"
35
- }
35
+ }