@eohjsc/react-native-smart-city 0.4.59 → 0.4.60

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.4.59",
4
+ "version": "0.4.60",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -37,7 +37,6 @@
37
37
  "android-deploy-test": "bundle exec fastlane android beta",
38
38
  "reset-cache": "react-native start --reset-cache",
39
39
  "merge_conflict": "yarn jest && yarn update_coverage_result && yarn check_coverage_config",
40
- "jest": "jest --detectOpenHandles",
41
40
  "jest1": "jest --detectOpenHandles --coverage=0",
42
41
  "example": "yarn --cwd example",
43
42
  "pods": "cd example && pod-install --quiet",
@@ -7,7 +7,6 @@ import { AccessibilityLabel } from '../../../configs/Constants';
7
7
  import { factory } from 'factory-girl';
8
8
  import IconComponent from '../../IconComponent';
9
9
  import { IconOutline } from '@ant-design/icons-react-native';
10
- import Toast from 'react-native-toast-message';
11
10
 
12
11
  class Sensor {}
13
12
 
@@ -68,16 +67,13 @@ describe('Test ItemQuickAction', () => {
68
67
  tree = await create(<ItemQuickAction sensor={newSensor} />);
69
68
  });
70
69
  const instance = tree.root;
71
- const buttonOnActionPress = instance.find(
70
+ const buttonOnActionPress = instance.findAll(
72
71
  (el) =>
73
72
  el.props.accessibilityLabel ===
74
73
  `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
75
74
  el.type === TouchableOpacity
76
75
  );
77
- await act(async () => {
78
- await buttonOnActionPress.props.onPress();
79
- });
80
- expect(Toast.show).not.toBeCalled();
76
+ expect(buttonOnActionPress).toHaveLength(0);
81
77
  });
82
78
 
83
79
  it('click quick action icon down , isSendingCommand = true', async () => {
@@ -9,43 +9,57 @@ import IconComponent from '../../IconComponent';
9
9
  import images from '../../../configs/Images';
10
10
  import FImage from '../../FImage';
11
11
 
12
- const CurrentRainSensor = memo(({ data = [], isWidgetOrder }) => {
13
- const item = data.length
14
- ? data[0]
15
- : {
16
- evaluate: {},
17
- };
18
- const { text, backgroundColor, borderColor, icon, icon_kit_data } =
19
- item.evaluate || {};
12
+ const CurrentRainSensor = memo(
13
+ ({
14
+ data = [],
15
+ isWidgetOrder,
16
+ size = 180,
17
+ textType = 'H2',
18
+ iconSize = 30,
19
+ }) => {
20
+ const item = data.length
21
+ ? data[0]
22
+ : {
23
+ evaluate: {},
24
+ };
25
+ const { text, backgroundColor, borderColor, icon, icon_kit_data } =
26
+ item.evaluate || {};
20
27
 
21
- return (
22
- <View style={[styles.standard, isWidgetOrder && styles.marginBottomZero]}>
23
- <CircleView
24
- size={190}
25
- backgroundColor={backgroundColor}
26
- borderWidth={2}
27
- borderColor={borderColor}
28
- style={styles.center}
29
- >
30
- <LinearGradient
31
- style={styles.linearView}
32
- colors={[Colors.TransparentWhite, 'white']}
33
- start={{ x: 1, y: 0 }}
34
- end={{ x: 1, y: 1 }}
35
- />
36
- {icon_kit_data?.icon || icon ? (
37
- <IconComponent icon={icon_kit_data?.icon || icon} />
38
- ) : (
39
- <FImage
40
- source={images.activeCurrentSensor}
41
- style={styles.iconDefault}
28
+ return (
29
+ <View style={[styles.standard, isWidgetOrder && styles.marginBottomZero]}>
30
+ <CircleView
31
+ size={size}
32
+ backgroundColor={backgroundColor}
33
+ borderWidth={2}
34
+ borderColor={borderColor}
35
+ style={styles.center}
36
+ >
37
+ <LinearGradient
38
+ style={styles.linearView}
39
+ colors={[Colors.TransparentWhite, 'white']}
40
+ start={{ x: 1, y: 0 }}
41
+ end={{ x: 1, y: 1 }}
42
42
  />
43
- )}
44
- <Text style={styles.text}>{text}</Text>
45
- </CircleView>
46
- </View>
47
- );
48
- });
43
+ {icon_kit_data?.icon || icon ? (
44
+ <IconComponent
45
+ size={iconSize}
46
+ iconSize={iconSize}
47
+ icon={icon_kit_data?.icon || icon}
48
+ />
49
+ ) : (
50
+ <FImage
51
+ source={images.activeCurrentSensor}
52
+ style={styles.iconDefault}
53
+ />
54
+ )}
55
+ <Text type={textType} style={styles.text}>
56
+ {text}
57
+ </Text>
58
+ </CircleView>
59
+ </View>
60
+ );
61
+ }
62
+ );
49
63
 
50
64
  export default CurrentRainSensor;
51
65
 
@@ -76,7 +90,6 @@ const styles = StyleSheet.create({
76
90
  text: {
77
91
  marginTop: 8,
78
92
  lineHeight: 32,
79
- fontSize: 24,
80
93
  },
81
94
  iconDefault: {
82
95
  width: 37,
@@ -360,6 +360,9 @@ describe('Test SensorDisplayItem', () => {
360
360
  },
361
361
  ],
362
362
  isWidgetOrder: undefined,
363
+ size: 120,
364
+ iconSize: 25,
365
+ textType: 'H4',
363
366
  });
364
367
  });
365
368
 
@@ -392,6 +395,9 @@ describe('Test SensorDisplayItem', () => {
392
395
  evaluate: null,
393
396
  },
394
397
  ],
398
+ size: 120,
399
+ iconSize: 25,
400
+ textType: 'H4',
395
401
  isWidgetOrder: undefined,
396
402
  });
397
403
  });
@@ -410,6 +416,9 @@ describe('Test SensorDisplayItem', () => {
410
416
 
411
417
  await _testCircleMini(item, {
412
418
  data: undefined,
419
+ size: 120,
420
+ iconSize: 25,
421
+ textType: 'H4',
413
422
  isWidgetOrder: undefined,
414
423
  });
415
424
  });
@@ -194,6 +194,9 @@ export const SensorDisplayItem = ({
194
194
  case 'circle_mini':
195
195
  return (
196
196
  <CurrentRainSensor
197
+ size={120}
198
+ textType="H4"
199
+ iconSize={25}
197
200
  data={getDataCircleMini(item)}
198
201
  isWidgetOrder={isWidgetOrder}
199
202
  />