@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.
|
|
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.
|
|
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
|
-
|
|
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(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
});
|