@momo-kits/foundation 0.77.1-optimize.3 → 0.77.1-optimzie.4

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.
@@ -46,8 +46,6 @@ type Options = {
46
46
  };
47
47
 
48
48
  const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
49
- const DEFAULT_TABBAR_HEIGHT = 49;
50
- const COMPACT_TABBAR_HEIGHT = 32;
51
49
 
52
50
  const shouldUseHorizontalLabels = ({
53
51
  state,
@@ -87,38 +85,6 @@ const shouldUseHorizontalLabels = ({
87
85
  const getPaddingBottom = (insets: EdgeInsets) =>
88
86
  Math.max(insets.bottom - Platform.select({ios: 4, default: 0}), 0);
89
87
 
90
- export const getTabBarHeight = ({
91
- dimensions,
92
- insets,
93
- style,
94
- ...rest
95
- }: Options & {
96
- insets: EdgeInsets;
97
- style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
98
- }) => {
99
- // @ts-ignore
100
- const customHeight = StyleSheet.flatten(style)?.height;
101
-
102
- if (typeof customHeight === 'number') {
103
- return customHeight;
104
- }
105
-
106
- const isLandscape = dimensions.width > dimensions.height;
107
- const horizontalLabels = shouldUseHorizontalLabels({dimensions, ...rest});
108
- const paddingBottom = getPaddingBottom(insets);
109
-
110
- if (
111
- Platform.OS === 'ios' &&
112
- !Platform.isPad &&
113
- isLandscape &&
114
- horizontalLabels
115
- ) {
116
- return COMPACT_TABBAR_HEIGHT + paddingBottom;
117
- }
118
-
119
- return DEFAULT_TABBAR_HEIGHT + paddingBottom;
120
- };
121
-
122
88
  export default function BottomTabBar({
123
89
  state,
124
90
  navigation,
@@ -409,7 +375,7 @@ export default function BottomTabBar({
409
375
  position: isTabBarHidden ? 'absolute' : (null as any),
410
376
  },
411
377
  {
412
- paddingBottom: paddingBottom - 0,
378
+ paddingBottom: paddingBottom,
413
379
  paddingHorizontal: Math.max(insets.left, insets.right),
414
380
  },
415
381
  style,
@@ -464,7 +430,6 @@ const styles = StyleSheet.create({
464
430
  justifyContent: 'center',
465
431
  height: 48,
466
432
  width: 48,
467
-
468
433
  borderRadius: 100,
469
434
  top: -12,
470
435
  },
@@ -75,7 +75,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
75
75
  )}
76
76
  tabBarOptions={{
77
77
  style: {
78
- height: 68 + Math.min(insets.bottom, 21),
78
+ height: 64 + Math.min(insets.bottom, 21),
79
79
  },
80
80
  tabStyle: {
81
81
  height: 68,
package/Input/Input.tsx CHANGED
@@ -169,7 +169,7 @@ const Input = forwardRef(
169
169
  <TextInput
170
170
  {...props}
171
171
  accessibilityLabel={accessibilityLabel}
172
- editable={editable || !disabled}
172
+ editable={editable && !disabled}
173
173
  secureTextEntry={secure}
174
174
  textAlignVertical="center"
175
175
  ref={inputRef}
@@ -45,22 +45,24 @@ export const FloatingButton: React.FC<FloatingButtonProps> = ({
45
45
  if (!label) return;
46
46
 
47
47
  const listener = animatedValue?.addListener(({value}) => {
48
- const direction = value > lastOffset.current ? 'down' : 'up';
49
- lastOffset.current = value;
50
- if (lastDirection.current !== direction) {
51
- lastDirection.current = direction;
52
- if (direction === 'down') {
53
- Animated.timing(widthAnimated!, {
54
- toValue: minWidth,
55
- duration: 200,
56
- useNativeDriver: false,
57
- }).start(() => setShowText(false));
58
- } else {
59
- Animated.timing(widthAnimated!, {
60
- toValue: maxWidth.current,
61
- duration: 200,
62
- useNativeDriver: false,
63
- }).start(() => setShowText(true));
48
+ if (value !== lastOffset.current) {
49
+ const direction = value > lastOffset.current ? 'down' : 'up';
50
+ lastOffset.current = value;
51
+ if (lastDirection.current !== direction) {
52
+ lastDirection.current = direction;
53
+ if (direction === 'down') {
54
+ Animated.timing(widthAnimated!, {
55
+ toValue: minWidth,
56
+ duration: 200,
57
+ useNativeDriver: false,
58
+ }).start(() => setShowText(false));
59
+ } else {
60
+ Animated.timing(widthAnimated!, {
61
+ toValue: maxWidth.current,
62
+ duration: 200,
63
+ useNativeDriver: false,
64
+ }).start(() => setShowText(true));
65
+ }
64
66
  }
65
67
  }
66
68
  });
package/Layout/Screen.tsx CHANGED
@@ -236,6 +236,7 @@ const Screen = forwardRef(
236
236
  {
237
237
  useNativeDriver: true,
238
238
  listener: (e: NativeSyntheticEvent<NativeScrollEvent>) => {
239
+ scrollViewProps?.onScroll?.(e);
239
240
  if (animatedHeader?.type == 'surface') {
240
241
  const offsetY = e.nativeEvent.contentOffset.y;
241
242
  let color = Colors.black_01;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.77.1-optimize.3",
3
+ "version": "0.77.1-optimzie.4",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},