@eohjsc/react-native-smart-city 0.3.8 → 0.3.9

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 (287) hide show
  1. package/README.md +36 -15
  2. package/package.json +10 -6
  3. package/react-native-smart-city.podspec +1 -0
  4. package/src/commons/Action/ItemQuickAction.js +16 -4
  5. package/src/commons/Action/__test__/ItemQuickAction.test.js +11 -6
  6. package/src/commons/ActionGroup/ColorPickerTemplate.js +37 -24
  7. package/src/commons/ActionGroup/CurtainButtonTemplate.js +10 -5
  8. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +4 -0
  9. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
  10. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +24 -0
  11. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +14 -0
  12. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +1 -0
  13. package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +8 -2
  14. package/src/commons/ActionGroup/SliderRangeTemplate.js +6 -2
  15. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +7 -3
  16. package/src/commons/ActionGroup/StatesGridActionTemplate.js +22 -8
  17. package/src/commons/ActionGroup/TimerActionTemplate.js +11 -3
  18. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +1 -5
  19. package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +53 -4
  20. package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +14 -14
  21. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +53 -78
  22. package/src/commons/ActionGroup/__test__/OneBigButtonTemplate.test.js +36 -20
  23. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +77 -0
  24. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +58 -6
  25. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +49 -1
  26. package/src/commons/ActionGroup/__test__/index.test.js +135 -0
  27. package/src/commons/Auth/AccountList.js +1 -1
  28. package/src/commons/Automate/ItemAutomate.js +1 -3
  29. package/src/commons/Calendar/__test__/Calendar.test.js +33 -0
  30. package/src/commons/Connecting/__test__/Connecting.test.js +19 -2
  31. package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +7 -3
  32. package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +8 -11
  33. package/src/commons/ConnectingProcess/__test__/Connecting.test.js +136 -3
  34. package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +3 -2
  35. package/src/commons/ConnectingProcess/index.js +76 -26
  36. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +16 -13
  37. package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +1 -1
  38. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +0 -5
  39. package/src/commons/Device/ConnectedViewHeader.js +1 -1
  40. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +58 -0
  41. package/src/commons/Device/HistoryChart.js +7 -3
  42. package/src/commons/Device/ItemDevice.js +34 -13
  43. package/src/commons/Device/LinearChart.js +15 -0
  44. package/src/commons/Device/PMSensor/PMSensorIndicatior.js +16 -12
  45. package/src/commons/Device/PMSensor/PMSensorIndicatorStyles.js +3 -0
  46. package/src/commons/Device/SonosSpeaker/index.js +1 -1
  47. package/src/commons/Device/WaterQualitySensor/ListQualityIndicator.js +1 -0
  48. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +7 -2
  49. package/src/commons/Explore/__test__/CityItem.test.js +33 -54
  50. package/src/commons/FieldTemplate/ChooseUserField/ChooseFieldStyles.js +25 -0
  51. package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +96 -0
  52. package/src/commons/FieldTemplate/ChooseUserField/ChoosePopupStyles.js +39 -0
  53. package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +118 -0
  54. package/src/commons/FieldTemplate/ChooseUserField/index.js +62 -0
  55. package/src/commons/FieldTemplate/PasscodeField/PasscodeFieldStyles.js +30 -0
  56. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +90 -0
  57. package/src/commons/FieldTemplate/PasscodeField/index.js +43 -0
  58. package/src/commons/FieldTemplate/ScheduleField/ScheduleFieldStyles.js +13 -0
  59. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +179 -0
  60. package/src/commons/FieldTemplate/ScheduleField/index.js +176 -0
  61. package/src/commons/Form/CurrencyInput.js +15 -1
  62. package/src/commons/Form/TextInputPassword.js +1 -1
  63. package/src/commons/FullLoading/index.js +2 -1
  64. package/src/commons/Header/HeaderCustom.js +2 -1
  65. package/src/commons/HeaderAni/index.js +6 -1
  66. package/src/commons/HorizontalPicker/index.js +2 -2
  67. package/src/commons/MediaPlayerDetail/Styles/MediaPlayerDetailStyles.js +0 -6
  68. package/src/commons/MediaPlayerDetail/index.js +26 -47
  69. package/src/commons/MenuActionAddnew/index.js +1 -0
  70. package/src/commons/MenuActionList/index.js +1 -0
  71. package/src/commons/MenuActionMore/index.js +1 -1
  72. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +62 -0
  73. package/src/commons/PreventAccess/index.js +9 -1
  74. package/src/commons/Sharing/MemberList.js +10 -2
  75. package/src/commons/Sharing/WrapHeaderScrollable.js +2 -0
  76. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +0 -1
  77. package/src/commons/SubUnit/Favorites/index.js +2 -3
  78. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +8 -35
  79. package/src/commons/SubUnit/OneTap/index.js +1 -2
  80. package/src/commons/SubUnit/ShortDetail.js +25 -9
  81. package/src/commons/SubUnit/__test__/Item.test.js +0 -1
  82. package/src/commons/SubUnit/__test__/ShortDetail.test.js +9 -2
  83. package/src/commons/Unit/SharedUnit.js +1 -0
  84. package/src/commons/Unit/__test__/SharedUnit.test.js +38 -183
  85. package/src/commons/UnitSummary/ConfigHistoryChart/index.js +2 -13
  86. package/src/commons/UnitSummary/ConfigHistoryChart.js +22 -13
  87. package/src/commons/WheelDateTimePicker/index.js +4 -3
  88. package/src/configs/API.js +87 -143
  89. package/src/configs/Constants.js +61 -1
  90. package/src/configs/SCConfig.js +4 -0
  91. package/src/context/actionType.ts +10 -0
  92. package/src/context/mockStore.ts +11 -0
  93. package/src/context/reducer.ts +51 -2
  94. package/src/hooks/Common/index.js +2 -0
  95. package/src/hooks/Common/useGGHomeDeviceConnected.js +16 -0
  96. package/src/hooks/Common/useGetIdUser.js +1 -5
  97. package/src/hooks/Common/useSensorsStatus.js +4 -4
  98. package/src/hooks/IoT/__test__/useGGHomeConnection.test.js +199 -0
  99. package/src/hooks/IoT/__test__/useRemoteControl.test.js +198 -0
  100. package/src/hooks/IoT/index.js +4 -0
  101. package/src/hooks/IoT/useGGHomeConnection.js +93 -0
  102. package/src/hooks/IoT/useRemoteControl.js +79 -0
  103. package/src/hooks/index.js +4 -0
  104. package/src/hooks/useReceiveNotifications.js +9 -5
  105. package/src/iot/Monitor.js +3 -2
  106. package/src/iot/RemoteControl/Bluetooth.js +1 -1
  107. package/src/iot/RemoteControl/GoogleHome.js +75 -49
  108. package/src/iot/RemoteControl/Internet.js +1 -1
  109. package/src/iot/RemoteControl/__test__/GoogleHome.test.js +95 -48
  110. package/src/iot/RemoteControl/__test__/Internet.test.js +18 -7
  111. package/src/iot/RemoteControl/__test__/LgThinq.test.js +36 -177
  112. package/src/iot/RemoteControl/index.js +52 -52
  113. package/src/navigations/UnitStack.js +11 -20
  114. package/src/navigations/UnitStackStyles.js +21 -0
  115. package/src/screens/AQIGuide/index.js +1 -1
  116. package/src/screens/ActivityLog/FilterPopup.js +2 -0
  117. package/src/screens/ActivityLog/__test__/index.test.js +38 -23
  118. package/src/screens/ActivityLog/hooks/__test__/index.test.js +51 -90
  119. package/src/screens/ActivityLog/hooks/index.js +1 -1
  120. package/src/screens/ActivityLog/index.js +2 -2
  121. package/src/screens/AddCommon/SelectSubUnit.js +1 -0
  122. package/src/screens/AddCommon/SelectUnit.js +1 -0
  123. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +13 -24
  124. package/src/screens/AddCommon/__test__/SelectUnit.test.js +9 -33
  125. package/src/screens/AddLocationMaps/index.js +9 -5
  126. package/src/screens/AddNewAction/SelectAction.js +8 -8
  127. package/src/screens/AddNewAction/SelectSensorDevices.js +8 -2
  128. package/src/screens/AddNewAction/SetupSensor.js +7 -7
  129. package/src/screens/AddNewAction/__test__/SelectAction.test.js +10 -91
  130. package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +40 -26
  131. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +3 -1
  132. package/src/screens/AddNewAutoSmart/index.js +5 -2
  133. package/src/screens/AddNewDevice/ConnectingDevices.js +3 -3
  134. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +42 -34
  135. package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -4
  136. package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +22 -22
  137. package/src/screens/AddNewDevice/hooks/ConnectDevices.js +1 -1
  138. package/src/screens/AddNewDevice/index.js +1 -0
  139. package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +23 -17
  140. package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +46 -40
  141. package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +64 -10
  142. package/src/screens/AddNewGateway/SelectGateway.js +1 -0
  143. package/src/screens/AddNewGateway/SetupGatewayWifi.js +2 -0
  144. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +4 -6
  145. package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -4
  146. package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +5 -29
  147. package/src/screens/AddNewGateway/__test__/SelectGateway.test.js +0 -4
  148. package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -4
  149. package/src/screens/AddNewGateway/index.js +1 -0
  150. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +10 -24
  151. package/src/screens/AddNewOneTap/index.js +3 -2
  152. package/src/screens/AllCamera/index.js +4 -4
  153. package/src/screens/Automate/MultiUnits.js +8 -8
  154. package/src/screens/Automate/__test__/MultiUnits.test.js +6 -9
  155. package/src/screens/Automate/__test__/index.test.js +7 -12
  156. package/src/screens/Automate/index.js +5 -3
  157. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +36 -8
  158. package/src/screens/ConfirmUnitDeletion/index.js +7 -1
  159. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +71 -22
  160. package/src/screens/Device/EditDevice/index.js +17 -15
  161. package/src/screens/Device/__test__/detail.test.js +33 -86
  162. package/src/screens/Device/components/DetailHistoryChart.js +1 -1
  163. package/src/screens/Device/components/SensorConnectStatusViewHeader.js +44 -24
  164. package/src/screens/Device/components/SensorDisplayItem.js +5 -2
  165. package/src/screens/Device/detail.js +85 -26
  166. package/src/screens/Device/hooks/useDisconnectedDevice.js +4 -4
  167. package/src/screens/Device/hooks/useFavoriteDevice.js +5 -9
  168. package/src/screens/DeviceInfo/__test__/index.test.js +0 -2
  169. package/src/screens/EditActionsList/index.js +1 -1
  170. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +6 -3
  171. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +7 -19
  172. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +20 -2
  173. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +40 -23
  174. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  175. package/src/screens/EmergencySetting/index.js +4 -1
  176. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +41 -25
  177. package/src/screens/Explore/index.js +2 -0
  178. package/src/screens/GuestInfo/__test__/index.test.js +14 -41
  179. package/src/screens/GuestInfo/components/RecurringDetail.js +1 -0
  180. package/src/screens/GuestInfo/components/TemporaryDetail.js +2 -2
  181. package/src/screens/HanetCamera/Detail.js +1 -1
  182. package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +8 -12
  183. package/src/screens/HanetCamera/__test__/Detail.test.js +27 -42
  184. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +8 -5
  185. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +10 -32
  186. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +3 -2
  187. package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +43 -35
  188. package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +10 -21
  189. package/src/screens/HanetCamera/hooks/useHanetCheckinData.js +11 -11
  190. package/src/screens/HanetCamera/hooks/useHanetPlaceMembers.js +11 -11
  191. package/src/screens/ManageAccess/__test__/ManageAccess.test.js +33 -22
  192. package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +44 -45
  193. package/src/screens/ManageAccess/hooks/index.js +7 -4
  194. package/src/screens/ManageAccess/index.js +2 -1
  195. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +35 -12
  196. package/src/screens/MoveToAnotherSubUnit/index.js +6 -6
  197. package/src/screens/Notification/__test__/Notification.test.js +14 -25
  198. package/src/screens/Notification/__test__/NotificationItem.test.js +8 -7
  199. package/src/screens/Notification/components/NotificationItem.js +17 -20
  200. package/src/screens/Notification/index.js +9 -2
  201. package/src/screens/PlayBackCamera/Timer.js +2 -2
  202. package/src/screens/PlayBackCamera/__test__/index.test.js +87 -2
  203. package/src/screens/PlayBackCamera/index.js +54 -35
  204. package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +7 -20
  205. package/src/screens/ScanChipQR/components/QRScan/index.js +1 -0
  206. package/src/screens/ScanChipQR/hooks/index.js +15 -16
  207. package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +8 -24
  208. package/src/screens/ScriptDetail/__test__/index.test.js +17 -86
  209. package/src/screens/ScriptDetail/index.js +19 -14
  210. package/src/screens/SelectUnit/__test__/index.test.js +12 -55
  211. package/src/screens/SelectUnit/index.js +9 -4
  212. package/src/screens/SetSchedule/index.js +15 -11
  213. package/src/screens/SharedUnit/__test__/TabHeader.test.js +0 -2
  214. package/src/screens/SharedUnit/index.js +2 -0
  215. package/src/screens/Sharing/Components/SensorItem.js +10 -12
  216. package/src/screens/Sharing/InfoMemberUnit.js +1 -1
  217. package/src/screens/Sharing/MemberList.js +12 -11
  218. package/src/screens/Sharing/SelectPermission.js +121 -76
  219. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +47 -29
  220. package/src/screens/Sharing/__test__/MemberList.test.js +13 -127
  221. package/src/screens/Sharing/__test__/MemberList2.test.js +80 -0
  222. package/src/screens/Sharing/__test__/SelectPermission.test.js +28 -38
  223. package/src/screens/Sharing/__test__/SelectUser.test.js +17 -38
  224. package/src/screens/Sharing/hooks/index.js +3 -0
  225. package/src/screens/SideMenuDetail/SideMenuDetailStyles.js +28 -0
  226. package/src/screens/SideMenuDetail/__test__/index.test.js +154 -0
  227. package/src/screens/SideMenuDetail/index.js +148 -0
  228. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +3 -2
  229. package/src/screens/SmartIr/components/SelectBrand.js +1 -1
  230. package/src/screens/SubUnit/AddSubUnit.js +23 -17
  231. package/src/screens/SubUnit/Detail.js +1 -2
  232. package/src/screens/SubUnit/EditSubUnit.js +15 -13
  233. package/src/screens/SubUnit/ManageSubUnit.js +13 -7
  234. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +29 -89
  235. package/src/screens/SubUnit/__test__/Detail.test.js +31 -8
  236. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +21 -89
  237. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +27 -1
  238. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +48 -45
  239. package/src/screens/SubUnit/hooks/useManageSubUnit.js +7 -7
  240. package/src/screens/SyncLGDevice/AddLGDevice.js +1 -0
  241. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +22 -91
  242. package/src/screens/TDSGuide/index.js +4 -1
  243. package/src/screens/UVIndexGuide/index.js +1 -1
  244. package/src/screens/Unit/ChooseLocation.js +7 -14
  245. package/src/screens/Unit/Detail.js +31 -75
  246. package/src/screens/Unit/ManageUnit.js +1 -0
  247. package/src/screens/Unit/SelectAddress.js +45 -23
  248. package/src/screens/Unit/SmartAccount.js +4 -4
  249. package/src/screens/Unit/Station/index.js +4 -0
  250. package/src/screens/Unit/Summaries.js +18 -2
  251. package/src/screens/Unit/__test__/CheckSendEmail.test.js +24 -29
  252. package/src/screens/Unit/__test__/ChooseLocation.test.js +27 -14
  253. package/src/screens/Unit/__test__/Detail.test.js +98 -199
  254. package/src/screens/Unit/__test__/ManageUnit.test.js +18 -42
  255. package/src/screens/Unit/__test__/SelectAddress.test.js +159 -49
  256. package/src/screens/Unit/__test__/SmartAccount.test.js +17 -9
  257. package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -1
  258. package/src/screens/Unit/__test__/Summaries.test.js +100 -0
  259. package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +36 -0
  260. package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +54 -0
  261. package/src/screens/Unit/components/MyUnitDevice/index.js +4 -4
  262. package/src/screens/Unit/components/SharedUnit/index.js +1 -0
  263. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
  264. package/src/screens/Unit/components/__test__/SharedUnit.test.js +31 -34
  265. package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +50 -0
  266. package/src/screens/Unit/styles.js +4 -0
  267. package/src/screens/UnitSummary/__test__/index.test.js +91 -30
  268. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +31 -2
  269. package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +7 -4
  270. package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +2 -13
  271. package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +0 -1
  272. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +14 -16
  273. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +11 -2
  274. package/src/screens/UnitSummary/components/RunningDevices/index.js +7 -10
  275. package/src/screens/UnitSummary/components/Temperature/index.js +4 -4
  276. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +10 -2
  277. package/src/screens/UnitSummary/index.js +15 -1
  278. package/src/screens/WaterQualityGuide/index.js +1 -1
  279. package/src/utils/Apis/axios.js +54 -31
  280. package/src/utils/Converter/time.js +0 -18
  281. package/src/utils/I18n/translations/en.json +7 -1
  282. package/src/utils/I18n/translations/vi.json +8 -1
  283. package/src/utils/Permission/common.js +67 -0
  284. package/src/utils/Route/index.js +1 -0
  285. package/src/utils/Setting/Location.js +30 -0
  286. package/src/utils/Utils.js +11 -7
  287. package/src/utils/__test__/Utils.test.js +12 -0
