@momo-kits/foundation 0.92.29-optimize.2 → 0.92.29-optimize.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.
@@ -65,7 +65,7 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
65
65
  }, [badgeType, badgeValue]);
66
66
 
67
67
  return (
68
- <View style={{width: scaleSize(28)}}>
68
+ <View style={{width: 28}}>
69
69
  <TouchableOpacity
70
70
  accessibilityLabel={accessibilityLabel}
71
71
  style={[styles.navigationButton, buttonStyle]}
@@ -113,7 +113,7 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
113
113
  useEffect(() => {
114
114
  const backHandler = BackHandler.addEventListener(
115
115
  'hardwareBackPress',
116
- goBackSafe,
116
+ goBackSafe
117
117
  );
118
118
 
119
119
  return () => backHandler.remove();
@@ -268,7 +268,7 @@ const HeaderRightAction: React.FC<any> = ({children, ...restProps}) => {
268
268
  const valid = child?.type === NavigationButton || child?.type === Fragment;
269
269
  if (__DEV__ && !valid) {
270
270
  console.warn(
271
- 'HeaderRightAction contains element type of NavigationButton, Please check again.',
271
+ 'HeaderRightAction contains element type of NavigationButton, Please check again.'
272
272
  );
273
273
  }
274
274
  return child;
@@ -327,7 +327,7 @@ const HeaderToolkitAction: React.FC<any> = ({
327
327
  (config: any) => {
328
328
  navigator.toolkitConfig = config;
329
329
  setToolConfig(navigator?.toolkitConfig);
330
- },
330
+ }
331
331
  );
332
332
  };
333
333
 
@@ -340,7 +340,7 @@ const HeaderToolkitAction: React.FC<any> = ({
340
340
  const {item} = res;
341
341
  navigator?.toolkitCallback?.(item);
342
342
  getToolkitConfig();
343
- },
343
+ }
344
344
  );
345
345
  };
346
346
 
@@ -357,7 +357,7 @@ const HeaderToolkitAction: React.FC<any> = ({
357
357
  navigator?.maxApi?.dispatchFunction?.(
358
358
  'dismiss',
359
359
  undefined,
360
- undefined,
360
+ undefined
361
361
  );
362
362
  },
363
363
  }}
@@ -388,7 +388,7 @@ const HeaderToolkitAction: React.FC<any> = ({
388
388
  [pinTool?.key],
389
389
  () => {
390
390
  getToolkitConfig();
391
- },
391
+ }
392
392
  );
393
393
  navigator?.toolkitCallback?.(pinTool.key);
394
394
  }}
@@ -1,7 +1,6 @@
1
1
  import React, {ReactNode, useContext} from 'react';
2
2
  import {TextInput, TouchableOpacity, View} from 'react-native';
3
3
  import {ApplicationContext, ComponentContext} from '../Application';
4
- import {Styles} from '../Consts';
5
4
  import {Icon} from '../Icon';
6
5
  import {Loader} from '../Loader';
7
6
  import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
