@eohjsc/react-native-smart-city 0.6.0-rc2 → 0.6.0-rc4
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/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/Header/HeaderCustom.js +6 -1
- package/src/commons/SearchLocation/index.js +1 -1
- package/src/commons/SubUnit/Item/index.js +3 -3
- package/src/commons/SummaryItem/index.js +22 -23
- package/src/commons/Unit/HeaderUnit/index.js +3 -2
- package/src/commons/Unit/SharedUnit.js +2 -2
- package/src/configs/API.js +1 -2
- 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 +3 -2
- package/src/screens/Automate/index.js +1 -1
- package/src/screens/Device/detail.js +4 -3
- package/src/screens/HanetCamera/Detail.js +6 -2
- package/src/screens/Notification/__test__/Notification.test.js +5 -15
- package/src/screens/Notification/index.js +3 -3
- package/src/screens/SharedUnit/TabHeader.js +1 -1
- package/src/screens/Sharing/UnitMemberList.js +6 -5
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +4 -3
- package/src/screens/SubUnit/ManageSubUnit.js +2 -1
- package/src/screens/Template/detail.js +2 -2
- package/src/screens/Unit/SelectAddress.js +8 -3
- package/src/screens/Unit/SmartAccountItem.js +2 -2
- package/src/screens/Unit/Summaries.js +21 -27
- 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/package.json
CHANGED
|
@@ -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>
|
|
@@ -3,6 +3,7 @@ import { View, Text, TouchableOpacity, Image } from 'react-native';
|
|
|
3
3
|
import Images from '../../configs/Images';
|
|
4
4
|
import { Colors } from '../../configs';
|
|
5
5
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
6
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
7
|
import { useNavigation } from '@react-navigation/native';
|
|
7
8
|
import styles from './Styles/HeaderCustomStyles';
|
|
8
9
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
@@ -98,7 +99,11 @@ const HeaderCustom = ({
|
|
|
98
99
|
accessibilityLabel={AccessibilityLabel.MENU_POPPER_MORE}
|
|
99
100
|
>
|
|
100
101
|
<View style={styles.buttonBack}>
|
|
101
|
-
<
|
|
102
|
+
<MaterialIcons
|
|
103
|
+
name={'more-vert'}
|
|
104
|
+
size={27}
|
|
105
|
+
color={Colors.Black}
|
|
106
|
+
/>
|
|
102
107
|
</View>
|
|
103
108
|
</TouchableOpacity>
|
|
104
109
|
</>
|
|
@@ -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={() => {}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { memo } from 'react';
|
|
1
|
+
import React, { memo, useCallback, useMemo } from 'react';
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
3
|
import styles from './styles';
|
|
4
4
|
import { Colors } from '../../configs';
|
|
@@ -11,38 +11,37 @@ import WaterQuality from '../../../assets/images/WaterQuality.svg';
|
|
|
11
11
|
import Device from '../../../assets/images/Device.svg';
|
|
12
12
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
13
13
|
|
|
14
|
+
const iconMap = {
|
|
15
|
+
air_quality: AirQuality,
|
|
16
|
+
water_quality: WaterQuality,
|
|
17
|
+
temperature: Temperature,
|
|
18
|
+
uv_index: UVIndex,
|
|
19
|
+
three_phase_power_consumption: PowerMeter,
|
|
20
|
+
power_consumption: PowerMeter,
|
|
21
|
+
default: Device,
|
|
22
|
+
};
|
|
23
|
+
|
|
14
24
|
const SummaryItem = memo(({ item, goToSummary }) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return Temperature; /* istanbul ignore next */
|
|
23
|
-
case 'uv_index':
|
|
24
|
-
return UVIndex; /* istanbul ignore next */
|
|
25
|
-
case 'three_phase_power_consumption':
|
|
26
|
-
return PowerMeter; /* istanbul ignore next */
|
|
27
|
-
case 'power_consumption':
|
|
28
|
-
return PowerMeter; /* istanbul ignore next */
|
|
29
|
-
default:
|
|
30
|
-
return Device; /* istanbul ignore next */
|
|
31
|
-
}
|
|
32
|
-
})();
|
|
25
|
+
const { template, left_text, left_value, id } = item;
|
|
26
|
+
const Icon = useMemo(() => iconMap[template] || iconMap.default, [template]);
|
|
27
|
+
|
|
28
|
+
const handlePress = useCallback(() => {
|
|
29
|
+
goToSummary(item);
|
|
30
|
+
}, [goToSummary, item]);
|
|
31
|
+
|
|
33
32
|
return (
|
|
34
33
|
<TouchableOpacity
|
|
35
|
-
onPress={
|
|
34
|
+
onPress={handlePress}
|
|
36
35
|
style={styles.wrapSummaryItem}
|
|
37
|
-
accessibilityLabel={`${AccessibilityLabel.UNIT_DETAIL_UNIT_SUMMARY_ITEM}-${
|
|
36
|
+
accessibilityLabel={`${AccessibilityLabel.UNIT_DETAIL_UNIT_SUMMARY_ITEM}-${id}`}
|
|
38
37
|
>
|
|
39
38
|
<View style={styles.summaryItem}>
|
|
40
39
|
<Icon />
|
|
41
40
|
<Text type="Body" color={Colors.Gray7} style={styles.summaryText}>
|
|
42
|
-
{
|
|
41
|
+
{left_text}
|
|
43
42
|
</Text>
|
|
44
43
|
<Text color={Colors.Gray9} bold>
|
|
45
|
-
{
|
|
44
|
+
{left_value}
|
|
46
45
|
</Text>
|
|
47
46
|
</View>
|
|
48
47
|
<View style={styles.dashItem} />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo, useCallback, useRef } from 'react';
|
|
2
2
|
import { View, TouchableOpacity, StyleSheet, StatusBar } from 'react-native';
|
|
3
3
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
4
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
4
5
|
import { useNavigation } from '@react-navigation/native';
|
|
5
6
|
import { getStatusBarHeight } from 'react-native-iphone-x-helper';
|
|
6
7
|
|
|
@@ -84,8 +85,8 @@ const HeaderUnit = memo(
|
|
|
84
85
|
accessibilityLabel={idButtonMore}
|
|
85
86
|
>
|
|
86
87
|
<View style={styles.btnMore}>
|
|
87
|
-
<
|
|
88
|
-
name={'more'}
|
|
88
|
+
<MaterialIcons
|
|
89
|
+
name={'more-vert'}
|
|
89
90
|
size={27}
|
|
90
91
|
color={transparent ? Colors.White : Colors.Black}
|
|
91
92
|
/>
|
|
@@ -100,7 +100,7 @@ const SharedUnit = ({
|
|
|
100
100
|
/>
|
|
101
101
|
) : (
|
|
102
102
|
<AntDesign
|
|
103
|
-
name="
|
|
103
|
+
name="pushpino"
|
|
104
104
|
size={20}
|
|
105
105
|
onPress={addPinSharedUnit}
|
|
106
106
|
accessibilityLabel={`${AccessibilityLabel.ICON_ADD_PIN_SHARED_UNIT}-${item.id}`}
|
|
@@ -116,7 +116,7 @@ const SharedUnit = ({
|
|
|
116
116
|
/>
|
|
117
117
|
) : (
|
|
118
118
|
<AntDesign
|
|
119
|
-
name="
|
|
119
|
+
name="staro"
|
|
120
120
|
size={20}
|
|
121
121
|
onPress={addStarSharedUnit}
|
|
122
122
|
accessibilityLabel={`${AccessibilityLabel.ICON_ADD_STAR_SHARED_UNIT}-${item.id}`}
|
package/src/configs/API.js
CHANGED
|
@@ -195,8 +195,7 @@ const API = {
|
|
|
195
195
|
},
|
|
196
196
|
},
|
|
197
197
|
NOTIFICATION: {
|
|
198
|
-
LIST_EOH_NOTIFICATIONS: (page
|
|
199
|
-
`/notifications/eoh/?page=${page}&type=${type}`,
|
|
198
|
+
LIST_EOH_NOTIFICATIONS: (page) => `/notifications/eoh/?page=${page}`,
|
|
200
199
|
SET_READ: (id) => `/notifications/eoh/${id}/set_read/`,
|
|
201
200
|
},
|
|
202
201
|
VALUE_EVALUATIONS: () => '/property_manager/config_value_evaluations/',
|
|
@@ -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
|
/>
|
|
@@ -8,6 +8,7 @@ import React, {
|
|
|
8
8
|
import { Image, Platform, TouchableOpacity, View, Switch } from 'react-native';
|
|
9
9
|
import { PopoverMode } from 'react-native-popover-view';
|
|
10
10
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
11
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
11
12
|
|
|
12
13
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
13
14
|
import styles from './Styles/indexStyles';
|
|
@@ -191,7 +192,7 @@ const ScriptDetail = ({ route }) => {
|
|
|
191
192
|
accessibilityLabel={AccessibilityLabel.ICON_MORE}
|
|
192
193
|
>
|
|
193
194
|
<View style={[styles.headerButton, styles.moreButton]}>
|
|
194
|
-
<
|
|
195
|
+
<MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
|
|
195
196
|
</View>
|
|
196
197
|
</TouchableOpacity>
|
|
197
198
|
</View>
|
|
@@ -480,7 +481,7 @@ const ButtonStar = ({ automate }) => {
|
|
|
480
481
|
{isStarred ? (
|
|
481
482
|
<AntDesign name="star" size={25} color={Colors.Yellow6} />
|
|
482
483
|
) : (
|
|
483
|
-
<AntDesign name="
|
|
484
|
+
<AntDesign name="staro" size={25} />
|
|
484
485
|
)}
|
|
485
486
|
</PreventDoubleTouch>
|
|
486
487
|
);
|
|
@@ -197,7 +197,7 @@ const Automate = () => {
|
|
|
197
197
|
/* istanbul ignore next */
|
|
198
198
|
headerRight: () => (
|
|
199
199
|
<TouchableOpacity style={styles.buttonAdd}>
|
|
200
|
-
<AntDesign name={'
|
|
200
|
+
<AntDesign name={'pluscircle'} size={28} color={Colors.Orange} />
|
|
201
201
|
</TouchableOpacity>
|
|
202
202
|
),
|
|
203
203
|
});
|
|
@@ -9,6 +9,7 @@ import React, {
|
|
|
9
9
|
import { View, TouchableOpacity, Platform } from 'react-native';
|
|
10
10
|
import { useNavigation, useFocusEffect } from '@react-navigation/native';
|
|
11
11
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
12
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
12
13
|
import moment from 'moment';
|
|
13
14
|
|
|
14
15
|
import { SCContext } from '../../context';
|
|
@@ -684,9 +685,9 @@ const DeviceDetail = ({ route }) => {
|
|
|
684
685
|
>
|
|
685
686
|
<View style={styles.buttonStar}>
|
|
686
687
|
{isFavorite ? (
|
|
687
|
-
<AntDesign name="star" size={
|
|
688
|
+
<AntDesign name="star" size={30} color={Colors.Yellow6} />
|
|
688
689
|
) : (
|
|
689
|
-
<AntDesign name="
|
|
690
|
+
<AntDesign name="staro" size={30} />
|
|
690
691
|
)}
|
|
691
692
|
</View>
|
|
692
693
|
</TouchableOpacity>
|
|
@@ -705,7 +706,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
705
706
|
ref={refMenuAction}
|
|
706
707
|
accessibilityLabel={AccessibilityLabel.HEADER_DEVICE_BUTTON_MORE}
|
|
707
708
|
>
|
|
708
|
-
<
|
|
709
|
+
<MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
|
|
709
710
|
</TouchableOpacity>
|
|
710
711
|
</View>
|
|
711
712
|
),
|
|
@@ -7,7 +7,7 @@ import React, {
|
|
|
7
7
|
} from 'react';
|
|
8
8
|
import { View, TouchableOpacity, FlatList, Image } from 'react-native';
|
|
9
9
|
import { useNavigation } from '@react-navigation/native';
|
|
10
|
-
import
|
|
10
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
11
11
|
import moment from 'moment';
|
|
12
12
|
import styles from './styles/detailStyles';
|
|
13
13
|
import { HeaderCustom } from '../../commons/Header';
|
|
@@ -184,7 +184,11 @@ const HanetCameraDetail = ({ route }) => {
|
|
|
184
184
|
onPress={handleShowMenuAction}
|
|
185
185
|
ref={refMenuAction}
|
|
186
186
|
>
|
|
187
|
-
<
|
|
187
|
+
<MaterialIcons
|
|
188
|
+
name={'more-vert'}
|
|
189
|
+
size={27}
|
|
190
|
+
color={Colors.Black}
|
|
191
|
+
/>
|
|
188
192
|
</TouchableOpacity>
|
|
189
193
|
</View>
|
|
190
194
|
);
|
|
@@ -73,9 +73,7 @@ describe('test Notification', () => {
|
|
|
73
73
|
},
|
|
74
74
|
],
|
|
75
75
|
};
|
|
76
|
-
mock
|
|
77
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
78
|
-
.reply(200, response);
|
|
76
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
79
77
|
await act(async () => {
|
|
80
78
|
tree = await create(wrapComponent());
|
|
81
79
|
});
|
|
@@ -101,9 +99,7 @@ describe('test Notification', () => {
|
|
|
101
99
|
type: 'NEWS',
|
|
102
100
|
});
|
|
103
101
|
}
|
|
104
|
-
mock
|
|
105
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
106
|
-
.reply(200, response);
|
|
102
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
107
103
|
await act(async () => {
|
|
108
104
|
tree = await create(wrapComponent());
|
|
109
105
|
});
|
|
@@ -112,9 +108,7 @@ describe('test Notification', () => {
|
|
|
112
108
|
expect(wrapHeaderScrollable.props.disableLoadMore).toEqual(false);
|
|
113
109
|
|
|
114
110
|
const scrollView = instance.findByType(Animated.ScrollView);
|
|
115
|
-
mock
|
|
116
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(2, ''))
|
|
117
|
-
.reply(200, response);
|
|
111
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(2)).reply(200, response);
|
|
118
112
|
await act(async () => {
|
|
119
113
|
scrollView.props.onMomentumScrollEnd();
|
|
120
114
|
});
|
|
@@ -144,9 +138,7 @@ describe('test Notification', () => {
|
|
|
144
138
|
},
|
|
145
139
|
],
|
|
146
140
|
};
|
|
147
|
-
mock
|
|
148
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
149
|
-
.reply(200, response);
|
|
141
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
150
142
|
await act(async () => {
|
|
151
143
|
tree = await create(wrapComponent());
|
|
152
144
|
});
|
|
@@ -179,9 +171,7 @@ describe('test Notification', () => {
|
|
|
179
171
|
},
|
|
180
172
|
],
|
|
181
173
|
};
|
|
182
|
-
mock
|
|
183
|
-
.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1, ''))
|
|
184
|
-
.reply(200, response);
|
|
174
|
+
mock.onGet(API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)).reply(200, response);
|
|
185
175
|
await act(async () => {
|
|
186
176
|
tree = await create(wrapComponent());
|
|
187
177
|
});
|
|
@@ -41,7 +41,7 @@ const Notification = memo(() => {
|
|
|
41
41
|
notImplemented(t);
|
|
42
42
|
}}
|
|
43
43
|
>
|
|
44
|
-
<AntDesign name={'
|
|
44
|
+
<AntDesign name={'search1'} size={27} color={Colors.Black} />
|
|
45
45
|
</TouchableOpacity>
|
|
46
46
|
</View>
|
|
47
47
|
),
|
|
@@ -51,7 +51,7 @@ const Notification = memo(() => {
|
|
|
51
51
|
|
|
52
52
|
const fetchNotifications = useCallback(async (pageParam) => {
|
|
53
53
|
const { success, data } = await axiosGet(
|
|
54
|
-
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(pageParam
|
|
54
|
+
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(pageParam)
|
|
55
55
|
);
|
|
56
56
|
if (success) {
|
|
57
57
|
setNotifications((preState) => preState.concat(data.results));
|
|
@@ -69,7 +69,7 @@ const Notification = memo(() => {
|
|
|
69
69
|
const onRefresh = useCallback(async () => {
|
|
70
70
|
setPage(1);
|
|
71
71
|
const { success, data } = await axiosGet(
|
|
72
|
-
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1
|
|
72
|
+
API.NOTIFICATION.LIST_EOH_NOTIFICATIONS(1)
|
|
73
73
|
);
|
|
74
74
|
if (success) {
|
|
75
75
|
setNotifications(data.results);
|
|
@@ -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>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect } from 'react';
|
|
2
2
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
3
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
3
4
|
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
4
5
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
5
6
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
@@ -81,11 +82,11 @@ const UnitMemberList = ({ route }) => {
|
|
|
81
82
|
onPress={onPressRightHeader}
|
|
82
83
|
style={styles.rightHeader}
|
|
83
84
|
>
|
|
84
|
-
|
|
85
|
-
name={
|
|
86
|
-
|
|
87
|
-
color={Colors.Black}
|
|
88
|
-
|
|
85
|
+
{isOwner ? (
|
|
86
|
+
<AntDesign name={'plus'} size={30} color={Colors.Black} />
|
|
87
|
+
) : (
|
|
88
|
+
<MaterialIcons name={'more-vert'} size={30} color={Colors.Black} />
|
|
89
|
+
)}
|
|
89
90
|
</TouchableOpacity>
|
|
90
91
|
);
|
|
91
92
|
|
|
@@ -6,6 +6,7 @@ import SmartTiviActionTemplate from '../../../../commons/ActionGroup/SmartTiviAc
|
|
|
6
6
|
import Text from '../../../../commons/Text';
|
|
7
7
|
import { ModalCustom } from '../../../../commons/Modal';
|
|
8
8
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
9
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
9
10
|
import { Colors } from '../../../../configs';
|
|
10
11
|
import TextInput from '../../../../commons/Form/TextInput';
|
|
11
12
|
import { ButtonsBottom } from './ButtonsBottom';
|
|
@@ -58,7 +59,7 @@ const GroupButtonByType = memo(({ route }) => {
|
|
|
58
59
|
accessibilityLabel={AccessibilityLabel.HEADER_BUTTON_TYPE_RELOAD}
|
|
59
60
|
>
|
|
60
61
|
<AntDesign
|
|
61
|
-
name={'
|
|
62
|
+
name={'reload1'}
|
|
62
63
|
size={27}
|
|
63
64
|
color={Colors.Black}
|
|
64
65
|
accessibilityLabel={AccessibilityLabel.ICON_OUTLINE_TYPE_RELOAD}
|
|
@@ -69,8 +70,8 @@ const GroupButtonByType = memo(({ route }) => {
|
|
|
69
70
|
style={[styles.headerButton]}
|
|
70
71
|
accessibilityLabel={AccessibilityLabel.HEADER_BUTTON_TYPE_MORE}
|
|
71
72
|
>
|
|
72
|
-
<
|
|
73
|
-
name={'more'}
|
|
73
|
+
<MaterialIcons
|
|
74
|
+
name={'more-vert'}
|
|
74
75
|
size={27}
|
|
75
76
|
color={Colors.Black}
|
|
76
77
|
accessibilityLabel={AccessibilityLabel.ICON_OUTLINE_TYPE_MORE}
|
|
@@ -15,6 +15,7 @@ import Text from '../../commons/Text';
|
|
|
15
15
|
|
|
16
16
|
import styles from './ManageSubUnitStyles';
|
|
17
17
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
18
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
18
19
|
import Routes from '../../utils/Route';
|
|
19
20
|
import { RowItem } from '../../commons/RowItem';
|
|
20
21
|
import NoSubUnitImage from '../../../assets/images/Illustrations.svg';
|
|
@@ -60,7 +61,7 @@ const ManageSubUnit = ({ route }) => {
|
|
|
60
61
|
// ref={refMenuAction}
|
|
61
62
|
style={[styles.headerButton, styles.moreButton]}
|
|
62
63
|
>
|
|
63
|
-
<
|
|
64
|
+
<MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
|
|
64
65
|
</TouchableOpacity>
|
|
65
66
|
</View>
|
|
66
67
|
),
|
|
@@ -6,7 +6,7 @@ import React, {
|
|
|
6
6
|
useState,
|
|
7
7
|
} from 'react';
|
|
8
8
|
import { View, TouchableOpacity } from 'react-native';
|
|
9
|
-
import
|
|
9
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
10
10
|
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
11
11
|
|
|
12
12
|
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
@@ -163,7 +163,7 @@ const TemplateDetail = () => {
|
|
|
163
163
|
ref={refMenuAction}
|
|
164
164
|
style={styles.headerButton}
|
|
165
165
|
>
|
|
166
|
-
<
|
|
166
|
+
<MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
|
|
167
167
|
</TouchableOpacity>
|
|
168
168
|
</View>
|
|
169
169
|
);
|
|
@@ -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
|
)}
|
|
@@ -4,7 +4,7 @@ import React, { memo, useRef } from 'react';
|
|
|
4
4
|
import styles from './SmartAccountStyles';
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
6
|
import Text from '../../commons/Text';
|
|
7
|
-
import
|
|
7
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
8
8
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
9
9
|
|
|
10
10
|
export const SmartAccountItem = memo(
|
|
@@ -44,7 +44,7 @@ export const SmartAccountItem = memo(
|
|
|
44
44
|
onPress={onPressMore}
|
|
45
45
|
ref={buttonMoreRef}
|
|
46
46
|
>
|
|
47
|
-
<
|
|
47
|
+
<MaterialIcons name={'more-vert'} size={27} color={Colors.Black} />
|
|
48
48
|
</TouchableOpacity>
|
|
49
49
|
</View>
|
|
50
50
|
);
|
|
@@ -10,6 +10,7 @@ import { AccessibilityLabel } from '../../configs/Constants';
|
|
|
10
10
|
import { useSCContextSelector } from '../../context';
|
|
11
11
|
|
|
12
12
|
const Summaries = memo(({ unit }) => {
|
|
13
|
+
const { id } = unit;
|
|
13
14
|
const [unitSummaries, setUnitSummaries] = useState([]);
|
|
14
15
|
const isFocused = useIsFocused();
|
|
15
16
|
const navigation = useNavigation();
|
|
@@ -17,12 +18,12 @@ const Summaries = memo(({ unit }) => {
|
|
|
17
18
|
const timeoutId = useRef(null);
|
|
18
19
|
|
|
19
20
|
const fetchUnitSummary = useCallback(async () => {
|
|
20
|
-
if (!
|
|
21
|
+
if (!id) {
|
|
21
22
|
return false;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const { success, data } = await axiosGet(
|
|
25
|
-
API.UNIT.UNIT_SUMMARY(
|
|
26
|
+
API.UNIT.UNIT_SUMMARY(id),
|
|
26
27
|
{},
|
|
27
28
|
true
|
|
28
29
|
);
|
|
@@ -31,18 +32,18 @@ const Summaries = memo(({ unit }) => {
|
|
|
31
32
|
return true;
|
|
32
33
|
}
|
|
33
34
|
return false;
|
|
34
|
-
}, [
|
|
35
|
+
}, [id]);
|
|
35
36
|
|
|
36
37
|
const goToSummary = useCallback(
|
|
37
38
|
(summary) => {
|
|
38
39
|
navigation.navigate(Routes.UnitSummary, {
|
|
39
40
|
summaryId: summary.id,
|
|
40
|
-
unitId:
|
|
41
|
+
unitId: id,
|
|
41
42
|
summaryData: summary,
|
|
42
43
|
unitData: unit,
|
|
43
44
|
});
|
|
44
45
|
},
|
|
45
|
-
[navigation, unit]
|
|
46
|
+
[navigation, unit, id]
|
|
46
47
|
);
|
|
47
48
|
|
|
48
49
|
const continuousFetchSummary = useCallback(async () => {
|
|
@@ -80,32 +81,25 @@ const Summaries = memo(({ unit }) => {
|
|
|
80
81
|
const { dataNotification } = useReceiveNotifications();
|
|
81
82
|
|
|
82
83
|
useEffect(() => {
|
|
83
|
-
if (dataNotification) {
|
|
84
|
-
|
|
85
|
-
if (summary_id) {
|
|
86
|
-
fetchUnitSummary();
|
|
87
|
-
}
|
|
84
|
+
if (dataNotification?.params?.summary_id) {
|
|
85
|
+
fetchUnitSummary();
|
|
88
86
|
}
|
|
89
87
|
}, [dataNotification, fetchUnitSummary]);
|
|
90
88
|
|
|
89
|
+
if (unitSummaries.length === 0) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
91
93
|
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
key={(item?.id || index).toString()}
|
|
102
|
-
item={item}
|
|
103
|
-
goToSummary={goToSummary}
|
|
104
|
-
/>
|
|
105
|
-
))}
|
|
106
|
-
</ScrollView>
|
|
107
|
-
)}
|
|
108
|
-
</>
|
|
94
|
+
<ScrollView
|
|
95
|
+
horizontal
|
|
96
|
+
scrollIndicatorInsets={{ right: 1 }}
|
|
97
|
+
accessibilityLabel={AccessibilityLabel.UNIT_DETAIL_UNIT_SUMMARY_VIEW}
|
|
98
|
+
>
|
|
99
|
+
{unitSummaries.map((item) => (
|
|
100
|
+
<SummaryItem key={item.id} item={item} goToSummary={goToSummary} />
|
|
101
|
+
))}
|
|
102
|
+
</ScrollView>
|
|
109
103
|
);
|
|
110
104
|
});
|
|
111
105
|
|
|
@@ -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}
|