@eohjsc/react-native-smart-city 0.2.22 → 0.2.23
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 +1 -1
- package/src/commons/Modal/ModalFullVideo.js +2 -1
- package/src/commons/UnitSummary/AirQuality/index.js +2 -119
- package/src/commons/UnitSummary/AirQuality/styles.js +112 -0
- package/src/configs/Constants.js +4 -0
- package/src/screens/Device/detail.js +28 -7
- package/src/screens/PlayBackCamera/index.js +1 -0
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ const ModalFullVideo = ({
|
|
|
13
13
|
data,
|
|
14
14
|
resizeMode = 'cover',
|
|
15
15
|
onClose,
|
|
16
|
+
uri,
|
|
16
17
|
}) => {
|
|
17
18
|
useEffect(() => {
|
|
18
19
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -27,7 +28,7 @@ const ModalFullVideo = ({
|
|
|
27
28
|
>
|
|
28
29
|
<View style={styles.modalContent}>
|
|
29
30
|
<MediaPlayerDetail
|
|
30
|
-
uri={data?.uri}
|
|
31
|
+
uri={uri || data?.uri}
|
|
31
32
|
thumbnail={data?.thumbnail}
|
|
32
33
|
style={styles.camera}
|
|
33
34
|
wrapStyles={styles.wrapStyles}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
@@ -10,6 +10,7 @@ import ConfigHistoryChart from '../ConfigHistoryChart';
|
|
|
10
10
|
|
|
11
11
|
import SegmentedRoundDisplay from './SegmentedRoundDisplay';
|
|
12
12
|
import { TESTID } from '../../../configs/Constants';
|
|
13
|
+
import styles from './styles';
|
|
13
14
|
|
|
14
15
|
const AirQuality = memo(({ summaryDetail }) => {
|
|
15
16
|
const t = useTranslations();
|
|
@@ -124,14 +125,6 @@ const AirQuality = memo(({ summaryDetail }) => {
|
|
|
124
125
|
style={styles.segment}
|
|
125
126
|
textHeader={t('text_air_quality_index')}
|
|
126
127
|
/>
|
|
127
|
-
|
|
128
|
-
<TouchableOpacity
|
|
129
|
-
style={[styles.touchStatus, { backgroundColor: outdoorColor }]}
|
|
130
|
-
>
|
|
131
|
-
<Text size={14} color={Colors.White}>
|
|
132
|
-
{outdoorStatus}
|
|
133
|
-
</Text>
|
|
134
|
-
</TouchableOpacity>
|
|
135
128
|
{!!advices && !!advices.length && (
|
|
136
129
|
<View style={styles.boxHealth}>
|
|
137
130
|
<IconOutline name="alert" size={20} style={styles.iconMargin} />
|
|
@@ -175,113 +168,3 @@ const AirQuality = memo(({ summaryDetail }) => {
|
|
|
175
168
|
});
|
|
176
169
|
|
|
177
170
|
export default AirQuality;
|
|
178
|
-
|
|
179
|
-
const styles = StyleSheet.create({
|
|
180
|
-
textIndoor: {
|
|
181
|
-
color: Colors.Gray9,
|
|
182
|
-
fontSize: 20,
|
|
183
|
-
marginBottom: 4,
|
|
184
|
-
},
|
|
185
|
-
textDesIndoor: {
|
|
186
|
-
color: Colors.Gray8,
|
|
187
|
-
fontSize: 12,
|
|
188
|
-
marginBottom: 16,
|
|
189
|
-
},
|
|
190
|
-
textNotAvailable: {
|
|
191
|
-
textAlign: 'center',
|
|
192
|
-
},
|
|
193
|
-
boxStatus: {
|
|
194
|
-
borderRadius: 10,
|
|
195
|
-
height: 80,
|
|
196
|
-
overflow: 'hidden',
|
|
197
|
-
flexDirection: 'row',
|
|
198
|
-
marginBottom: 16,
|
|
199
|
-
},
|
|
200
|
-
boxEmotion: {
|
|
201
|
-
height: 80,
|
|
202
|
-
width: 80,
|
|
203
|
-
backgroundColor: Colors.Yellow6,
|
|
204
|
-
justifyContent: 'center',
|
|
205
|
-
alignItems: 'center',
|
|
206
|
-
},
|
|
207
|
-
textStatus: {
|
|
208
|
-
fontSize: 16,
|
|
209
|
-
color: Colors.Gray9,
|
|
210
|
-
marginRight: 24,
|
|
211
|
-
textAlign: 'right',
|
|
212
|
-
maxWidth: 120,
|
|
213
|
-
},
|
|
214
|
-
boxTextStatus: {
|
|
215
|
-
backgroundColor: Colors.Yellow4,
|
|
216
|
-
flex: 1,
|
|
217
|
-
alignItems: 'flex-end',
|
|
218
|
-
justifyContent: 'center',
|
|
219
|
-
},
|
|
220
|
-
boxNumber: {
|
|
221
|
-
flexDirection: 'row',
|
|
222
|
-
justifyContent: 'space-between',
|
|
223
|
-
marginBottom: 16,
|
|
224
|
-
},
|
|
225
|
-
boxHealth: {
|
|
226
|
-
flexDirection: 'row',
|
|
227
|
-
marginBottom: 12,
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
marginTop: 10,
|
|
230
|
-
},
|
|
231
|
-
boxContentHealth: {
|
|
232
|
-
flexDirection: 'row',
|
|
233
|
-
alignItems: 'center',
|
|
234
|
-
marginBottom: 8,
|
|
235
|
-
},
|
|
236
|
-
boxDot: {
|
|
237
|
-
width: 8,
|
|
238
|
-
height: 8,
|
|
239
|
-
borderRadius: 4,
|
|
240
|
-
backgroundColor: Colors.Yellow6,
|
|
241
|
-
marginRight: 8,
|
|
242
|
-
},
|
|
243
|
-
textOutdoor: {
|
|
244
|
-
color: Colors.Gray9,
|
|
245
|
-
fontSize: 20,
|
|
246
|
-
marginBottom: 24,
|
|
247
|
-
marginTop: 16,
|
|
248
|
-
},
|
|
249
|
-
touchOption: {
|
|
250
|
-
borderWidth: 1,
|
|
251
|
-
borderColor: Colors.Gray5,
|
|
252
|
-
paddingHorizontal: 16,
|
|
253
|
-
paddingVertical: 5,
|
|
254
|
-
marginHorizontal: 4,
|
|
255
|
-
borderRadius: 2,
|
|
256
|
-
},
|
|
257
|
-
textOption: {
|
|
258
|
-
alignSelf: 'center',
|
|
259
|
-
marginBottom: 8,
|
|
260
|
-
},
|
|
261
|
-
touchStatus: {
|
|
262
|
-
borderRadius: 100,
|
|
263
|
-
paddingHorizontal: 24,
|
|
264
|
-
alignSelf: 'center',
|
|
265
|
-
paddingVertical: 3,
|
|
266
|
-
marginTop: 12,
|
|
267
|
-
},
|
|
268
|
-
segment: {
|
|
269
|
-
marginTop: 36,
|
|
270
|
-
alignSelf: 'center',
|
|
271
|
-
},
|
|
272
|
-
boxOutdoorValues: {
|
|
273
|
-
flexDirection: 'row',
|
|
274
|
-
justifyContent: 'center',
|
|
275
|
-
},
|
|
276
|
-
iconMargin: {
|
|
277
|
-
marginRight: 8,
|
|
278
|
-
},
|
|
279
|
-
historyChart: {
|
|
280
|
-
paddingHorizontal: 16,
|
|
281
|
-
backgroundColor: Colors.White,
|
|
282
|
-
borderRadius: 20,
|
|
283
|
-
borderWidth: 1,
|
|
284
|
-
borderColor: Colors.Gray4,
|
|
285
|
-
marginTop: 16,
|
|
286
|
-
},
|
|
287
|
-
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { Colors } from '../../../configs';
|
|
4
|
+
|
|
5
|
+
export default StyleSheet.create({
|
|
6
|
+
textIndoor: {
|
|
7
|
+
color: Colors.Gray9,
|
|
8
|
+
fontSize: 20,
|
|
9
|
+
marginBottom: 4,
|
|
10
|
+
},
|
|
11
|
+
textDesIndoor: {
|
|
12
|
+
color: Colors.Gray8,
|
|
13
|
+
fontSize: 12,
|
|
14
|
+
marginBottom: 16,
|
|
15
|
+
},
|
|
16
|
+
textNotAvailable: {
|
|
17
|
+
textAlign: 'center',
|
|
18
|
+
},
|
|
19
|
+
boxStatus: {
|
|
20
|
+
borderRadius: 10,
|
|
21
|
+
height: 80,
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
marginBottom: 16,
|
|
25
|
+
},
|
|
26
|
+
boxEmotion: {
|
|
27
|
+
height: 80,
|
|
28
|
+
width: 80,
|
|
29
|
+
backgroundColor: Colors.Yellow6,
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
},
|
|
33
|
+
textStatus: {
|
|
34
|
+
fontSize: 16,
|
|
35
|
+
color: Colors.Gray9,
|
|
36
|
+
marginRight: 24,
|
|
37
|
+
textAlign: 'right',
|
|
38
|
+
maxWidth: 120,
|
|
39
|
+
},
|
|
40
|
+
boxTextStatus: {
|
|
41
|
+
backgroundColor: Colors.Yellow4,
|
|
42
|
+
flex: 1,
|
|
43
|
+
alignItems: 'flex-end',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
},
|
|
46
|
+
boxNumber: {
|
|
47
|
+
flexDirection: 'row',
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
marginBottom: 16,
|
|
50
|
+
},
|
|
51
|
+
boxHealth: {
|
|
52
|
+
flexDirection: 'row',
|
|
53
|
+
marginBottom: 12,
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
marginTop: 36,
|
|
56
|
+
},
|
|
57
|
+
boxContentHealth: {
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
marginBottom: 8,
|
|
61
|
+
},
|
|
62
|
+
boxDot: {
|
|
63
|
+
width: 8,
|
|
64
|
+
height: 8,
|
|
65
|
+
borderRadius: 4,
|
|
66
|
+
backgroundColor: Colors.Yellow6,
|
|
67
|
+
marginRight: 8,
|
|
68
|
+
},
|
|
69
|
+
textOutdoor: {
|
|
70
|
+
color: Colors.Gray9,
|
|
71
|
+
fontSize: 20,
|
|
72
|
+
marginBottom: 24,
|
|
73
|
+
marginTop: 16,
|
|
74
|
+
},
|
|
75
|
+
touchOption: {
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
borderColor: Colors.Gray5,
|
|
78
|
+
paddingHorizontal: 16,
|
|
79
|
+
paddingVertical: 5,
|
|
80
|
+
marginHorizontal: 4,
|
|
81
|
+
borderRadius: 2,
|
|
82
|
+
},
|
|
83
|
+
textOption: {
|
|
84
|
+
paddingTop: 4,
|
|
85
|
+
},
|
|
86
|
+
touchStatus: {
|
|
87
|
+
borderRadius: 100,
|
|
88
|
+
paddingHorizontal: 24,
|
|
89
|
+
alignSelf: 'center',
|
|
90
|
+
paddingVertical: 3,
|
|
91
|
+
marginTop: 12,
|
|
92
|
+
},
|
|
93
|
+
segment: {
|
|
94
|
+
marginTop: 36,
|
|
95
|
+
alignSelf: 'center',
|
|
96
|
+
},
|
|
97
|
+
boxOutdoorValues: {
|
|
98
|
+
flexDirection: 'row',
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
},
|
|
101
|
+
iconMargin: {
|
|
102
|
+
marginRight: 8,
|
|
103
|
+
},
|
|
104
|
+
historyChart: {
|
|
105
|
+
paddingHorizontal: 16,
|
|
106
|
+
backgroundColor: Colors.White,
|
|
107
|
+
borderRadius: 20,
|
|
108
|
+
borderWidth: 1,
|
|
109
|
+
borderColor: Colors.Gray4,
|
|
110
|
+
marginTop: 16,
|
|
111
|
+
},
|
|
112
|
+
});
|
package/src/configs/Constants.js
CHANGED
|
@@ -37,7 +37,7 @@ import Text from '../../commons/Text';
|
|
|
37
37
|
import { transformDatetime } from '../../utils/Converter/time';
|
|
38
38
|
import { AlertAction, ButtonPopup, MenuActionMore } from '../../commons';
|
|
39
39
|
import EmergencyButton from '../../commons/Device/Emergency/EmergencyButton';
|
|
40
|
-
import { TESTID } from '../../configs/Constants';
|
|
40
|
+
import { DEVICE_TYPE, TESTID } from '../../configs/Constants';
|
|
41
41
|
import FooterInfo from '../../commons/Device/FooterInfo';
|
|
42
42
|
import Routes from '../../utils/Route';
|
|
43
43
|
import { sendRemoteCommand } from '../../iot/RemoteControl';
|
|
@@ -381,13 +381,10 @@ const DeviceDetail = ({ account, route }) => {
|
|
|
381
381
|
return <DisconnectedView sensor={sensor} />;
|
|
382
382
|
}
|
|
383
383
|
} else {
|
|
384
|
-
if (
|
|
384
|
+
if (sensor.device_type === DEVICE_TYPE.LG_THINQ) {
|
|
385
385
|
return (
|
|
386
386
|
<>
|
|
387
|
-
<ConnectedViewHeader
|
|
388
|
-
lastUpdated={lastUpdated}
|
|
389
|
-
type={'GoogleHome'}
|
|
390
|
-
/>
|
|
387
|
+
<ConnectedViewHeader lastUpdated={lastUpdated} />
|
|
391
388
|
{display.items.map((item) => (
|
|
392
389
|
<SensorDisplayItem
|
|
393
390
|
testID={TESTID.SENSOR_DISPLAY_ITEM}
|
|
@@ -404,7 +401,31 @@ const DeviceDetail = ({ account, route }) => {
|
|
|
404
401
|
</>
|
|
405
402
|
);
|
|
406
403
|
} else {
|
|
407
|
-
|
|
404
|
+
if (isGGHomeConnected) {
|
|
405
|
+
return (
|
|
406
|
+
<>
|
|
407
|
+
<ConnectedViewHeader
|
|
408
|
+
lastUpdated={lastUpdated}
|
|
409
|
+
type={'GoogleHome'}
|
|
410
|
+
/>
|
|
411
|
+
{display.items.map((item) => (
|
|
412
|
+
<SensorDisplayItem
|
|
413
|
+
testID={TESTID.SENSOR_DISPLAY_ITEM}
|
|
414
|
+
key={item.id.toString()}
|
|
415
|
+
item={item}
|
|
416
|
+
emergency={onEmergencyButtonPress}
|
|
417
|
+
sensor={sensor}
|
|
418
|
+
getData={getData}
|
|
419
|
+
maxValue={maxValue}
|
|
420
|
+
offsetTitle={offsetTitle}
|
|
421
|
+
setOffsetTitle={setOffsetTitle}
|
|
422
|
+
/>
|
|
423
|
+
))}
|
|
424
|
+
</>
|
|
425
|
+
);
|
|
426
|
+
} else {
|
|
427
|
+
return <DisconnectedView sensor={sensor} type={'GoogleHome'} />;
|
|
428
|
+
}
|
|
408
429
|
}
|
|
409
430
|
}
|
|
410
431
|
};
|