package/README.md CHANGED
@@ -1,19 +1,26 @@
1
1
  ## react-native-smart-city
2
2
 
3
3
  ## Getting started
4
+
4
5
  1. Install package dependencies:
5
- - Using [Yarn](https://yarnpkg.com/): `yarn add react-native-reanimated@^1.10.1`
6
+
7
+ - Using [Yarn](https://yarnpkg.com/): `yarn add react-native-reanimated@^1.10.1`
6
8
 
7
9
  2. Install:
8
- - Using [npm](https://www.npmjs.com/#getting-started): `npm install @eohjsc/react-native-smart-city --save`
9
- - Using [Yarn](https://yarnpkg.com/): `yarn add @eohjsc/react-native-smart-city`
10
+
11
+ - Using [npm](https://www.npmjs.com/#getting-started): `npm install @eohjsc/react-native-smart-city --save`
12
+ - Using [Yarn](https://yarnpkg.com/): `yarn add @eohjsc/react-native-smart-city`
10
13
 
11
14
  3. Compile application using react-native run-android
15
+
12
16
  ### Mostly automatic installation
17
+
13
18
  `$ react-native link @eohjsc/react-native-smart-city`
14
19
 
15
20
  ## Usage
21
+
16
22
  1. StackNavigator
23
+
17
24
  ```javascript
18
25
  import {
19
26
  UnitStack,
@@ -30,7 +37,7 @@ import {
30
37
  } from '@eohjsc/react-native-smart-city';
31
38
  import { createStackNavigator } from '@react-navigation/stack';
32
39
 
33
- // TODO: What to do with the module?
40
+ // TODO: What to do with the module?
34
41
  const Stack = createStackNavigator();
35
42
 
36
43
  const YourStack = () => {
@@ -84,7 +91,9 @@ const MainTab = () => {
84
91
  );
85
92
  };
86
93
  ```
94
+
87
95
  2. Use components
96
+
88
97
  ```javascript
89
98
  import React from 'react';
90
99
  import { View } from 'react-native';
@@ -93,13 +102,15 @@ import { MyPinnedSharedUnit, MyUnit } from '@eohjsc/react-native-smart-city';
93
102
  const MyScreen = () => {
94
103
  return (
95
104
  <View>
96
- <MyUnit />
97
- <MyPinnedSharedUnit />
105
+ <MyUnit />
106
+ <MyPinnedSharedUnit />
98
107
  </View>
99
108
  );
100
109
  };
101
110
  ```
111
+
102
112
  3. Trigger quick action
113
+
103
114
  ```javascript
104
115
  import React from 'react';
105
116
  import { View, Button } from 'react-native';
@@ -126,23 +137,33 @@ export const MyFunctionalComponent = () => {
126
137
  lg_actions: [],
127
138
  name: 'Garage Up',
128
139
  };
129
- const handleQuickAction = async() => {
140
+ const handleQuickAction = async () => {
130
141
  const result = await sendRemoteCommand(sensor, action); // Action Garage Up
131
- if (result){
132
- console.log('Successful control')
133
- }else {
134
- console.log('Control failed')
142
+ if (result) {
143
+ console.log('Successful control');
144
+ } else {
145
+ console.log('Control failed');
135
146
  }
136
147
  };
137
148
  return (
138
149
  <View>
139
- <Button onPress={handleQuickAction} title="Example trigger quick action control Garage Up" />
150
+ <Button
151
+ onPress={handleQuickAction}
152
+ title="Example trigger quick action control Garage Up"
153
+ />
140
154
  </View>
141
155
  );
142
156
  };
143
157
  ```
144
- - sendRemoteCommand user needs to `have permission to control the device`, you pass in the `sensor and action` to it and it will run after calling render.
145
- - `sensor` is a device in your Unit and action is the `action` key of the device..
158
+
159
+ - sendRemoteCommand user needs to `have permission to control the device`, you pass in the `sensor and action` to it and it will run after calling render.
160
+ - `sensor` is a device in your Unit and action is the `action` key of the device..
146
161
  - You can take out the sensor and action from your Unit when calling the `API.UNIT.UNIT_DETAIL(unitId)` it will return all devices in 1 unit.
147
- - Or get sensor from `API.SENSOR.DISPLAY(sensor.id)` returns all actions of 1 device.
162
+ - Or get sensor from `API.DEVICE.DISPLAY(sensor.id)` returns all actions of 1 device.
148
163
  - Refer YourProjectPath /node_modules/@eohjsc/react-native-smart-city/src/screens/Unit/Detail.js
164
+
165
+ ## Sync file to EoH source
166
+
167
+ ```
168
+ yarn install && yarn watch
169
+ ```
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.3.08",
4
+ "version": "0.3.09",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -18,7 +18,7 @@
18
18
  "ios": "react-native run-ios",
19
19
  "start": "react-native start",
20
20
  "test": "yarn run lint && yarn run jest",
21
- "lint": "eslint . --ext js --ext ts --ext tsx",
21
+ "lint": "eslint . --ext js --ext ts --ext tsx --max-warnings 5",
22
22
  "lint-fix": "eslint . --fix",
23
23
  "type-check": "npx tsc",
24
24
  "pod": "cd ios && pod install",
@@ -74,6 +74,7 @@
74
74
  "@types/react": "^17.0.0",
75
75
  "@types/react-native": "^0.63.43",
76
76
  "@types/react-test-renderer": "^17.0.0",
77
+ "axios-mock-adapter": "^1.21.1",
77
78
  "babel-jest": "^26.6.3",
78
79
  "detox": "^18.3.1",
79
80
  "eslint": "7.14.0",
@@ -99,7 +100,7 @@
99
100
  "@ant-design/icons-react-native": "^2.2.1",
100
101
  "@ant-design/react-native": "^4.0.5",
101
102
  "@babel/helper-environment-visitor": "^7.16.7",
102
- "@eohjsc/highcharts": "^1.0.8",
103
+ "@eohjsc/highcharts": "^1.0.9",
103
104
  "@eohjsc/react-native-keyboard-aware-scroll-view": "^0.9.5",
104
105
  "@formatjs/intl-getcanonicallocales": "^1.4.5",
105
106
  "@formatjs/intl-numberformat": "^5.6.2",
@@ -124,6 +125,7 @@
124
125
  "@react-navigation/stack": "^5.7.0",
125
126
  "@sentry/react-native": "^1.7.1",
126
127
  "@testing-library/react-hooks": "^6.0.0",
128
+ "apisauce": "^2.1.5",
127
129
  "axios": "^0.19.2",
128
130
  "dotenv": "^8.2.0",
129
131
  "google-libphonenumber": "^3.2.10",
@@ -144,6 +146,8 @@
144
146
  "react-hooks-global-state": "^1.0.1",
145
147
  "react-i18next": "^11.8.12",
146
148
  "react-native-alert-async": "^1.0.5",
149
+ "react-native-android-keyboard-adjust": "^1.2.0",
150
+ "react-native-android-location-enabler": "^1.2.2",
147
151
  "react-native-android-wifi": "^0.0.41",
148
152
  "react-native-appearance": "^0.3.4",
149
153
  "react-native-base64": "^0.1.0",
@@ -174,7 +178,7 @@
174
178
  "react-native-pager-view": "^5.4.1",
175
179
  "react-native-parallax-scroll-view": "^0.21.3",
176
180
  "react-native-parsed-text": "^0.0.22",
177
- "react-native-permissions": "^2.1.5",
181
+ "react-native-permissions": "3.0.3",
178
182
  "react-native-popover-view": "^4.0.3",
179
183
  "react-native-progress": "^5.0.0",
180
184
  "react-native-reanimated": "1.10.1",
@@ -189,8 +193,8 @@
189
193
  "react-native-udp": "^4.1.3",
190
194
  "react-native-unimodules": "^0.11.0",
191
195
  "react-native-version-check": "^3.4.2",
192
- "react-native-vlc-media-player": "^1.0.39",
193
- "react-native-webview": "^10.9.3",
196
+ "react-native-vlc-media-player": "^1.0.41",
197
+ "react-native-webview": "11.17.2",
194
198
  "react-native-wheel-color-picker": "^1.2.0",
195
199
  "react-native-wheel-scrollview-picker": "^1.2.2",
196
200
  "react-native-wifi-reborn": "^4.5.0",
@@ -22,6 +22,7 @@ Pod::Spec.new do |s|
22
22
  s.requires_arc = true
23
23
 
24
24
  s.dependency "React"
25
+ s.dependency "RNPermissions"
25
26
  # ...
26
27
  # s.dependency "..."
27
28
  end
@@ -3,7 +3,7 @@ import { TouchableOpacity, View } from 'react-native';
3
3
  import { TESTID } from '../../configs/Constants';
4
4
  import { useSCContextSelector } from '../../context';
5
5
  import { watchMultiConfigs } from '../../iot/Monitor';
6
- import { sendRemoteCommand } from '../../iot/RemoteControl';
6
+ import { useRemoteControl } from '../../hooks/IoT';
7
7
  import { useConfigGlobalState } from '../../iot/states';
8
8
  import IconComponent from '../IconComponent';
9
9
 
@@ -13,6 +13,8 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus, unit }) => {
13
13
  // eslint-disable-next-line no-unused-vars
14
14
  const [configValues, _] = useConfigGlobalState('configValues');
15
15
 
16
+ const sendRemoteCommand = useRemoteControl();
17
+
16
18
  const revertActionUpdate = useCallback(
17
19
  (value, on_action, on_status, off_action, off_status) => {
18
20
  setIsSendingCommand(false);
@@ -43,8 +45,9 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus, unit }) => {
43
45
  useEffect(() => {
44
46
  sensor.quick_action &&
45
47
  sensor.quick_action.config_id &&
48
+ sensor.device_type !== 'GOOGLE_HOME' &&
46
49
  watchMultiConfigs([sensor.quick_action.config_id]);
47
- }, [sensor.quick_action]);
50
+ }, [sensor.quick_action, sensor?.device_type]);
48
51
 
49
52
  useEffect(() => {
50
53
  if (!sensor.quick_action) {
@@ -59,7 +62,9 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus, unit }) => {
59
62
  const userId = useSCContextSelector((state) => state?.auth.account.user.id);
60
63
  const onActionPress = useCallback(() => {
61
64
  sendRemoteCommand(sensor, action, null, userId);
62
- sensor.quick_action && watchMultiConfigs([sensor.quick_action.config_id]);
65
+ sensor.quick_action &&
66
+ sensor.device_type !== 'GOOGLE_HOME' &&
67
+ watchMultiConfigs([sensor.quick_action.config_id]);
63
68
  setIsSendingCommand(true);
64
69
 
65
70
  if (!sensor.quick_action) {
@@ -78,7 +83,14 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus, unit }) => {
78
83
  statusCallback(action.id === sensor.quick_action.on_action.id);
79
84
  }, sensor.quick_action.interval);
80
85
  }
81
- }, [sensor, action, userId, revertActionUpdate, statusCallback]);
86
+ }, [
87
+ sensor,
88
+ action,
89
+ userId,
90
+ revertActionUpdate,
91
+ statusCallback,
92
+ sendRemoteCommand,
93
+ ]);
82
94
 
83
95
  if (!action) {
84
96
  return <View />;
@@ -5,7 +5,6 @@ import ItemQuickAction from '../ItemQuickAction';
5
5
  import { Colors } from '../../../configs';
6
6
  import { TESTID } from '../../../configs/Constants';
7
7
  import { factory } from 'factory-girl';
8
- import { sendRemoteCommand } from '../../../iot/RemoteControl';
9
8
 
10
9
  class Sensor {}
11
10
 
@@ -21,7 +20,13 @@ jest.mock('react', () => {
21
20
 
22
21
  useState.mockImplementation((init) => [init, mockSetState]);
23
22
 
24
- jest.mock('../../../iot/RemoteControl');
23
+ const mockSendRemoteControl = jest.fn();
24
+ jest.mock('../../../hooks/IoT', () => {
25
+ return {
26
+ ...jest.requireActual('../../../hooks/IoT'),
27
+ useRemoteControl: () => mockSendRemoteControl,
28
+ };
29
+ });
25
30
 
26
31
  jest.mock('../../../iot/states', () => ({
27
32
  useConfigGlobalState: () => [{}, null],
@@ -83,9 +88,9 @@ describe('Test ItemQuickAction', () => {
83
88
  };
84
89
 
85
90
  test('render with no action', async () => {
86
- const sensor = await factory.build('Sensor');
91
+ const newSensor = await factory.build('Sensor');
87
92
  act(() => {
88
- tree = create(<ItemQuickAction sensor={sensor} />);
93
+ tree = create(<ItemQuickAction sensor={newSensor} />);
89
94
  });
90
95
  const instance = tree.root;
91
96
  const buttonOnActionPress = instance.findAll(
@@ -121,7 +126,7 @@ describe('Test ItemQuickAction', () => {
121
126
  act(() => {
122
127
  buttonOnActionPress.props.onPress();
123
128
  });
124
- expect(sendRemoteCommand).toBeCalled();
129
+ expect(mockSendRemoteControl).toBeCalled();
125
130
  expect(mockSetState).toBeCalledTimes(1);
126
131
 
127
132
  jest.runAllTimers();
@@ -154,7 +159,7 @@ describe('Test ItemQuickAction', () => {
154
159
  act(() => {
155
160
  buttonOnActionPress.props.onPress();
156
161
  });
157
- expect(sendRemoteCommand).toBeCalled();
162
+ expect(mockSendRemoteControl).toBeCalled();
158
163
  expect(mockSetState).toBeCalledTimes(1);
159
164
 
160
165
  jest.runAllTimers();
@@ -1,54 +1,67 @@
1
- import React, { memo, useCallback, useState, useEffect, useMemo } from 'react';
1
+ import React, { memo, useState, useEffect } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import styles from './ColorPickerTemplateStyles';
4
4
  import ColorPicker from 'react-native-wheel-color-picker';
5
5
  import { watchMultiConfigs } from '../../iot/Monitor';
6
6
  import { useConfigGlobalState } from '../../iot/states';
7
7
 
8
+ let isFirstTime = true;
9
+
10
+ const WheelColorPicker = ({ valueColor, onChangeColor }) => {
11
+ return (
12
+ <ColorPicker
13
+ style={styles.colorPicker}
14
+ sliderHidden={true}
15
+ swatches={false}
16
+ color={valueColor}
17
+ onColorChangeComplete={onChangeColor}
18
+ thumbSize={16}
19
+ />
20
+ );
21
+ };
22
+
8
23
  const ColorPickerTemplate = memo(({ actionGroup, doAction, sensor }) => {
9
24
  const { configuration } = actionGroup;
10
25
  const [valueColorComplete, setValueColorComplete] = useState('');
11
- const [isFirstColor, setIsFirstColor] = useState(false);
12
26
  const [configValues] = useConfigGlobalState('configValues');
13
27
 
14
- const onChangeColor = useCallback(
15
- (color) => {
16
- if (!isFirstColor) {
17
- setIsFirstColor(true);
18
- return;
19
- }
28
+ const onChangeColor = (color) => {
29
+ const to = setTimeout(() => {
30
+ isFirstTime = false;
31
+ clearTimeout(to);
32
+ }, 1000);
33
+
34
+ !isFirstTime &&
20
35
  doAction(
21
36
  configuration?.action_color_data,
22
37
  JSON.stringify({ value: color })
23
38
  );
24
- },
25
- [configuration?.action_color_data, doAction, isFirstColor]
26
- );
27
- const valueColor = useMemo(() => {
28
- return valueColorComplete || '';
29
- }, [valueColorComplete]);
39
+ };
30
40
 
31
41
  useEffect(() => {
32
42
  const { config } = configuration;
33
43
  const configValue = configValues[config];
34
- setValueColorComplete(configValue);
35
- }, [configuration.config, configValues, configuration]);
44
+ if (configValue && isFirstTime) {
45
+ setValueColorComplete(`#${configValue?.toString(16)}`);
46
+ }
47
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48
+ }, [configValues]);
36
49
 
37
50
  useEffect(() => {
38
- if (sensor?.is_managed_by_backend) {
51
+ if (sensor?.is_managed_by_backend && sensor.device_type !== 'GOOGLE_HOME') {
39
52
  watchMultiConfigs([configuration.config]);
40
53
  }
41
54
  }, [sensor, configuration.config]);
42
55
 
56
+ useEffect(() => {
57
+ return () => (isFirstTime = true);
58
+ }, []);
59
+
43
60
  return (
44
61
  <View style={styles.viewPickColor}>
45
- <ColorPicker
46
- style={styles.colorPicker}
47
- sliderHidden={true}
48
- swatches={false}
49
- color={valueColor}
50
- onColorChangeComplete={onChangeColor}
51
- thumbSize={16}
62
+ <WheelColorPicker
63
+ valueColor={valueColorComplete}
64
+ onChangeColor={onChangeColor}
52
65
  />
53
66
  </View>
54
67
  );
@@ -17,6 +17,11 @@ const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
17
17
  close_action_data,
18
18
  action_off_data,
19
19
  action_on_data,
20
+ is_display_lock,
21
+ text1,
22
+ text2,
23
+ text3,
24
+ text_door_lock,
20
25
  } = configuration || {};
21
26
  const [lock, setLock] = useState(false);
22
27
 
@@ -52,21 +57,21 @@ const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
52
57
  {
53
58
  style: styles.buttonActionCurtain,
54
59
  icon: Images.buttonLeftCurtain,
55
- text: configuration.text1,
60
+ text: text1,
56
61
  onPress: onButtonOpenPress,
57
62
  testID: TESTID.BUTTON_TEMPLATE_1,
58
63
  },
59
64
  {
60
65
  style: styles.buttonActionCurtainCenter,
61
66
  icon: Images.buttonPauseCurtain,
62
- text: configuration.text2,
67
+ text: text2,
63
68
  onPress: onButtonStopPress,
64
69
  testID: TESTID.BUTTON_TEMPLATE_2,
65
70
  },
66
71
  {
67
72
  style: styles.buttonActionCurtain,
68
73
  icon: Images.buttonRightCurtain,
69
- text: configuration.text3,
74
+ text: text3,
70
75
  onPress: onButtonClosePress,
71
76
  testID: TESTID.BUTTON_TEMPLATE_3,
72
77
  },
@@ -96,7 +101,7 @@ const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
96
101
  style={styles.textLockDoor}
97
102
  testID={TESTID.TEXT_DOOR_LOOK_ON_OFF}
98
103
  >
99
- {configuration.text_door_lock}{' '}
104
+ {text_door_lock}{' '}
100
105
  </Text>
101
106
  </View>
102
107
  <Switch
@@ -115,7 +120,7 @@ const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
115
120
  <RenderThreeButtonActions />
116
121
  </View>
117
122
  <View style={styles.lockSwitch}>
118
- {configuration.is_display_lock &&
123
+ {is_display_lock &&
119
124
  itemLock(
120
125
  lock ? 'lock' : 'unlock',
121
126
  lock ? Colors.Primary : Colors.Gray6
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { act, create } from 'react-test-renderer';
3
+ import { Switch } from 'react-native';
3
4
 
4
5
  import AutoLock from '../index';
5
6
  import { mockSCStore } from '../../../../../context/mockStore';
@@ -38,6 +39,9 @@ describe('Test AutoLock', () => {
38
39
  });
39
40
 
40
41
  const instance = tree.root;
42
+ const switchs = instance.findByType(Switch);
43
+ await switchs.props.onValueChange();
44
+
41
45
  const { buttonEnable, buttonInstant, buttonRelockTiming } =
42
46
  getElement(instance);
43
47
 
@@ -19,7 +19,7 @@ const ButtonWrapper = ({ item, textHeadline }) => {
19
19
  };
20
20
 
21
21
  const ItemPasscode = memo(({ route }) => {
22
- const { item } = route.params;
22
+ const { item = {} } = route.params || {};
23
23
 
24
24
  return (
25
25
  <SafeAreaView style={styles.container}>
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { TouchableOpacity } from 'react-native';
3
+ import { act, create } from 'react-test-renderer';
4
+ import { SCProvider } from '../../../../../context';
5
+ import { mockSCStore } from '../../../../../context/mockStore';
6
+ import ItemPasscode from '../ItemPasscode';
7
+
8
+ const wrapComponent = (route = {}) => (
9
+ <SCProvider initState={mockSCStore({})}>
10
+ <ItemPasscode route={route} />
11
+ </SCProvider>
12
+ );
13
+
14
+ describe('Test ItemPasscode', () => {
15
+ let tree;
16
+ test('test render without params', async () => {
17
+ await act(async () => {
18
+ tree = await create(wrapComponent());
19
+ });
20
+ const instance = tree.root;
21
+ const TouchableOpacities = instance.findAllByType(TouchableOpacity);
22
+ expect(TouchableOpacities).toHaveLength(2);
23
+ });
24
+ });
@@ -40,6 +40,7 @@ describe('Test SetupGeneratePasscode', () => {
40
40
  const changeDuration = instance.findAll(
41
41
  (item) => item.props.testID === TESTID.GENERATE_PASSCODE_SET_DURATION
42
42
  );
43
+
43
44
  return {
44
45
  changeName,
45
46
  changeTime,
@@ -58,5 +59,18 @@ describe('Test SetupGeneratePasscode', () => {
58
59
  expect(changeName[0]).toBeDefined();
59
60
  expect(changeTime[0]).toBeDefined();
60
61
  expect(changeDuration[0]).toBeDefined();
62
+
63
+ await changeDuration[0].props.onPressSetMinute();
64
+ await changeDuration[0].props.onPressSelectCircle();
65
+ await changeTime[0].props.onPressSetTime();
66
+
67
+ const wheelDateTimePicker = instance.findAll(
68
+ (item) =>
69
+ item.props.testID ===
70
+ `${TESTID.WHEEL_DATE_TIME_PICKER_BUTTON}${TESTID.VIEW_BUTTON_BOTTOM_RIGHT_BUTTON}`
71
+ );
72
+ await wheelDateTimePicker[5].props.onClick();
73
+ await wheelDateTimePicker[11].props.onClick();
74
+ await wheelDateTimePicker[17].props.onClick();
61
75
  });
62
76
  });
@@ -180,6 +180,7 @@ const SetupGeneratePasscode = memo(() => {
180
180
  showsVerticalScrollIndicator={false}
181
181
  showsHorizontalScrollIndicator={false}
182
182
  style={styles.scrollview}
183
+ scrollIndicatorInsets={{ right: 1 }}
183
184
  >
184
185
  <View style={styles.wrap}>
185
186
  <ButtonWrapper
@@ -5,15 +5,20 @@ import React, { memo } from 'react';
5
5
  import { TouchableOpacity, View } from 'react-native';
6
6
  import { Colors } from '../../../configs';
7
7
  import styles from './OnOffButtonTemplateStyle';
8
+ import { TESTID } from '../../../configs/Constants';
8
9
 
9
10
  const OnOffButtonTemplate = memo(
10
11
  ({ isOn, triggerAction, actionGroup, isLight = false }) => {
11
- const { configuration } = actionGroup;
12
+ const { configuration, id } = actionGroup;
12
13
 
13
14
  return (
14
15
  <>
15
16
  <View style={styles.barrierControlContainer}>
16
- <TouchableOpacity style={styles.bigCircle} onPress={triggerAction}>
17
+ <TouchableOpacity
18
+ style={styles.bigCircle}
19
+ onPress={triggerAction}
20
+ testID={`${TESTID.ON_OFF_BUTTON}-${id}`}
21
+ >
17
22
  <View style={styles.smallCircle}>
18
23
  <Icon
19
24
  name={isOn ? configuration.icon_on : configuration.icon_off}
@@ -25,6 +30,7 @@ const OnOffButtonTemplate = memo(
25
30
  styles.textBig,
26
31
  { color: isOn ? Colors.Gray8 : Colors.Gray6 },
27
32
  ]}
33
+ testID={`${TESTID.SENSOR_STATUS}-${id}`}
28
34
  >
29
35
  {isOn ? configuration.text_on : configuration.text_off}
30
36
  </Text>
@@ -33,11 +33,15 @@ const SliderRangeTemplate = memo(({ actionGroup, doAction, sensor }) => {
33
33
  useEffect(() => {
34
34
  const { config } = configuration;
35
35
  const configValue = configValues[config];
36
- setValueBrightness(configValue);
36
+ let valueTemp = configValue;
37
+ if (configValue > 0) {
38
+ valueTemp = Math.round((configValue / 254) * 100);
39
+ }
40
+ setValueBrightness(valueTemp);
37
41
  }, [configuration.config, configValues, configuration]);
38
42
 
39
43
  useEffect(() => {
40
- if (sensor?.is_managed_by_backend) {
44
+ if (sensor?.is_managed_by_backend && sensor.device_type !== 'GOOGLE_HOME') {
41
45
  watchMultiConfigs([configuration.config]);
42
46
  }
43
47
  }, [sensor, configuration.config]);
@@ -1,5 +1,5 @@
1
1
  import React, { memo, useCallback } from 'react';
2
- import { View, ScrollView, Alert } from 'react-native';
2
+ import { View, ScrollView } from 'react-native';
3
3
 
4
4
  import styles from './SmartTiviActionTemplateStyles';
5
5
  import Text from '../../Text';
@@ -22,6 +22,7 @@ import {
22
22
  Youtube,
23
23
  Netflix,
24
24
  } from './component/Icon';
25
+ import { notImplemented } from '../../../utils/Utils';
25
26
 
26
27
  const SmartTiviActionTemplate = memo(
27
28
  ({ actionGroup, doAction, scrollEnabled = true }) => {
@@ -68,7 +69,7 @@ const SmartTiviActionTemplate = memo(
68
69
  case SMART_TIVI_BUTTON.HOME_BUTTON:
69
70
  case SMART_TIVI_BUTTON.BACK_BUTTON:
70
71
  case SMART_TIVI_BUTTON.CHANNEL_BUTTON:
71
- return Alert.alert(t('feature_under_development'));
72
+ return notImplemented(t);
72
73
  default:
73
74
  return <></>;
74
75
  }
@@ -91,7 +92,10 @@ const SmartTiviActionTemplate = memo(
91
92
  }, []);
92
93
  return (
93
94
  <>
94
- <ScrollView scrollEnabled={scrollEnabled}>
95
+ <ScrollView
96
+ scrollEnabled={scrollEnabled}
97
+ scrollIndicatorInsets={{ right: 1 }}
98
+ >
95
99
  <View style={styles.wrap}>
96
100
  <View style={styles.rowOnOff}>
97
101
  <CircleButton