@eohjsc/react-native-smart-city 0.7.3-rc9 → 0.7.4

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.
Files changed (166) hide show
  1. package/assets/images/Map/LocationPin.svg +10 -0
  2. package/package.json +4 -2
  3. package/src/commons/Action/__test__/ItemQuickAction.test.js +2 -2
  4. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
  5. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
  6. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
  7. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  8. package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
  9. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
  10. package/src/commons/ActionGroup/SliderRangeTemplate.js +7 -7
  11. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
  12. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
  13. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +5 -5
  14. package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
  15. package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
  16. package/src/commons/ActionGroup/TimerActionTemplate.js +6 -3
  17. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
  18. package/src/commons/ActionGroup/__test__/index.test.js +2 -2
  19. package/src/commons/ActionGroup/index.js +2 -2
  20. package/src/commons/Automate/ItemAutomate.js +9 -41
  21. package/src/commons/Automate/ItemConditionScriptDetail.js +109 -0
  22. package/src/commons/Automate/ItemConditionScriptDetailStyles.js +46 -0
  23. package/src/commons/Automate/__test__/ItemAutomate.test.js +0 -21
  24. package/src/commons/BackDefault/index.js +2 -2
  25. package/src/commons/BottomButtonView/index.js +1 -0
  26. package/src/commons/ButtonPopup/index.js +3 -2
  27. package/src/commons/DateTimeRangeChange/DateTimeButton.js +3 -3
  28. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  29. package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
  30. package/src/commons/Device/FlatListItems.js +3 -3
  31. package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
  32. package/src/commons/Device/HorizontalBarChart.js +54 -34
  33. package/src/commons/Device/ItemAddNew/index.js +2 -2
  34. package/src/commons/Device/ItemDevice.js +2 -2
  35. package/src/commons/Device/SonosSpeaker/index.js +3 -3
  36. package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
  37. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +6 -2
  38. package/src/commons/DisplayChecking/index.js +2 -2
  39. package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
  40. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  41. package/src/commons/FlatListDnD/index.js +12 -9
  42. package/src/commons/Grid/GridItem.js +10 -2
  43. package/src/commons/Header/HeaderCustom.js +2 -2
  44. package/src/commons/HeaderAni/index.js +2 -2
  45. package/src/commons/IconComponent/index.js +4 -4
  46. package/src/commons/NavBar/index.js +2 -2
  47. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
  48. package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +4 -4
  49. package/src/commons/SearchLocation/index.js +3 -3
  50. package/src/commons/SelectActionCard/index.js +2 -2
  51. package/src/commons/SelectSubUnit/index.js +6 -2
  52. package/src/commons/Sharing/BtnRemoveMember.js +2 -2
  53. package/src/commons/Sharing/StationDevicePermissions.js +2 -2
  54. package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
  55. package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
  56. package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
  57. package/src/commons/SubUnit/OneTap/ItemOneTap.js +3 -4
  58. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +0 -2
  59. package/src/commons/SubUnit/OneTap/index.js +9 -8
  60. package/src/commons/Unit/HeaderUnit/index.js +3 -3
  61. package/src/commons/Unit/SharedUnit.js +7 -7
  62. package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +4 -15
  63. package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +29 -18
  64. package/src/configs/API.js +1 -1
  65. package/src/configs/AccessibilityLabel.js +1 -0
  66. package/src/configs/Theme.js +1 -1
  67. package/src/hooks/IoT/__test__/useRemoteControl.test.js +14 -7
  68. package/src/hooks/IoT/useRemoteControl.js +18 -7
  69. package/src/hooks/useMqtt.js +2 -2
  70. package/src/iot/RemoteControl/Bluetooth.js +19 -22
  71. package/src/iot/RemoteControl/Internet.js +11 -3
  72. package/src/navigations/EmergencyContactsStack.js +4 -3
  73. package/src/navigations/SharedStack.js +2 -0
  74. package/src/navigations/UnitStack.js +56 -57
  75. package/src/screens/AQIGuide/index.js +0 -2
  76. package/src/screens/ActivityLog/index.js +2 -2
  77. package/src/screens/AddLocationMaps/index.js +16 -19
  78. package/src/screens/AddLocationMaps/indexStyle.js +1 -0
  79. package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
  80. package/src/screens/AddNewGateway/SelectDeviceType.js +1 -1
  81. package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +25 -9
  82. package/src/screens/Automate/AddNewAction/ChooseAction.js +17 -3
  83. package/src/screens/Automate/AddNewAction/ChooseConfig.js +7 -6
  84. package/src/screens/Automate/AddNewAction/NewActionWrapper.js +8 -8
  85. package/src/screens/Automate/AddNewAction/SelectControlDevices.js +30 -20
  86. package/src/screens/Automate/AddNewAction/SelectMonitorDevices.js +17 -10
  87. package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +58 -44
  88. package/src/screens/Automate/AddNewAction/SetupScriptDelay.js +1 -1
  89. package/src/screens/Automate/AddNewAction/SetupScriptNotify.js +3 -3
  90. package/src/screens/Automate/AddNewAction/Styles/SetupSensorStyles.js +20 -4
  91. package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +1 -1
  92. package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +14 -8
  93. package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +13 -7
  94. package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +54 -15
  95. package/src/screens/Automate/AddNewAction/__test__/SetupScriptNotify.test.js +29 -0
  96. package/src/screens/Automate/AddNewAutoSmart/AddTypeSmart.js +10 -10
  97. package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +2 -0
  98. package/src/screens/Automate/Components/InputName.js +10 -7
  99. package/src/screens/Automate/EditActionsList/index.js +19 -17
  100. package/src/screens/Automate/MultiUnits.js +19 -22
  101. package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +12 -2
  102. package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +9 -1
  103. package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +14 -6
  104. package/src/screens/Automate/ScriptDetail/Components/RenameScript.js +4 -7
  105. package/src/screens/Automate/ScriptDetail/__test__/index.test.js +42 -17
  106. package/src/screens/Automate/ScriptDetail/index.js +33 -22
  107. package/src/screens/Automate/SetSchedule/__test__/index.test.js +21 -10
  108. package/src/screens/Automate/SetSchedule/components/RowItem.js +5 -5
  109. package/src/screens/Automate/SetSchedule/index.js +8 -7
  110. package/src/screens/Automate/Styles/indexStyles.js +1 -1
  111. package/src/screens/Automate/__test__/MultiUnits.test.js +1 -4
  112. package/src/screens/Automate/__test__/index.test.js +0 -1
  113. package/src/screens/Automate/index.js +36 -34
  114. package/src/screens/ChangePosition/index.js +2 -1
  115. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +4 -4
  116. package/src/screens/Device/EditDevice/index.js +4 -4
  117. package/src/screens/Device/__test__/BluetoothDevice.test.js +300 -0
  118. package/src/screens/Device/__test__/detail.test.js +3 -3
  119. package/src/screens/Device/components/BluetoothDevice.js +135 -0
  120. package/src/screens/Device/components/SensorDisplayItem.js +4 -3
  121. package/src/screens/Device/detail.js +70 -62
  122. package/src/screens/Device/hooks/useEvaluateValue.js +1 -1
  123. package/src/screens/Drawer/index.js +3 -3
  124. package/src/screens/EmergencyContacts/EmergencyContactsList.js +8 -4
  125. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
  126. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  127. package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
  128. package/src/screens/GuestInfo/index.js +2 -2
  129. package/src/screens/HanetCamera/ManageAccess.js +3 -3
  130. package/src/screens/HanetCamera/MemberInfo.js +2 -2
  131. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  132. package/src/screens/ManageAccess/index.js +3 -3
  133. package/src/screens/Notification/components/NotificationItem.js +3 -3
  134. package/src/screens/Notification/index.js +3 -3
  135. package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
  136. package/src/screens/SelectUnit/__test__/index.test.js +1 -1
  137. package/src/screens/SelectUnit/index.js +4 -4
  138. package/src/screens/SharedUnit/TabHeader.js +2 -2
  139. package/src/screens/Sharing/Components/EndDevice.js +3 -3
  140. package/src/screens/Sharing/UnitMemberList.js +2 -2
  141. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +2 -2
  142. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +3 -2
  143. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +2 -2
  144. package/src/screens/SmartIr/components/SelectBrand.js +2 -2
  145. package/src/screens/SubUnit/AddSubUnit.js +28 -24
  146. package/src/screens/SubUnit/AddSubUnitStyles.js +10 -4
  147. package/src/screens/SubUnit/EditSubUnit.js +12 -11
  148. package/src/screens/SubUnit/ManageSubUnit.js +3 -3
  149. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +13 -13
  150. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +3 -3
  151. package/src/screens/Template/EditTemplate.js +6 -4
  152. package/src/screens/UVIndexGuide/index.js +2 -4
  153. package/src/screens/Unit/SelectAddToFavorites.js +2 -2
  154. package/src/screens/Unit/SelectAddress.js +16 -12
  155. package/src/screens/Unit/components/AutomateScript/index.js +2 -2
  156. package/src/screens/Unit/components/ButtonWrapper/index.js +3 -3
  157. package/src/screens/Unit/components/Header/index.js +2 -2
  158. package/src/screens/Unit/components/SharedUnit/index.js +5 -5
  159. package/src/screens/UnitSummary/components/AirQuality/index.js +6 -11
  160. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +6 -6
  161. package/src/screens/UnitSummary/index.js +3 -3
  162. package/src/utils/Apis/axios.js +5 -5
  163. package/src/utils/Functions/ShortEmail.js +1 -0
  164. package/src/utils/I18n/translations/en.js +6 -3
  165. package/src/utils/I18n/translations/vi.js +8 -4
  166. package/src/utils/bluetooth.js +3 -0