@@ -20,7 +19,7 @@ const InputDropDown = ({
20
19
  icon = 'arrow_chevron_down_small',
21
20
  iconColor,
22
21
  onPressIcon,
23
- trailing,
22
+ trailing = 'arrow_chevron_down_small',
24
23
  trailingColor,
25
24
  onPressTrailing,
26
25
  disabled = false,
@@ -103,7 +102,7 @@ const InputDropDown = ({
103
102
  required={required}
104
103
  floatingIcon={floatingIcon}
105
104
  />
106
- <View style={Styles.row}>
105
+ <View style={styles.inputView}>
107
106
  {!!leadingIcon && (
108
107
  <View style={styles.leadingIconContainer}>
109
108
  <Icon
package/Layout/Screen.tsx CHANGED
@@ -121,25 +121,25 @@ const Screen = forwardRef(
121
121
  useGridLayout = true,
122
122
  keyboardVerticalOffset,
123
123
  }: ScreenProps,
124
- ref,
124
+ ref
125
125
  ) => {
126
126
  const animatedValue = useRef<Animated.Value>(new Animated.Value(0));
127
127
  const {theme} = useContext(ApplicationContext);
128
128
  const insets = useSafeAreaInsets();
129
129
  const heightHeader = useHeaderHeight();
130
130
  const currentTint = useRef(Colors.black_01);
131
- const isTab = navigation?.instance?.getState?.()?.type == 'tab';
131
+ const isTab = navigation?.instance?.getState?.()?.type === 'tab';
132
132
 
133
133
  let styleAnimatedHeader: NavigationOptions;
134
134
  let handleScroll;
135
135
  let headerBackground: string | undefined = undefined;
136
136
  let Component: any = View;
137
137
  let keyboardOffset = heightHeader - 20;
138
- if (headerType == 'extended' || animatedHeader) {
138
+ if (headerType === 'extended' || animatedHeader) {
139
139
  keyboardOffset = -20;
140
140
  }
141
141
 
142
- if (headerType == 'extended') {
142
+ if (headerType === 'extended') {
143
143
  headerBackground = theme.assets?.headerBackground;
144
144
  }
145
145
 
@@ -157,7 +157,7 @@ const Screen = forwardRef(
157
157
  <HeaderTitle {...props} animatedValue={animatedValue.current} />
158
158
  ),
159
159
  };
160
- if (animatedHeader.type == 'surface') {
160
+ if (animatedHeader.type === 'surface') {
161
161
  styleAnimatedHeader = {
162
162
  ...styleAnimatedHeader,
163
163
  headerBackground: (props: any) => (
@@ -249,13 +249,13 @@ const Screen = forwardRef(
249
249
  useNativeDriver: true,
250
250
  listener: (e: NativeSyntheticEvent<NativeScrollEvent>) => {
251
251
  scrollViewProps?.onScroll?.(e);
252
- if (animatedHeader?.type == 'surface') {
252
+ if (animatedHeader?.type === 'surface') {
253
253
  const offsetY = e.nativeEvent.contentOffset.y;
254
254
  let color = Colors.black_01;
255
255
  if (offsetY > 50) {
256
256
  color = theme.colors.text.default;
257
257
  }
258
- if (color != currentTint.current) {
258
+ if (color !== currentTint.current) {
259
259
  currentTint.current = color;
260
260
  navigation?.setOptions({
261
261
  headerTintColor: color,
@@ -263,7 +263,7 @@ const Screen = forwardRef(
263
263
  }
264
264
  }
265
265
  },
266
- },
266
+ }
267
267
  );
268
268
  }
269
269
  }
@@ -287,7 +287,7 @@ const Screen = forwardRef(
287
287
  if (Array.isArray(results)) {
288
288
  return results.map((item, index) => {
289
289
  const space = item?.props?.useMargin === false ? 0 : Spacing.M;
290
- if (item?.type == Fragment) {
290
+ if (item?.type === Fragment) {
291
291
  return renderContent(item?.props?.children);
292
292
  }
293
293
  if (item) {
@@ -307,7 +307,7 @@ const Screen = forwardRef(
307
307
  } else {
308
308
  const item: any = children;
309
309
  const space = item?.props?.useMargin === false ? 0 : Spacing.M;
310
- if (item?.type == Fragment) {
310
+ if (item?.type === Fragment) {
311
311
  return renderContent(item?.props?.children);
312
312
  }
313
313
  return (
@@ -387,7 +387,7 @@ const Screen = forwardRef(
387
387
  </KeyboardAvoidingView>
388
388
  </View>
389
389
  );
390
- },
390
+ }
391
391
  );
392
392
 
393
393
  export default Screen;
@@ -5,7 +5,7 @@ import {Button} from '../Button';
5
5
  import {Radius, Spacing, Styles} from '../Consts';
6
6
  import {Icon} from '../Icon';
7
7
  import {Image} from '../Image';
8
- import {Text} from '../Text';
8
+ import {scaleSize, Text} from '../Text';
9
9
  import {PopupNotifyProps} from './types';
10
10
 
11
11
  const PopupNotify: React.FC<PopupNotifyProps> = ({
@@ -27,7 +27,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
27
27
  let Description: any = View;
28
28
  if (scrollContent) {
29
29
  Description = ScrollView;
30
- descriptionStyle = {height: 80};
30
+ descriptionStyle = {maxHeight: scaleSize(172)};
31
31
  }
32
32
  /**
33
33
  * tracking
package/Title/styles.ts CHANGED
@@ -46,16 +46,16 @@ export default StyleSheet.create({
46
46
  marginRight: Spacing.S,
47
47
  },
48
48
  iconRight: {
49
- width: scaleSize(22),
50
- height: scaleSize(22),
49
+ width: 22,
50
+ height: 22,
51
51
  borderRadius: Radius.M,
52
52
  alignItems: 'center',
53
53
  justifyContent: 'center',
54
54
  marginLeft: Spacing.S,
55
55
  },
56
56
  iconLeft: {
57
- width: scaleSize(18),
58
- height: scaleSize(18),
57
+ width: 18,
58
+ height: 18,
59
59
  borderRadius: Radius.M,
60
60
  alignItems: 'center',
61
61
  justifyContent: 'center',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.92.29-optimize.2",
3
+ "version": "0.92.29-optimize.3",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
package/publish.sh CHANGED
@@ -7,16 +7,16 @@ rsync -r --exclude=/dist ./* dist
7
7
  cd dist
8
8
 
9
9
  if [ "$1" == "stable" ]; then
10
- #npm version $(npm view @momo-kits/foundation@stable version)
11
- #npm version patch
10
+ #npm version $(npm view @momo-kits/foundation@stable version)
11
+ #npm version patch
12
12
  npm publish --tag stable --access=public
13
13
  elif [ "$1" == "latest" ]; then
14
- #npm version $(npm view @momo-kits/foundation@latest version)
15
- #npm version prerelease --preid=rc
14
+ #npm version $(npm view @momo-kits/foundation@latest version)
15
+ #npm version prerelease --preid=rc
16
16
  npm publish --tag latest --access=public
17
17
  else
18
- #npm version $(npm view @momo-kits/foundation@beta version)
19
- #npm version prerelease --preid=beta
18
+ #npm version $(npm view @momo-kits/foundation@beta version)
19
+ #npm version prerelease --preid=beta
20
20
  npm publish --tag beta --access=public
21
21
  fi
22
22