@eohjsc/react-native-smart-city 0.6.0-rc3 → 0.6.0-rc5
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 +2 -2
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +2 -2
- package/src/commons/Device/DisconnectedView.js +2 -2
- package/src/commons/EmergencyButton/AlertSendConfirm.js +1 -1
- package/src/commons/EmergencyButton/AlertSent.js +6 -2
- package/src/commons/SearchLocation/index.js +1 -1
- package/src/commons/SubUnit/Item/index.js +3 -3
- package/src/navigations/AutomateStack.js +2 -2
- package/src/navigations/SharedStack.js +6 -4
- package/src/screens/AddLocationMaps/index.js +8 -3
- package/src/screens/Automate/ScriptDetail/index.js +1 -1
- package/src/screens/Device/detail.js +2 -2
- package/src/screens/SharedUnit/TabHeader.js +1 -1
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +5 -4
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +1 -1
- package/src/screens/Unit/SelectAddress.js +8 -3
- package/src/screens/Unit/components/Header/index.js +3 -2
- package/src/screens/UnitSummary/components/AirQuality/index.js +6 -1
- package/src/screens/UnitSummary/components/UvIndex/index.js +6 -2
- package/src/utils/Monitor.js +5 -6
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.6.0-
|
|
4
|
+
"version": "0.6.0-rc5",
|
|
5
5
|
"description": "TODO",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"pluralize": "^8.0.0",
|
|
126
126
|
"postinstall": "^0.7.0",
|
|
127
127
|
"precompiled-mqtt": "^4.3.14-beta",
|
|
128
|
-
"pusher-js": "^
|
|
128
|
+
"pusher-js": "^8.4.0-rc2",
|
|
129
129
|
"pusher-js-auth": "^4.0.1",
|
|
130
130
|
"python-struct": "^1.1.3",
|
|
131
131
|
"querystring": "^0.2.0",
|
|
@@ -21,7 +21,7 @@ const ControlPlay = memo(
|
|
|
21
21
|
>
|
|
22
22
|
<AntDesign
|
|
23
23
|
size={32}
|
|
24
|
-
name={'
|
|
24
|
+
name={'stepbackward'}
|
|
25
25
|
color={Colors.Gray9}
|
|
26
26
|
style={[styles.button]}
|
|
27
27
|
/>
|
|
@@ -44,7 +44,7 @@ const ControlPlay = memo(
|
|
|
44
44
|
>
|
|
45
45
|
<AntDesign
|
|
46
46
|
size={32}
|
|
47
|
-
name={'
|
|
47
|
+
name={'stepforward'}
|
|
48
48
|
color={Colors.Gray9}
|
|
49
49
|
style={[styles.button]}
|
|
50
50
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
4
4
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../configs';
|
|
@@ -57,7 +57,7 @@ const DisconnectedView = memo(({ sensor, type, isDeviceHasBle }) => {
|
|
|
57
57
|
</View>
|
|
58
58
|
<View style={styles.disconnectSuggestionContainer} testID={'suggestions'}>
|
|
59
59
|
<View style={styles.row}>
|
|
60
|
-
<
|
|
60
|
+
<MaterialCommunityIcons name={'alert-circle-outline'} size={16} />
|
|
61
61
|
<Text bold style={styles.boldText}>
|
|
62
62
|
{t('suggestions')}:
|
|
63
63
|
</Text>
|
|
@@ -29,7 +29,7 @@ const AlertSendConfirm = ({
|
|
|
29
29
|
bodyStyle={styles.buttonPopupBody}
|
|
30
30
|
>
|
|
31
31
|
<View style={styles.firstInfo}>
|
|
32
|
-
<AntDesign name="
|
|
32
|
+
<AntDesign name="clockcircleo" size={42} style={styles.clock} />
|
|
33
33
|
<Text semibold type="H4" style={styles.textAlertWillBe}>
|
|
34
34
|
{t('alert_will_be_sent_in')}
|
|
35
35
|
</Text>
|
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import { ButtonPopup } from '../index';
|
|
4
4
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
|
-
import
|
|
5
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
6
6
|
import Text from '../Text';
|
|
7
7
|
import { Colors } from '../../configs';
|
|
8
8
|
|
|
@@ -59,7 +59,11 @@ const AlertSent = ({
|
|
|
59
59
|
type="H5"
|
|
60
60
|
style={styles.location}
|
|
61
61
|
>{`${unit?.name} - ${station?.name}`}</Text>
|
|
62
|
-
<
|
|
62
|
+
<MaterialCommunityIcons
|
|
63
|
+
name="alert-circle-outline"
|
|
64
|
+
size={42}
|
|
65
|
+
style={styles.alert}
|
|
66
|
+
/>
|
|
63
67
|
<Text semibold style={styles.textAlertSent}>
|
|
64
68
|
{data.title}
|
|
65
69
|
</Text>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet, Image } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
4
4
|
|
|
5
5
|
import { Colors, Images } from '../../../configs';
|
|
6
6
|
import Text from '../../Text';
|
|
@@ -27,8 +27,8 @@ const SubUnitCard = ({ onPressItem, devices, name, id }) => {
|
|
|
27
27
|
</Text>
|
|
28
28
|
<Text style={[styles.subText]}>{devices + ' devices'}</Text>
|
|
29
29
|
</View>
|
|
30
|
-
<
|
|
31
|
-
name="more"
|
|
30
|
+
<MaterialIcons
|
|
31
|
+
name="more-vert"
|
|
32
32
|
color={Colors.White}
|
|
33
33
|
size={24}
|
|
34
34
|
onPress={() => {}}
|
|
@@ -2,7 +2,7 @@ import React, { memo, useCallback, useEffect, useContext } from 'react';
|
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
4
4
|
import { useNavigation } from '@react-navigation/core';
|
|
5
|
-
import
|
|
5
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
6
|
import { SCContext } from '../context';
|
|
7
7
|
import { Action } from '../context/actionType';
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ const AutomateStack = memo(() => {
|
|
|
44
44
|
title: t('smart'),
|
|
45
45
|
headerLeft: () => (
|
|
46
46
|
<TouchableOpacity style={Theme.menuIcon} onPress={toggleDrawer}>
|
|
47
|
-
<
|
|
47
|
+
<MaterialIcons name={'menu'} color={Colors.Black} size={27} />
|
|
48
48
|
</TouchableOpacity>
|
|
49
49
|
),
|
|
50
50
|
headerTitleAlign: 'left',
|
|
@@ -2,7 +2,7 @@ import React, { memo } from 'react';
|
|
|
2
2
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
3
3
|
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
4
4
|
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
5
|
-
import
|
|
5
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
6
|
import { useTranslations } from '../hooks/Common/useTranslations';
|
|
7
7
|
|
|
8
8
|
import Shared from '../screens/SharedUnit';
|
|
@@ -15,6 +15,7 @@ const SharedStack = memo(() => {
|
|
|
15
15
|
const t = useTranslations();
|
|
16
16
|
const { toggleDrawer, goBack } = useNavigation();
|
|
17
17
|
const { params } = useRoute();
|
|
18
|
+
const { isMainSource } = params || {};
|
|
18
19
|
return (
|
|
19
20
|
<Stack.Navigator>
|
|
20
21
|
<Stack.Screen
|
|
@@ -26,11 +27,12 @@ const SharedStack = memo(() => {
|
|
|
26
27
|
headerLeft: () => (
|
|
27
28
|
<TouchableOpacity
|
|
28
29
|
style={styles.btnMenu}
|
|
29
|
-
onPress={() => (
|
|
30
|
+
onPress={() => (isMainSource ? toggleDrawer() : goBack())}
|
|
30
31
|
>
|
|
31
|
-
<
|
|
32
|
-
name={
|
|
32
|
+
<MaterialIcons
|
|
33
|
+
name={isMainSource ? 'menu' : 'chevron-left'}
|
|
33
34
|
color={Colors.Black}
|
|
35
|
+
size={27}
|
|
34
36
|
/>
|
|
35
37
|
</TouchableOpacity>
|
|
36
38
|
),
|
|
@@ -3,6 +3,7 @@ import { View, ScrollView, TouchableOpacity } from 'react-native';
|
|
|
3
3
|
import MapView, { Marker, Circle, PROVIDER_GOOGLE } from 'react-native-maps';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
7
|
import { check, RESULTS } from 'react-native-permissions';
|
|
7
8
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
8
9
|
|
|
@@ -204,7 +205,11 @@ const AddLocationMaps = memo(() => {
|
|
|
204
205
|
style={styles.button}
|
|
205
206
|
accessibilityLabel={AccessibilityLabel.BUTTON_YOUR_LOCATION}
|
|
206
207
|
>
|
|
207
|
-
<
|
|
208
|
+
<MaterialIcons
|
|
209
|
+
name="my-location"
|
|
210
|
+
size={27}
|
|
211
|
+
color={Colors.Primary}
|
|
212
|
+
/>
|
|
208
213
|
<Text
|
|
209
214
|
type="Body"
|
|
210
215
|
color={Colors.Gray9}
|
|
@@ -221,7 +226,7 @@ const AddLocationMaps = memo(() => {
|
|
|
221
226
|
accessibilityLabel={AccessibilityLabel.BUTTON_CHOOSE_ON_MAP}
|
|
222
227
|
>
|
|
223
228
|
<AntDesign
|
|
224
|
-
name="
|
|
229
|
+
name="enviroment"
|
|
225
230
|
size={27}
|
|
226
231
|
color={Colors.Primary}
|
|
227
232
|
/>
|
|
@@ -270,7 +275,7 @@ const AddLocationMaps = memo(() => {
|
|
|
270
275
|
tracksViewChanges={false}
|
|
271
276
|
>
|
|
272
277
|
<AntDesign
|
|
273
|
-
name="
|
|
278
|
+
name="enviroment"
|
|
274
279
|
size={27}
|
|
275
280
|
color={Colors.Blue10}
|
|
276
281
|
/>
|
|
@@ -755,7 +755,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
755
755
|
>
|
|
756
756
|
{display.items.map((item, index) => {
|
|
757
757
|
return (
|
|
758
|
-
|
|
758
|
+
<View key={item?.id?.toString()}>
|
|
759
759
|
{!item.is_configuration_ready && (
|
|
760
760
|
<Text center>{t('bellow_widget_is_not_configured')}</Text>
|
|
761
761
|
)}
|
|
@@ -779,7 +779,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
779
779
|
setShowWindDirection={setShowWindDirection}
|
|
780
780
|
background={station?.background}
|
|
781
781
|
/>
|
|
782
|
-
|
|
782
|
+
</View>
|
|
783
783
|
);
|
|
784
784
|
})}
|
|
785
785
|
</SensorConnectStatusViewHeader>
|
|
@@ -54,7 +54,7 @@ const TabHeader = ({ current, getCurrentTab, showModal, textFilter }) => {
|
|
|
54
54
|
<Text style={styles.sortBy}>
|
|
55
55
|
{t('sort_by') + ': '} {textFilter}
|
|
56
56
|
</Text>
|
|
57
|
-
<AntDesign name="
|
|
57
|
+
<AntDesign name="arrowdown" size={10} />
|
|
58
58
|
</TouchableOpacity>
|
|
59
59
|
</View>
|
|
60
60
|
</View>
|
|
@@ -10,6 +10,7 @@ import TextInput from '../../../commons/Form/TextInput';
|
|
|
10
10
|
import { ModalCustom } from '../../../commons/Modal';
|
|
11
11
|
import { TouchableOpacity } from 'react-native';
|
|
12
12
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
13
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
13
14
|
|
|
14
15
|
const wrapComponent = (route) => (
|
|
15
16
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -137,7 +138,7 @@ describe('Test GroupButtonByType', () => {
|
|
|
137
138
|
await act(async () => {
|
|
138
139
|
await touch.props.onPress();
|
|
139
140
|
});
|
|
140
|
-
expect(icon.props.name).toEqual('
|
|
141
|
+
expect(icon.props.name).toEqual('reload1');
|
|
141
142
|
|
|
142
143
|
const touch2 = instance.find(
|
|
143
144
|
(el) =>
|
|
@@ -145,14 +146,14 @@ describe('Test GroupButtonByType', () => {
|
|
|
145
146
|
AccessibilityLabel.HEADER_BUTTON_TYPE_MORE &&
|
|
146
147
|
el.type === TouchableOpacity
|
|
147
148
|
);
|
|
148
|
-
const
|
|
149
|
+
const moreIcon = instance.find(
|
|
149
150
|
(el) =>
|
|
150
151
|
el.props.accessibilityLabel ===
|
|
151
|
-
AccessibilityLabel.ICON_OUTLINE_TYPE_MORE && el.type ===
|
|
152
|
+
AccessibilityLabel.ICON_OUTLINE_TYPE_MORE && el.type === MaterialIcons
|
|
152
153
|
);
|
|
153
154
|
await act(async () => {
|
|
154
155
|
await touch2.props.onPress();
|
|
155
156
|
});
|
|
156
|
-
expect(
|
|
157
|
+
expect(moreIcon.props.name).toEqual('more-vert');
|
|
157
158
|
});
|
|
158
159
|
});
|
|
@@ -59,7 +59,7 @@ const GroupButtonByType = memo(({ route }) => {
|
|
|
59
59
|
accessibilityLabel={AccessibilityLabel.HEADER_BUTTON_TYPE_RELOAD}
|
|
60
60
|
>
|
|
61
61
|
<AntDesign
|
|
62
|
-
name={'
|
|
62
|
+
name={'reload1'}
|
|
63
63
|
size={27}
|
|
64
64
|
color={Colors.Black}
|
|
65
65
|
accessibilityLabel={AccessibilityLabel.ICON_OUTLINE_TYPE_RELOAD}
|
|
@@ -3,6 +3,7 @@ import { TouchableOpacity, View, ScrollView } from 'react-native';
|
|
|
3
3
|
import MapView, { Marker, Circle, PROVIDER_GOOGLE } from 'react-native-maps';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
7
|
import { check, RESULTS } from 'react-native-permissions';
|
|
7
8
|
import { openPromptEnableLocation } from '../../utils/Setting/Location';
|
|
8
9
|
|
|
@@ -194,7 +195,11 @@ const SelectAddress = memo(({ route }) => {
|
|
|
194
195
|
style={styles.button}
|
|
195
196
|
accessibilityLabel={AccessibilityLabel.BUTTON_YOUR_LOCATION}
|
|
196
197
|
>
|
|
197
|
-
<
|
|
198
|
+
<MaterialIcons
|
|
199
|
+
name="my-location"
|
|
200
|
+
size={27}
|
|
201
|
+
color={Colors.Primary}
|
|
202
|
+
/>
|
|
198
203
|
<Text type="Body" color={Colors.Gray9} style={styles.text} bold>
|
|
199
204
|
{t('your_location')}
|
|
200
205
|
</Text>
|
|
@@ -205,7 +210,7 @@ const SelectAddress = memo(({ route }) => {
|
|
|
205
210
|
style={styles.button}
|
|
206
211
|
accessibilityLabel={AccessibilityLabel.BUTTON_CHOOSE_ON_MAP}
|
|
207
212
|
>
|
|
208
|
-
<AntDesign name="
|
|
213
|
+
<AntDesign name="enviroment" size={27} color={Colors.Primary} />
|
|
209
214
|
<Text type="Body" color={Colors.Gray9} style={styles.text} bold>
|
|
210
215
|
{t('choose_on_map')}
|
|
211
216
|
</Text>
|
|
@@ -243,7 +248,7 @@ const SelectAddress = memo(({ route }) => {
|
|
|
243
248
|
}}
|
|
244
249
|
tracksViewChanges={false}
|
|
245
250
|
>
|
|
246
|
-
<AntDesign name="
|
|
251
|
+
<AntDesign name="enviroment" size={27} color={Colors.Blue10} />
|
|
247
252
|
</Marker>
|
|
248
253
|
</>
|
|
249
254
|
)}
|
|
@@ -2,6 +2,7 @@ import React, { useCallback, useRef, useState } from 'react';
|
|
|
2
2
|
import { Dimensions, View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import Popover from '../../../../commons/Popover';
|
|
4
4
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
5
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
5
6
|
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
6
7
|
|
|
7
8
|
import { Colors } from '../../../../configs';
|
|
@@ -107,8 +108,8 @@ const HeaderComponent = ({ title, goBack, dark, hideRight, style }) => {
|
|
|
107
108
|
onPress={() => setMenu(true)}
|
|
108
109
|
style={styles.rightHeader}
|
|
109
110
|
>
|
|
110
|
-
<
|
|
111
|
-
name="more"
|
|
111
|
+
<MaterialIcons
|
|
112
|
+
name="more-vert"
|
|
112
113
|
size={30}
|
|
113
114
|
color={dark ? Colors.Black : Colors.White}
|
|
114
115
|
/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
4
5
|
|
|
5
6
|
import styles from './styles';
|
|
6
7
|
|
|
@@ -121,7 +122,11 @@ const AirQuality = memo(({ summaryDetail }) => {
|
|
|
121
122
|
{<SegmentedRoundChart data={outdoor} />}
|
|
122
123
|
{!!advices?.length && (
|
|
123
124
|
<View style={styles.boxHealth}>
|
|
124
|
-
<
|
|
125
|
+
<MaterialCommunityIcons
|
|
126
|
+
name="alert-circle-outline"
|
|
127
|
+
size={20}
|
|
128
|
+
style={styles.iconMargin}
|
|
129
|
+
/>
|
|
125
130
|
<Text semibold color={Colors.Gray9} type="H4">
|
|
126
131
|
{t('Health advices:')}
|
|
127
132
|
</Text>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
4
4
|
import { useTranslations } from '../../../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../../../configs';
|
|
@@ -37,7 +37,11 @@ const UvIndex = memo(({ summaryDetail }) => {
|
|
|
37
37
|
<Today />
|
|
38
38
|
<SegmentedRoundChart data={data} />
|
|
39
39
|
<View style={styles.boxHealth}>
|
|
40
|
-
<
|
|
40
|
+
<MaterialCommunityIcons
|
|
41
|
+
name="alert-circle-outline"
|
|
42
|
+
size={20}
|
|
43
|
+
style={styles.iconMargin}
|
|
44
|
+
/>
|
|
41
45
|
<Text
|
|
42
46
|
semibold
|
|
43
47
|
color={Colors.Gray9}
|
package/src/utils/Monitor.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { getPusher, destroyPusher } from './Pusher';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// channel.bind('new-notification', callback);
|
|
3
|
+
export const watchNotificationData = (user, handler) => {
|
|
4
|
+
const channel = getPusher().subscribe(`private-user-${user.id}`);
|
|
5
|
+
channel.bind('new-notification', handler);
|
|
7
6
|
};
|
|
8
7
|
|
|
9
8
|
export const unwatchNotificationData = (user) => {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
getPusher().unsubscribe(`private-user-${user.id}`);
|
|
10
|
+
destroyPusher();
|
|
12
11
|
};
|