@@ -0,0 +1,46 @@
1
+ import { Platform, StyleSheet } from 'react-native';
2
+ import { Colors } from '../../configs';
3
+
4
+ export default StyleSheet.create({
5
+ wrap: {
6
+ height: 76,
7
+ backgroundColor: Colors.White,
8
+ paddingHorizontal: 16,
9
+ flexDirection: 'row',
10
+ alignItems: 'center',
11
+ justifyContent: 'space-between',
12
+ borderRadius: 8,
13
+ marginTop: 16,
14
+ shadowColor: Colors.Gray6,
15
+ shadowOffset: {
16
+ width: 0,
17
+ height: 2,
18
+ },
19
+ shadowOpacity: 0.5,
20
+ shadowRadius: 4,
21
+ elevation: 9,
22
+ },
23
+ col: {
24
+ alignItems: 'center',
25
+ flexDirection: 'row',
26
+ },
27
+ wrapIcon: {
28
+ justifyContent: 'center',
29
+ flexDirection: 'row',
30
+ width: 50,
31
+ },
32
+ wrapTitle: {
33
+ marginLeft: 10,
34
+ },
35
+ wrapStyle: {
36
+ borderRadius: 8,
37
+ borderBottomRightRadius: 8,
38
+ borderBottomLeftRadius: 8,
39
+ width: 160,
40
+ marginTop: Platform.select({
41
+ android: -25,
42
+ ios: 0,
43
+ }),
44
+ marginLeft: -10,
45
+ },
46
+ });
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { TouchableOpacity } from 'react-native';
3
2
  import { act, create } from 'react-test-renderer';
4
3
 
5
4
  import { SCProvider } from '../../../context';
@@ -23,24 +22,4 @@ describe('Test ItemAutomate', () => {
23
22
  const texts = instance.findAllByType(Text);
24
23
  expect(texts[0].props.children).toEqual('Launch One-Tap');
25
24
  });
26
-
27
- it('Test render TouchableOpacity', async () => {
28
- const mockOnPress = jest.fn();
29
- await act(async () => {
30
- tree = await create(
31
- wrapComponent({
32
- automate: {
33
- type: 'one_tap',
34
- },
35
- onPress: mockOnPress,
36
- })
37
- );
38
- });
39
- const instance = tree.root;
40
- const touchableOpacities = instance.findAllByType(TouchableOpacity);
41
- await act(async () => {
42
- touchableOpacities[0].props.onPress();
43
- });
44
- expect(mockOnPress).toHaveBeenCalledTimes(1);
45
- });
46
25
  });
@@ -1,6 +1,6 @@
1
1
  import React, { memo } from 'react';
2
2
  import { TouchableOpacity, StyleSheet } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import { AccessibilityLabel } from '../../configs/Constants';
5
5
 
6
6
  const BackDefault = memo(({ goBack, color, fixedHeight }) => {
@@ -10,7 +10,7 @@ const BackDefault = memo(({ goBack, color, fixedHeight }) => {
10
10
  onPress={goBack}
11
11
  style={[styles.wrap, fixedHeight && styles.noPaddingVertical]}
12
12
  >
13
- <AntDesign name="left" size={27} color={color} />
13
+ <IconOutline name="left" size={27} color={color} />
14
14
  </TouchableOpacity>
15
15
  );
16
16
  });
@@ -40,6 +40,7 @@ const BottomButtonView = memo(
40
40
  return (
41
41
  <Animated.View
42
42
  style={[
43
+ /* istanbul ignore next */
43
44
  typeMain === 'CardShadow'
44
45
  ? styleCustom.container1
45
46
  : styleCustom.container,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
 
5
5
  import { Colors, Device } from '../../configs';
6
6
  import { AccessibilityLabel } from '../../configs/Constants';
@@ -42,7 +42,7 @@ const ButtonPopup = ({
42
42
  <View style={styles.popoverStyle}>
43
43
  <View style={styles.modalWrapper}>
44
44
  {!hideClose && (
45
- <AntDesign
45
+ <IconOutline
46
46
  name={'close'}
47
47
  color={Colors.Gray8}
48
48
  style={styles.close}
@@ -92,6 +92,7 @@ const styles = StyleSheet.create({
92
92
  position: 'relative',
93
93
  backgroundColor: Colors.White,
94
94
  borderRadius: 10,
95
+ /* istanbul ignore next */
95
96
  marginBottom: Device.isIphoneX ? 20 : 0,
96
97
  },
97
98
  modalHeader: {
@@ -1,13 +1,13 @@
1
1
  import React, { memo } from 'react';
2
2
  import { StyleSheet, TouchableOpacity } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import { Colors } from '../../configs';
5
5
 
6
6
  const DateTimeButton = memo(({ onPress, style, children }) => {
7
7
  return (
8
8
  <TouchableOpacity style={[styles.dateSelect, style]} onPress={onPress}>
9
9
  {children}
10
- <AntDesign style={styles.iconDateTime} name={'calendar'} />
10
+ <IconOutline style={styles.iconDateTime} name={'calendar'} />
11
11
  </TouchableOpacity>
12
12
  );
13
13
  });
@@ -25,7 +25,7 @@ const styles = StyleSheet.create({
25
25
  marginHorizontal: 8,
26
26
  flexDirection: 'row',
27
27
  justifyContent: 'space-between',
28
- width: 150,
28
+ width: 130,
29
29
  alignItems: 'center',
30
30
  },
31
31
  txtTime: {
@@ -1,6 +1,6 @@
1
1
  import React, { memo } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import { useTranslations } from '../../hooks/Common/useTranslations';
5
5
  import { Colors } from '../../configs';
6
6
  import Text from '../../commons/Text';
@@ -30,7 +30,7 @@ const ConnectedViewHeader = memo(
30
30
  return (
31
31
  <View style={styles.statusContainer}>
32
32
  <View style={styles.connectStatus}>
33
- <AntDesign name={'wifi'} color={Colors.Green6} size={16} />
33
+ <IconOutline name={'wifi'} color={Colors.Green6} size={16} />
34
34
  <DisplayTextConnected type={type} />
35
35
  </View>
36
36
  {isDisplayTime && (
@@ -6,7 +6,7 @@ import MediaPlayer from '../../MediaPlayer';
6
6
  import { standardizeCameraScreenSize } from '../../../utils/Utils';
7
7
  import { Colors, Device } from '../../../configs';
8
8
  import { RowUser } from '../../RowUser';
9
- import AntDesign from 'react-native-vector-icons/AntDesign';
9
+ import { IconOutline } from '@ant-design/icons-react-native';
10
10
  import { useEmeragencyContacts } from '../../../screens/EmergencyContacts/hook';
11
11
  import { useIsFocused } from '@react-navigation/native';
12
12
 
@@ -49,12 +49,12 @@ const EmergencyDetail = memo(({ item }) => {
49
49
  key={contact.id.toString()}
50
50
  index={index}
51
51
  leftIcon={
52
- <AntDesign name={'user'} size={20} color={Colors.White} />
52
+ <IconOutline name={'user'} size={20} color={Colors.White} />
53
53
  }
54
54
  text={contact.name}
55
55
  rightComponent={
56
56
  <View style={styles.rightComponent}>
57
- <AntDesign
57
+ <IconOutline
58
58
  name={'phone'}
59
59
  size={20}
60
60
  color={Colors.Gray9}
@@ -1,6 +1,6 @@
1
1
  import React, { memo, useCallback, useState } from 'react';
2
2
  import { StyleSheet, TouchableOpacity, View } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import { Colors, Constants } from '../../configs';
5
5
  import { AccessibilityLabel } from '../../configs/Constants';
6
6
  import { useBoolean } from '../../hooks/Common';
@@ -75,7 +75,7 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
75
75
  style={styles.iconInfo}
76
76
  accessibilityLabel={AccessibilityLabel.TOUCH_INFO_FLAT_LIST_ITEM}
77
77
  >
78
- <AntDesign name={'info-circle'} size={16} color={Colors.Gray8} />
78
+ <IconOutline name={'info-circle'} size={16} color={Colors.Gray8} />
79
79
  </TouchableOpacity>
80
80
  )}
81
81
  </View>
@@ -98,7 +98,7 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
98
98
  onPress={() => setViewFull(true)}
99
99
  >
100
100
  <Text style={styles.textSeeMore}>{t('see_more')}</Text>
101
- <AntDesign name={'caretdown'} color={Colors.Gray8} size={16} />
101
+ <IconOutline name={'caret-down'} color={Colors.Gray8} size={16} />
102
102
  </TouchableOpacity>
103
103
  )}
104
104
 
@@ -5,7 +5,7 @@ import {
5
5
  TouchableWithoutFeedback,
6
6
  View,
7
7
  } from 'react-native';
8
- import AntDesign from 'react-native-vector-icons/AntDesign';
8
+ import { IconOutline } from '@ant-design/icons-react-native';
9
9
  import { useNavigation } from '@react-navigation/native';
10
10
 
11
11
  import Text from '../../Text';
@@ -35,7 +35,7 @@ const ItemHanetDevice = memo(
35
35
  return iconKit ? (
36
36
  <FImage source={{ uri: iconKit }} style={styles.iconSensor} />
37
37
  ) : (
38
- <AntDesign name={svgMain} size={32} color={Colors.Red6} />
38
+ <IconOutline name={svgMain} size={32} color={Colors.Red6} />
39
39
  );
40
40
  };
41
41
 
@@ -58,7 +58,7 @@ const ItemHanetDevice = memo(
58
58
  {title}
59
59
  </Text>
60
60
  <View style={styles.row}>
61
- <AntDesign name="right" size={12} />
61
+ <IconOutline name="right" size={12} />
62
62
  </View>
63
63
  </TouchableOpacity>
64
64
  </View>
@@ -1,11 +1,46 @@
1
- import React, { memo, useEffect, useMemo, useState } from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
1
  import { isEmpty } from 'lodash';
2
+ import React, { memo, useEffect, useMemo, useState } from 'react';
3
+ import { StyleSheet, View } from 'react-native';
4
4
 
5
5
  import { Colors } from '../../configs';
6
6
  import { getMaxValueIndex } from '../../utils/chartHelper/getMaxValueIndex';
7
7
  import Highcharts from '../Highcharts';
8
8
 
9
+ // https://github.com/facebook/hermes/issues/114#issuecomment-887106990
10
+ // 'show source' unstable, work sometime, use this to generate formatter function
11
+
12
+ // function formatter() {
13
+ // 'show source';
14
+ // const { unit, price } = JSON.parse(this.series.name);
15
+ // const textColor =
16
+ // this.color === '#00979D'
17
+ // ? this.y === 0
18
+ // ? '#262626'
19
+ // : '#FFFFFF'
20
+ // : '#262626';
21
+ // const valueStyle = `color:${textColor};font-weight:normal;font-size:12px;`;
22
+ // const costStyle = valueStyle + 'font-weight:bold;';
23
+ // let label = `<span style="${valueStyle}">` + `${this.y}${unit}`;
24
+ // if (price === '' || price === null || isNaN(price)) {
25
+ // return label + '</span>';
26
+ // }
27
+ // const formatMoney = (number) => {
28
+ // const formatNumber = number.toFixed();
29
+ // return (
30
+ // parseInt(formatNumber, 10)
31
+ // .toFixed(0)
32
+ // .toString()
33
+ // .replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1.') + 'đ'
34
+ // );
35
+ // };
36
+ // return (
37
+ // label +
38
+ // `/<span style="${costStyle}">` +
39
+ // formatMoney(this.y * price) +
40
+ // '</span></span>'
41
+ // );
42
+ // }
43
+
9
44
  const HorizontalBarChart = memo(({ datas, config }) => {
10
45
  const [chartOptions, setChartOptions] = useState({
11
46
  chart: {
@@ -57,38 +92,23 @@ const HorizontalBarChart = memo(({ datas, config }) => {
57
92
  dataLabels: {
58
93
  enabled: true,
59
94
  useHTML: true,
60
- formatter: function () {
61
- const { unit, price } = JSON.parse(this.series.name);
62
- const textColor =
63
- this.color === '#00979D'
64
- ? this.y === 0
65
- ? '#262626'
66
- : '#FFFFFF'
67
- : '#262626';
68
- const valueStyle = `color:${textColor};font-weight:normal;font-size:12px;`;
69
- const costStyle = valueStyle + 'font-weight:bold;';
70
-
71
- let label = `<span style="${valueStyle}">` + `${this.y}${unit}`;
72
- if (price === '' || price === null || isNaN(price)) {
73
- return label + '</span>';
74
- }
75
-
76
- const formatMoney = (number) => {
77
- const formatNumber = number.toFixed();
78
- return (
79
- parseInt(formatNumber, 10)
80
- .toFixed(0)
81
- .toString()
82
- .replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1.') + 'đ'
83
- );
84
- };
85
- return (
86
- label +
87
- `/<span style="${costStyle}">` +
88
- formatMoney(this.y * price) +
89
- '</span></span>'
90
- );
91
- },
95
+ formatter: `function formatter() {
96
+ var _JSON$parse = JSON.parse(this.series.name),
97
+ unit = _JSON$parse.unit,
98
+ price = _JSON$parse.price;
99
+ var textColor = this.color === '#00979D' ? this.y === 0 ? '#262626' : '#FFFFFF' : '#262626';
100
+ var valueStyle = "color:" + textColor + ";font-weight:normal;font-size:12px;";
101
+ var costStyle = valueStyle + 'font-weight:bold;';
102
+ var label = "<span style=\\"" + valueStyle + "\\">" + ("" + this.y + unit);
103
+ if (price === '' || price === null || isNaN(price)) {
104
+ return label + '</span>';
105
+ }
106
+ var formatMoney = function formatMoney(number) {
107
+ var formatNumber = number.toFixed();
108
+ return parseInt(formatNumber, 10).toFixed(0).toString().replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '$1.') + 'đ';
109
+ };
110
+ return label + ("/<span style=\\"" + costStyle + "\\">") + formatMoney(this.y * price) + '</span></span>';
111
+ }`,
92
112
  align: 'right',
93
113
  inside: false,
94
114
  },
@@ -1,6 +1,6 @@
1
1
  import React, { memo } from 'react';
2
2
  import { TouchableWithoutFeedback, View } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import Text from '../../Text';
5
5
 
6
6
  import { Colors } from '../../../configs';
@@ -16,7 +16,7 @@ const ItemAddNew = memo(({ title, onAddNew, wrapStyle }) => {
16
16
  <View style={[styles.container, wrapStyle]}>
17
17
  <View style={styles.boxIcon}>
18
18
  <View style={styles.buttonPlus}>
19
- <AntDesign name="plus" size={22} color={Colors.Gray8} />
19
+ <IconOutline name="plus" size={22} color={Colors.Gray8} />
20
20
  </View>
21
21
  </View>
22
22
  <View>
@@ -1,7 +1,7 @@
1
1
  import React, { memo, useCallback, useMemo } from 'react';
2
2
  import { Platform, StyleSheet, TouchableOpacity, View } from 'react-native';
3
3
  import Routes from '../../utils/Route';
4
- import AntDesign from 'react-native-vector-icons/AntDesign';
4
+ import { IconOutline } from '@ant-design/icons-react-native';
5
5
  import { useNavigation } from '@react-navigation/native';
6
6
  import { useTranslations } from '../../hooks/Common/useTranslations';
7
7
  import ItemQuickAction from '../../commons/Action/ItemQuickAction';
@@ -116,7 +116,7 @@ const ItemDevice = memo(
116
116
  >
117
117
  {description || textConnected}
118
118
  </Text>
119
- <AntDesign name="right" size={12} />
119
+ <IconOutline name="right" size={12} />
120
120
  </View>
121
121
  </TouchableOpacity>
122
122
  </ItemDeviceWrapper>
@@ -1,7 +1,7 @@
1
1
  import React, { memo, useState } from 'react';
2
2
  import { View, TouchableOpacity } from 'react-native';
3
3
  import { useTranslations } from '../../../hooks/Common/useTranslations';
4
- import AntDesign from 'react-native-vector-icons/AntDesign';
4
+ import { IconOutline } from '@ant-design/icons-react-native';
5
5
  import { Slider } from '@miblanchard/react-native-slider';
6
6
 
7
7
  import Text from '../../Text';
@@ -44,7 +44,7 @@ const SonosSpeaker = memo(() => {
44
44
  </TouchableOpacity>
45
45
  <View style={styles.threeButton}>
46
46
  <TouchableOpacity style={styles.buttonLeft}>
47
- <AntDesign name={'backward'} size={35} color={Colors.Black} />
47
+ <IconOutline name={'backward'} size={35} color={Colors.Black} />
48
48
  </TouchableOpacity>
49
49
  <TouchableOpacity
50
50
  style={styles.buttonCenter}
@@ -53,7 +53,7 @@ const SonosSpeaker = memo(() => {
53
53
  {active ? <SvgButtonPauseActive /> : <SvgButtonPauseNotActive />}
54
54
  </TouchableOpacity>
55
55
  <TouchableOpacity style={styles.buttonRight}>
56
- <AntDesign name={'forward'} size={35} color={Colors.Black} />
56
+ <IconOutline name={'forward'} size={35} color={Colors.Black} />
57
57
  </TouchableOpacity>
58
58
  </View>
59
59
  </View>
@@ -1,12 +1,12 @@
1
1
  import React, { memo } from 'react';
2
2
  import { View, StyleSheet } from 'react-native';
3
3
  import Text from '../../../commons/Text';
4
- import AntDesign from 'react-native-vector-icons/AntDesign';
4
+ import { IconOutline } from '@ant-design/icons-react-native';
5
5
 
6
6
  const AlertStatusMachine = memo(({ message, style, icon }) => {
7
7
  return (
8
8
  <View style={[styles.container, style]}>
9
- <AntDesign
9
+ <IconOutline
10
10
  name={icon}
11
11
  size={20}
12
12
  color={style.borderColor}
@@ -1,6 +1,6 @@
1
1
  import React, { memo } from 'react';
2
2
  import { View, Dimensions, StyleSheet, TouchableOpacity } from 'react-native';
3
- import AntDesign from 'react-native-vector-icons/AntDesign';
3
+ import { IconOutline } from '@ant-design/icons-react-native';
4
4
  import { useNavigation } from '@react-navigation/native';
5
5
 
6
6
  import { Colors } from '../../../configs';
@@ -35,7 +35,11 @@ const QualityIndicatorItem = memo(
35
35
  onPress={() => navigation.navigate(descriptionScreen)}
36
36
  style={styles.iconInfo}
37
37
  >
38
- <AntDesign name={'info-circle'} size={18} color={Colors.Gray8} />
38
+ <IconOutline
39
+ name={'info-circle'}
40
+ size={18}
41
+ color={Colors.Gray8}
42
+ />
39
43
  </TouchableOpacity>
40
44
  )}
41
45
  </View>
@@ -3,7 +3,7 @@ import { View, TouchableOpacity } from 'react-native';
3
3
 
4
4
  import { Colors } from '../../configs';
5
5
  import Text from '../../commons/Text';
6
- import AntDesign from 'react-native-vector-icons/AntDesign';
6
+ import { IconOutline } from '@ant-design/icons-react-native';
7
7
  import styles from './styles';
8
8
  import { ModalCustom } from '../Modal';
9
9
  import Loading from '../../screens/Automate/Components/Loading';
@@ -18,7 +18,7 @@ const LoadingMessage = memo(({ visible, onClose, message }) => {
18
18
  onPress={onClose}
19
19
  >
20
20
  <Loading
21
- icon={<AntDesign name={'sync'} color={Colors.Green6} size={16} />}
21
+ icon={<IconOutline name={'sync'} color={Colors.Green6} size={16} />}
22
22
  />
23
23
  <Text type={'Body'} style={styles.text}>
24
24
  {message}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
3
  import { ButtonPopup } from '../index';
4
4
  import { useTranslations } from '../../hooks/Common/useTranslations';
5
- import AntDesign from 'react-native-vector-icons/AntDesign';
5
+ import { IconOutline } from '@ant-design/icons-react-native';
6
6
  import Text from '../Text';
7
7
  import { Colors } from '../../configs';
8
8
 
@@ -29,7 +29,7 @@ const AlertSendConfirm = ({
29
29
  bodyStyle={styles.buttonPopupBody}
30
30
  >
31
31
  <View style={styles.firstInfo}>
32
- <AntDesign name="clockcircleo" size={42} style={styles.clock} />
32
+ <IconOutline name="clock-circle" 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>
@@ -1,5 +1,5 @@
1
1
  import React, { memo, useEffect, useState } from 'react';
2
- import AntDesign from 'react-native-vector-icons/AntDesign';
2
+ import { IconOutline } from '@ant-design/icons-react-native';
3
3
  import { TouchableOpacity, View } from 'react-native';
4
4
 
5
5
  import styles from './ChooseFieldStyles';
@@ -47,7 +47,7 @@ const ChooseUserField = ({ unit, dataItem, index, setDataForm, dataForm }) => {
47
47
  onPress={setShowFilterPopup}
48
48
  >
49
49
  <Text style={styles.value}>{choose.name}</Text>
50
- <AntDesign name="right" size={20} color={Colors.Gray8} />
50
+ <IconOutline name="right" size={20} color={Colors.Gray8} />
51
51
  </TouchableOpacity>
52
52
  <ChoosePopup
53
53
  isVisible={showFilterPopup}
@@ -1,6 +1,7 @@
1
1
  import React, { memo } from 'react';
2
2
  import DraggableFlatList from 'react-native-draggable-flatlist';
3
3
 
4
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
4
5
  import styles from './styles';
5
6
 
6
7
  const FlatListDnD = memo(
@@ -23,15 +24,17 @@ const FlatListDnD = memo(
23
24
  };
24
25
 
25
26
  return (
26
- <DraggableFlatList
27
- showsVerticalScrollIndicator={showsVerticalScrollIndicator}
28
- data={data}
29
- renderItem={renderItem}
30
- keyExtractor={keyExtractor}
31
- onDragEnd={onDragEnd || handleOnDragEnd}
32
- containerStyle={styles.containerStyle}
33
- {...props}
34
- />
27
+ <GestureHandlerRootView>
28
+ <DraggableFlatList
29
+ showsVerticalScrollIndicator={showsVerticalScrollIndicator}
30
+ data={data}
31
+ renderItem={renderItem}
32
+ keyExtractor={keyExtractor}
33
+ onDragEnd={onDragEnd || handleOnDragEnd}
34
+ containerStyle={styles.containerStyle}
35
+ {...props}
36
+ />
37
+ </GestureHandlerRootView>
35
38
  );
36
39
  }
37
40
  );
@@ -3,7 +3,15 @@ import { TouchableWithoutFeedback, View } from 'react-native';
3
3
  import styles from './GridItemStyles';
4
4
 
5
5
  const GridItem = memo(
6
- ({ icon, accessibilityLabel, selected, onPress, item, children }) => {
6
+ ({
7
+ icon,
8
+ accessibilityLabel,
9
+ selected,
10
+ onPress,
11
+ item,
12
+ children,
13
+ style = {},
14
+ }) => {
7
15
  const isActive = selected && styles.active;
8
16
 
9
17
  return (
@@ -11,7 +19,7 @@ const GridItem = memo(
11
19
  onPress={() => onPress && onPress(item)}
12
20
  accessibilityLabel={accessibilityLabel}
13
21
  >
14
- <View style={[styles.container, isActive]}>{children}</View>
22
+ <View style={[styles.container, style, isActive]}>{children}</View>
15
23
  </TouchableWithoutFeedback>
16
24
  );
17
25
  }
@@ -2,7 +2,7 @@ import React, { useCallback, useRef } from 'react';
2
2
  import { View, Text, TouchableOpacity, Image } from 'react-native';
3
3
  import Images from '../../configs/Images';
4
4
  import { Colors } from '../../configs';
5
- import AntDesign from 'react-native-vector-icons/AntDesign';
5
+ import { IconOutline } from '@ant-design/icons-react-native';
6
6
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
7
7
  import { useNavigation } from '@react-navigation/native';
8
8
  import styles from './Styles/HeaderCustomStyles';
@@ -111,7 +111,7 @@ const HeaderCustom = ({
111
111
  {isShowClose && (
112
112
  <TouchableOpacity onPress={handleClose}>
113
113
  <View style={styles.buttonAdd}>
114
- <AntDesign name={'close'} size={24} color={Colors.Black} />
114
+ <IconOutline name={'close'} size={24} color={Colors.Black} />
115
115
  </View>
116
116
  </TouchableOpacity>
117
117
  )}
@@ -1,5 +1,5 @@
1
1
  import React, { memo, useCallback } from 'react';
2
- import AntDesign from 'react-native-vector-icons/AntDesign';
2
+ import { IconOutline } from '@ant-design/icons-react-native';
3
3
  import { TouchableOpacity, StyleSheet, Animated, View } from 'react-native';
4
4
  import { useNavigation } from '@react-navigation/native';
5
5
  import { getStatusBarHeight } from 'react-native-iphone-x-helper';
@@ -95,7 +95,7 @@ const HeaderAni = memo(
95
95
  accessibilityLabel={AccessibilityLabel.ICON_BACK}
96
96
  >
97
97
  <View style={styles.btnBack}>
98
- <AntDesign name={'left'} size={27} color={Colors.Gray9} />
98
+ <IconOutline name={'left'} size={27} color={Colors.Gray9} />
99
99
  </View>
100
100
  </TouchableOpacity>
101
101
  <View styles={styles.wrapRightComponent}>{rightComponent}</View>
@@ -1,4 +1,4 @@
1
- import AntDesign from 'react-native-vector-icons/AntDesign';
1
+ import { IconFill, IconOutline } from '@ant-design/icons-react-native';
2
2
  import React, { memo, useMemo } from 'react';
3
3
  import { StyleSheet } from 'react-native';
4
4
  import { Colors } from '../../configs';
@@ -30,7 +30,7 @@ const IconComponent = memo(
30
30
  } else if (newIcon.includes('TwoTone')) {
31
31
  newIcon = newIcon.substring(0, newIcon.length - 'TwoTone'.length);
32
32
  }
33
- newIcon = newIcon.replace(/[A-Z]/g, (m) => m.toLowerCase());
33
+ newIcon = newIcon.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());
34
34
  }
35
35
  return newIcon;
36
36
  }, [icon]);
@@ -62,7 +62,7 @@ const IconComponent = memo(
62
62
  );
63
63
  } else if (icon.includes('Filled')) {
64
64
  return (
65
- <AntDesign
65
+ <IconFill
66
66
  name={displayIcon}
67
67
  color={colorIcon}
68
68
  size={size}
@@ -76,7 +76,7 @@ const IconComponent = memo(
76
76
  ? 'poweroff'
77
77
  : displayIcon;
78
78
  return (
79
- <AntDesign
79
+ <IconOutline
80
80
  name={iconCT}
81
81
  color={colorIcon}
82
82
  size={size}