@eohjsc/react-native-smart-city 0.2.21 → 0.2.27

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 (404) hide show
  1. package/README.md +1 -1
  2. package/assets/images/Add.svg +5 -0
  3. package/assets/images/AddLocationMaps/Point.svg +3 -0
  4. package/assets/images/CheckCircle.svg +4 -0
  5. package/assets/images/Close.svg +3 -0
  6. package/assets/images/HowToStart.svg +14 -0
  7. package/assets/images/Illustrations.svg +83 -0
  8. package/assets/images/OneTap.svg +14 -0
  9. package/assets/images/OneTap@1x.svg +14 -0
  10. package/assets/images/Rearrange.svg +3 -0
  11. package/assets/images/Schedule.svg +39 -0
  12. package/assets/images/ValueChange.svg +49 -0
  13. package/index.js +2 -0
  14. package/package.json +14 -2
  15. package/src/Images/Common/ActiveButton.png +0 -0
  16. package/src/Images/Common/ActiveButton@2x.png +0 -0
  17. package/src/Images/Common/ActiveButton@3x.png +0 -0
  18. package/src/Images/Common/arrow-back.png +0 -0
  19. package/src/Images/Common/checked@2x.png +0 -0
  20. package/src/Images/Common/checked@3x.png +0 -0
  21. package/src/Images/Common/file.png +0 -0
  22. package/src/Images/Common/fullscreen.png +0 -0
  23. package/src/Images/Common/refresh.png +0 -0
  24. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +1 -1
  25. package/src/commons/ActionGroup/OnOffTemplate/index.js +9 -4
  26. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +4 -3
  27. package/src/commons/ActionGroup/StatesGridActionTemplate.js +2 -2
  28. package/src/commons/ActionGroup/ThreeButtonTemplate.js +13 -6
  29. package/src/commons/ActionGroup/ThreeButtonTemplateStyle.js +1 -1
  30. package/src/commons/ActionGroup/TimerActionTemplate.js +158 -33
  31. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +294 -0
  32. package/src/commons/ActionGroup/__test__/NumberUpDownTemplateWithNullConfigValue.test.js +60 -0
  33. package/src/commons/ActionGroup/__test__/OnOffButtonTemplate.test.js +8 -13
  34. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +3 -3
  35. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +26 -45
  36. package/src/commons/ActionGroup/__test__/ThreeButtonTemplate.test.js +11 -5
  37. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +14 -8
  38. package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +17 -23
  39. package/src/commons/ActionGroup/__test__/__snapshots__/ThreeButtonTemplate.test.js.snap +241 -223
  40. package/src/commons/ActionGroup/__test__/index.test.js +39 -107
  41. package/src/commons/ActionGroup/hooks/useDropdownAction.js +2 -1
  42. package/src/commons/ActionTemplate/ActionTemplateStyles.js +14 -0
  43. package/src/commons/ActionTemplate/OnOffButtonAction.js +40 -0
  44. package/src/commons/ActionTemplate/OnOffButtonActionStyles.js +11 -0
  45. package/src/commons/ActionTemplate/OneButtonAction.js +26 -0
  46. package/src/commons/ActionTemplate/OneButtonActionStyles.js +11 -0
  47. package/src/commons/ActionTemplate/ThreeButtonAction.js +55 -0
  48. package/src/commons/ActionTemplate/ThreeButtonActionStyles.js +11 -0
  49. package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +34 -0
  50. package/src/commons/ActionTemplate/__test__/OneButtonAction.test.js +33 -0
  51. package/src/commons/ActionTemplate/__test__/ThreeButtonAction.test.js +35 -0
  52. package/src/commons/ActionTemplate/__test__/index.test.js +71 -0
  53. package/src/commons/ActionTemplate/index.js +69 -0
  54. package/src/commons/AlertAction/__test__/AlertAction.test.js +6 -6
  55. package/src/commons/AlertAction/index.js +2 -0
  56. package/src/commons/Automate/ItemAddNewScriptActionStyles.js +38 -0
  57. package/src/commons/Automate/ItemAutomate.js +39 -0
  58. package/src/commons/Automate/ItemAutomateStyles.js +33 -0
  59. package/src/commons/Automate/ItemScriptAction.js +45 -0
  60. package/src/commons/Automate/ItemScriptActionStyles.js +42 -0
  61. package/src/commons/Automate/__test__/ItemAutomate.test.js +16 -0
  62. package/src/commons/Automate/__test__/ItemScriptAction.test.js +16 -0
  63. package/src/commons/BackDefault/__test__/BackDefault.test.js +21 -0
  64. package/src/commons/BottomScrollPicker/index.js +62 -0
  65. package/src/commons/BottomScrollPicker/styles.js +13 -0
  66. package/src/commons/BottomSheet/index.js +41 -0
  67. package/src/commons/BottomSheet/styles.js +37 -0
  68. package/src/commons/Button/index.js +6 -1
  69. package/src/commons/ButtonPopup/__test__/__snapshots__/ButtonPopup.test.js.snap +2 -0
  70. package/src/commons/ButtonPopup/index.js +2 -0
  71. package/src/commons/Calendar/index.js +72 -0
  72. package/src/commons/Calendar/styles.js +11 -0
  73. package/src/commons/CameraDevice/index.js +2 -1
  74. package/src/commons/ChartLoading/__test__/ChartLoading.test.js +9 -7
  75. package/src/commons/ChartLoading/index.js +2 -1
  76. package/src/commons/DateTimeRangeChange/index.js +2 -1
  77. package/src/commons/Device/ConnectedViewHeader.js +3 -1
  78. package/src/commons/Device/DeviceAlertStatus.js +5 -2
  79. package/src/commons/Device/DisconnectedView.js +34 -26
  80. package/src/commons/Device/Emergency/EmergencyButton.js +2 -1
  81. package/src/commons/Device/Emergency/EmergencyDetail.js +2 -1
  82. package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +14 -6
  83. package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +10 -2
  84. package/src/commons/Device/FlatListItems.js +3 -2
  85. package/src/commons/Device/FooterInfo.js +2 -1
  86. package/src/commons/Device/HistoryChart.js +2 -1
  87. package/src/commons/Device/ItemAddNew/index.js +8 -3
  88. package/src/commons/Device/SensorConnectedStatus.js +2 -1
  89. package/src/commons/Device/WindDirection/Compass/Compass.test.js +19 -11
  90. package/src/commons/Device/WindDirection/Compass/index.js +1 -1
  91. package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +9 -3
  92. package/src/commons/Device/WindSpeed/LinearChart/__test__/__snapshots__/LinearChart.test.js.snap +0 -81
  93. package/src/commons/Device/WindSpeed/LinearChart/index.js +2 -1
  94. package/src/commons/Device/__test__/ConnectedViewHeader.test.js +16 -8
  95. package/src/commons/Device/__test__/DeviceAlertStatus.test.js +13 -5
  96. package/src/commons/Device/__test__/DisconnectedView.test.js +13 -5
  97. package/src/commons/Device/__test__/FlatListItems.test.js +9 -1
  98. package/src/commons/Device/__test__/FooterInfo.test.js +13 -4
  99. package/src/commons/Device/__test__/SensorConnectedStatus.test.js +9 -1
  100. package/src/commons/Device/__test__/__snapshots__/DisconnectedView.test.js.snap +20 -20
  101. package/src/commons/DisplayChecking/__test__/DisplayChecking.test.js +28 -0
  102. package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -1
  103. package/src/commons/EmergencyButton/AlertSent.js +3 -2
  104. package/src/commons/Explore/CityItem/index.js +2 -1
  105. package/src/commons/Explore/HeaderExplore/index.js +2 -1
  106. package/src/commons/Explore/HeaderLabel/index.js +2 -1
  107. package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +9 -2
  108. package/src/commons/Explore/SearchBox/index.js +2 -1
  109. package/src/commons/Explore/__test__/CityItem.test.js +13 -15
  110. package/src/commons/Explore/__test__/HeaderExplore.test.js +11 -7
  111. package/src/commons/Explore/__test__/HeaderLabel.test.js +15 -9
  112. package/src/commons/Explore/__test__/LocationItem.test.js +31 -0
  113. package/src/commons/Header/HeaderCustom.js +22 -2
  114. package/src/commons/Header/Styles/HeaderCustomStyles.js +2 -2
  115. package/src/commons/Header/__test__/HeaderCT.test.js +12 -4
  116. package/src/commons/HeaderAni/index.js +36 -5
  117. package/src/commons/HorizontalPicker/index.js +134 -0
  118. package/src/commons/HorizontalPicker/styles.js +56 -0
  119. package/src/commons/ImagePicker/__test__/ImagePicker.test.js +19 -13
  120. package/src/commons/ImagePicker/index.js +3 -1
  121. package/src/commons/MediaPlayer/index.js +2 -1
  122. package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +14 -8
  123. package/src/commons/MediaPlayerDetail/index.js +4 -1
  124. package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +11 -20
  125. package/src/commons/MenuActionAddnew/index.js +2 -1
  126. package/src/commons/Modal/ModalBottom.js +51 -0
  127. package/src/commons/Modal/ModalFullVideo.js +2 -1
  128. package/src/commons/Modal/Styles/ModalBottomStyles.js +35 -0
  129. package/src/commons/Modal/__test__/ModalBottom.test.js +39 -0
  130. package/src/commons/Modal/index.js +2 -1
  131. package/src/commons/NavBar/index.js +2 -2
  132. package/src/commons/RowItem/__test__/RowItem.test.js +16 -0
  133. package/src/commons/RowItem/index.js +61 -0
  134. package/src/commons/RowItem/styles.js +53 -0
  135. package/src/commons/SelectActionCard/SelectActionStyles.js +16 -0
  136. package/src/commons/SelectActionCard/index.js +30 -0
  137. package/src/commons/Sharing/DevicePermissionsCheckbox.js +2 -1
  138. package/src/commons/Sharing/MemberList.js +3 -1
  139. package/src/commons/Sharing/RowMember.js +3 -2
  140. package/src/commons/Sharing/StationDevicePermissions.js +2 -1
  141. package/src/commons/Sharing/WrapHeaderScrollable.js +78 -74
  142. package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +15 -9
  143. package/src/commons/Sharing/__test__/MemberList.test.js +17 -25
  144. package/src/commons/Sharing/__test__/StationDevicePermission.test.js +17 -12
  145. package/src/commons/Sharing/__test__/WrapHeaderScrollable.test.js +0 -9
  146. package/src/commons/SubUnit/OneTap/ItemOneTap.js +101 -0
  147. package/src/commons/SubUnit/OneTap/ItemOneTapStyles.js +41 -0
  148. package/src/commons/SubUnit/OneTap/OneTapStyles.js +36 -0
  149. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +195 -0
  150. package/src/commons/SubUnit/OneTap/index.js +39 -0
  151. package/src/commons/SubUnit/ShortDetail.js +11 -6
  152. package/src/commons/SubUnit/__test__/ShortDetail.test.js +14 -6
  153. package/src/commons/Today/__test__/Today.test.js +9 -1
  154. package/src/commons/Today/__test__/__snapshots__/Today.test.js.snap +1 -1
  155. package/src/commons/Today/index.js +2 -1
  156. package/src/commons/Unit/SharedUnit.js +2 -1
  157. package/src/commons/Unit/__test__/SharedUnit.test.js +330 -0
  158. package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +1 -2
  159. package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +16 -17
  160. package/src/commons/UnitSummary/AirQuality/index.js +5 -120
  161. package/src/commons/UnitSummary/AirQuality/styles.js +112 -0
  162. package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -1
  163. package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +15 -9
  164. package/src/commons/WheelDateTimePicker/Picker.js +57 -0
  165. package/src/commons/WheelDateTimePicker/index.js +168 -0
  166. package/src/commons/WheelDateTimePicker/styles.js +21 -0
  167. package/src/commons/index.js +2 -0
  168. package/src/configs/API.js +29 -0
  169. package/src/configs/Colors.js +1 -0
  170. package/src/configs/Constants.js +61 -0
  171. package/src/configs/Images.js +1 -0
  172. package/src/configs/SCConfig.js +7 -0
  173. package/src/configs/Theme.js +20 -0
  174. package/src/context/SCContext.tsx +9 -39
  175. package/src/context/actionType.ts +11 -0
  176. package/src/context/mockStore.ts +51 -0
  177. package/src/context/reducer.ts +23 -0
  178. package/src/hooks/Common/__test__/useStatusbar.test.js +28 -0
  179. package/src/hooks/Common/__test__/useTranslations.test.js +23 -0
  180. package/src/hooks/Common/index.js +2 -0
  181. package/src/hooks/Common/useGetIdUser.js +9 -0
  182. package/src/hooks/Common/useTranslations.ts +34 -0
  183. package/src/iot/Monitor.js +2 -1
  184. package/src/iot/RemoteControl/Bluetooth.js +2 -6
  185. package/src/iot/RemoteControl/GoogleHome.js +1 -1
  186. package/src/iot/RemoteControl/Internet.js +1 -1
  187. package/src/iot/RemoteControl/LG.js +57 -15
  188. package/src/iot/RemoteControl/__test__/Bluetooth.test.js +3 -5
  189. package/src/iot/RemoteControl/__test__/GoogleHome.test.js +3 -3
  190. package/src/iot/RemoteControl/__test__/Internet.test.js +1 -8
  191. package/src/iot/RemoteControl/__test__/LgThinq.test.js +7 -10
  192. package/src/iot/RemoteControl/index.js +1 -1
  193. package/src/iot/states.js +1 -0
  194. package/src/navigations/AutomateStack.js +45 -0
  195. package/src/navigations/SharedStack.js +2 -1
  196. package/src/navigations/UnitStack.js +86 -6
  197. package/src/navigations/utils.js +8 -0
  198. package/src/screens/AQIGuide/__test__/AQIGuide.test.js +9 -1
  199. package/src/screens/AQIGuide/index.js +2 -2
  200. package/src/screens/ActivityLog/__test__/index.test.js +14 -39
  201. package/src/screens/ActivityLog/index.js +2 -1
  202. package/src/screens/AddCommon/SelectSubUnit.js +5 -4
  203. package/src/screens/AddCommon/SelectUnit.js +3 -2
  204. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +61 -0
  205. package/src/screens/AddCommon/__test__/SelectUnit.test.js +18 -10
  206. package/src/screens/AddLocationMaps/index.js +2 -1
  207. package/src/screens/AddNewAction/Components/LoadingSelectAction.js +40 -0
  208. package/src/screens/AddNewAction/Components/index.js +3 -0
  209. package/src/screens/AddNewAction/Device/DeviceStyles.js +43 -0
  210. package/src/screens/AddNewAction/Device/__test__/index.test.js +42 -0
  211. package/src/screens/AddNewAction/Device/index.js +33 -0
  212. package/src/screens/AddNewAction/SelectAction.js +237 -0
  213. package/src/screens/AddNewAction/SelectSensorDevices.js +150 -0
  214. package/src/screens/AddNewAction/SetupSensor.js +221 -0
  215. package/src/screens/AddNewAction/Styles/SelectActionStyles.js +62 -0
  216. package/src/screens/AddNewAction/Styles/SelectSensorDevicesStyles.js +36 -0
  217. package/src/screens/AddNewAction/Styles/SetupSensorStyles.js +76 -0
  218. package/src/screens/AddNewAction/__test__/SelectAction.test.js +153 -0
  219. package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +191 -0
  220. package/src/screens/AddNewAction/__test__/SetupSensor.test.js +125 -0
  221. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +112 -0
  222. package/src/screens/AddNewAutoSmart/index.js +113 -0
  223. package/src/screens/AddNewAutoSmart/styles/AddNewAutoSmartStyles.js +36 -0
  224. package/src/screens/AddNewDevice/ConnectDevices.js +2 -1
  225. package/src/screens/AddNewDevice/ConnectingDevices.js +2 -1
  226. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +29 -13
  227. package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +19 -7
  228. package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +16 -6
  229. package/src/screens/AddNewDevice/hooks/useStateAlertRename.js +2 -1
  230. package/src/screens/AddNewDevice/index.js +2 -1
  231. package/src/screens/AddNewGateway/ConnectedGateway.js +2 -1
  232. package/src/screens/AddNewGateway/ConnectingGateway.js +99 -24
  233. package/src/screens/AddNewGateway/ConnectingGatewayStyles.js +92 -0
  234. package/src/screens/AddNewGateway/SetupGatewayWifi.js +3 -2
  235. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +35 -72
  236. package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +14 -4
  237. package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +20 -10
  238. package/src/screens/AddNewGateway/hooks/useStateAlertRename.js +2 -1
  239. package/src/screens/AddNewGateway/index.js +2 -1
  240. package/src/screens/AddNewOneTap/AddNewOneTapStyles.js +44 -0
  241. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +130 -0
  242. package/src/screens/AddNewOneTap/index.js +83 -0
  243. package/src/screens/AllCamera/__test__/index.test.js +103 -0
  244. package/src/screens/AllCamera/index.js +2 -1
  245. package/src/screens/Automate/Components/Loading.js +64 -0
  246. package/src/screens/Automate/Styles/indexStyles.js +64 -0
  247. package/src/screens/Automate/__test__/Loading.test.js +16 -0
  248. package/src/screens/Automate/__test__/index.test.js +93 -0
  249. package/src/screens/Automate/index.js +148 -0
  250. package/src/screens/Device/HeaderDevice/styles.js +2 -2
  251. package/src/screens/Device/__test__/detail.test.js +90 -18
  252. package/src/screens/Device/detail.js +73 -35
  253. package/src/screens/Device/hooks/useCountUp.js +4 -0
  254. package/src/screens/Device/hooks/useEmergencyButton.js +3 -2
  255. package/src/screens/Device/styles.js +5 -1
  256. package/src/screens/DeviceInfo/__test__/index.test.js +12 -3
  257. package/src/screens/DeviceInfo/index.js +2 -1
  258. package/src/screens/EditActionsList/Styles/indexStyles.js +84 -0
  259. package/src/screens/EditActionsList/index.js +186 -0
  260. package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +3 -2
  261. package/src/screens/EmergencyContacts/EmergencyContactsList.js +9 -2
  262. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +2 -1
  263. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +15 -18
  264. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +19 -23
  265. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +10 -25
  266. package/src/screens/EmergencyContacts/hook.js +3 -2
  267. package/src/screens/Explore/index.js +3 -2
  268. package/src/screens/GuestInfo/__test__/index.test.js +176 -0
  269. package/src/screens/GuestInfo/components/AccessScheduleItem.js +32 -0
  270. package/src/screens/GuestInfo/components/AccessScheduleSheet.js +204 -0
  271. package/src/screens/GuestInfo/components/HeaderGuestInfo.js +36 -0
  272. package/src/screens/GuestInfo/components/RecurringDetail.js +106 -0
  273. package/src/screens/GuestInfo/components/RowGuestInfo.js +31 -0
  274. package/src/screens/GuestInfo/components/TemporaryDetail.js +53 -0
  275. package/src/screens/GuestInfo/constant.js +59 -0
  276. package/src/screens/GuestInfo/index.js +150 -0
  277. package/src/screens/GuestInfo/styles/AccessScheduleDetailStyles.js +31 -0
  278. package/src/screens/GuestInfo/styles/AccessScheduleItemStyles.js +22 -0
  279. package/src/screens/GuestInfo/styles/HeaderGuestInfoStyles.js +31 -0
  280. package/src/screens/GuestInfo/styles/indexStyles.js +38 -0
  281. package/src/screens/ManageAccess/__test__/ManageAccess.test.js +13 -1
  282. package/src/screens/ManageAccess/hooks/index.js +4 -0
  283. package/src/screens/ManageAccess/index.js +49 -20
  284. package/src/screens/ManageAccess/styles/ManageAccessStyles.js +3 -0
  285. package/src/screens/PlayBackCamera/Timer.js +1 -1
  286. package/src/screens/PlayBackCamera/index.js +9 -5
  287. package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +2 -11
  288. package/src/screens/ScanChipQR/components/QRScan/index.js +2 -1
  289. package/src/screens/ScriptDetail/Styles/indexStyles.js +157 -0
  290. package/src/screens/ScriptDetail/__test__/index.test.js +119 -0
  291. package/src/screens/ScriptDetail/hooks/index.js +55 -0
  292. package/src/screens/ScriptDetail/index.js +344 -0
  293. package/src/screens/SelectUnit/Styles/indexStyles.js +55 -0
  294. package/src/screens/SelectUnit/__test__/index.test.js +85 -0
  295. package/src/screens/SelectUnit/index.js +100 -0
  296. package/src/screens/SetSchedule/__test__/index.test.js +97 -0
  297. package/src/screens/SetSchedule/components/RepeatOptionsPopup.js +56 -0
  298. package/src/screens/SetSchedule/components/RowItem.js +27 -0
  299. package/src/screens/SetSchedule/components/SelectWeekday.js +65 -0
  300. package/src/screens/SetSchedule/index.js +139 -0
  301. package/src/screens/SetSchedule/styles/RepeatOptionsPopupStyles.js +22 -0
  302. package/src/screens/SetSchedule/styles/RowItemStyles.js +29 -0
  303. package/src/screens/SetSchedule/styles/SelectWeekdayStyles.js +26 -0
  304. package/src/screens/SetSchedule/styles/indexStyles.js +22 -0
  305. package/src/screens/SharedUnit/TabHeader.js +2 -1
  306. package/src/screens/SharedUnit/__test__/TabHeader.test.js +40 -0
  307. package/src/screens/SharedUnit/index.js +3 -2
  308. package/src/screens/Sharing/MemberList.js +2 -1
  309. package/src/screens/Sharing/SelectPermission.js +2 -1
  310. package/src/screens/Sharing/SelectUser.js +3 -2
  311. package/src/screens/Sharing/__test__/MemberList.test.js +25 -28
  312. package/src/screens/Sharing/__test__/SelectPermission.test.js +16 -8
  313. package/src/screens/Sharing/__test__/SelectUser.test.js +33 -15
  314. package/src/screens/Sharing/hooks/index.js +22 -17
  315. package/src/screens/SubUnit/AddSubUnit.js +3 -2
  316. package/src/screens/SubUnit/Detail.js +5 -4
  317. package/src/screens/SubUnit/EditSubUnit.js +274 -0
  318. package/src/screens/SubUnit/EditSubUnitStyles.js +119 -0
  319. package/src/screens/SubUnit/ManageSubUnit.js +114 -371
  320. package/src/screens/SubUnit/ManageSubUnitStyles.js +40 -0
  321. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +17 -11
  322. package/src/screens/SubUnit/__test__/Detail.test.js +11 -31
  323. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +427 -0
  324. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +51 -384
  325. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +85 -0
  326. package/src/screens/SubUnit/hooks/useManageSubUnit.js +35 -0
  327. package/src/screens/SyncLGDevice/AddLGDevice.js +3 -2
  328. package/src/screens/TDSGuide/__test__/TDSGuide.test.js +9 -1
  329. package/src/screens/TDSGuide/index.js +2 -1
  330. package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +9 -1
  331. package/src/screens/UVIndexGuide/index.js +2 -1
  332. package/src/screens/Unit/AddMenu.js +3 -2
  333. package/src/screens/Unit/Detail.js +66 -20
  334. package/src/screens/Unit/ManageUnit/index.js +4 -3
  335. package/src/screens/Unit/ManageUnit.js +15 -4
  336. package/src/screens/Unit/MoreMenu.js +3 -2
  337. package/src/screens/Unit/SelectLocation.js +8 -2
  338. package/src/screens/Unit/SelectLocationStyles.js +11 -0
  339. package/src/screens/Unit/__test__/AddMenu.test.js +15 -15
  340. package/src/screens/Unit/__test__/CheckSendEmail.test.js +19 -10
  341. package/src/screens/Unit/__test__/Detail.test.js +92 -33
  342. package/src/screens/Unit/__test__/ManageUnit.test.js +16 -23
  343. package/src/screens/Unit/components/Header/index.js +2 -1
  344. package/src/screens/Unit/components/ListMyAllUnit/index.js +2 -1
  345. package/src/screens/Unit/components/MyUnit/index.js +2 -1
  346. package/src/screens/Unit/components/SearchLocation/__test__/RowLocation.test.js +36 -0
  347. package/src/screens/Unit/components/SearchLocation/index.js +2 -1
  348. package/src/screens/Unit/components/SharedUnit/index.js +2 -1
  349. package/src/screens/Unit/components/__test__/MyUnit.test.js +22 -72
  350. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +32 -0
  351. package/src/screens/Unit/components/__test__/SharedUnit.test.js +11 -2
  352. package/src/screens/UnitSummary/__test__/index.test.js +12 -4
  353. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +13 -3
  354. package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -1
  355. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +16 -12
  356. package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -1
  357. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +2 -2
  358. package/src/screens/UnitSummary/components/Temperature/index.js +2 -1
  359. package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -1
  360. package/src/screens/UnitSummary/components/UvIndex/__test__/__snapshots__/index.test.js.snap +37 -37
  361. package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +14 -6
  362. package/src/screens/UnitSummary/components/UvIndex/index.js +2 -1
  363. package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +11 -5
  364. package/src/screens/UnitSummary/components/WaterQuality/index.js +2 -1
  365. package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +13 -7
  366. package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +67 -0
  367. package/src/screens/UnitSummary/components/__test__/index.test.js +48 -0
  368. package/src/screens/UnitSummary/components/index.js +1 -37
  369. package/src/screens/UnitSummary/components/indexstyles.js +39 -0
  370. package/src/screens/UnitSummary/index.js +2 -1
  371. package/src/screens/WaterQualityGuide/__test__/index.test.js +12 -12
  372. package/src/screens/WaterQualityGuide/index.js +2 -1
  373. package/src/utils/Apis/axios.js +0 -4
  374. package/src/utils/Converter/array.js +4 -0
  375. package/src/utils/Converter/time.js +29 -4
  376. package/src/utils/I18n/index.ts +6 -0
  377. package/src/utils/I18n/translations/en.json +77 -5
  378. package/src/utils/I18n/translations/vi.json +73 -3
  379. package/src/utils/I18n/translations.ts +45 -0
  380. package/src/utils/Route/index.js +13 -0
  381. package/src/utils/__test__/InitData.test.js +20 -0
  382. package/src/commons/ChartLoading/__test__/__snapshots__/ChartLoading.test.js.snap +0 -66
  383. package/src/commons/Device/HistoryChart/__test__/HistoryChart.test.js +0 -57
  384. package/src/commons/Device/HistoryChart/__test__/__snapshots__/HistoryChart.test.js.snap +0 -593
  385. package/src/commons/Explore/SearchBox/__test__/__snapshots__/SearchBox.test.js.snap +0 -59
  386. package/src/commons/Header/__test__/Header.test.js +0 -24
  387. package/src/commons/MenuActionAddnew/__test__/__snapshots__/MenuActionAddNew.test.js.snap +0 -788
  388. package/src/commons/Sharing/__test__/__snapshots__/WrapHeaderScrollable.test.js.snap +0 -174
  389. package/src/commons/UnitSummary/AirQuality/__test__/__snapshots__/index.test.js.snap +0 -26679
  390. package/src/iot/RemoteControl/__test__/index.test.js +0 -101
  391. package/src/iot/__test__/Monitor.test.js +0 -119
  392. package/src/screens/EmergencyContacts/__test__/__snapshots__/EmergencyContactAddNew.test.js.snap +0 -1706
  393. package/src/screens/EmergencyContacts/__test__/__snapshots__/EmergencyContactList.test.js.snap +0 -4276
  394. package/src/screens/EmergencyContacts/__test__/__snapshots__/EmergencyContactsSelectContacts.test.js.snap +0 -2240
  395. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +0 -358
  396. package/src/screens/Unit/MyAllUnit/__test__/__snapshots__/index.test.js.snap +0 -1001
  397. package/src/screens/Unit/MyAllUnit/__test__/index.test.js +0 -48
  398. package/src/screens/Unit/components/MyAllUnit/__test__/__snapshots__/index.test.js.snap +0 -1001
  399. package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +0 -48
  400. package/src/screens/UnitSummary/components/WaterQuality/__test__/__snapshots__/index.test.js.snap +0 -1574
  401. package/src/screens/WaterQualityGuide/__test__/__snapshots__/index.test.js.snap +0 -3375
  402. package/src/utils/Converter/__test__/time.test.js +0 -126
  403. package/src/utils/I18n/index.js +0 -19
  404. package/src/utils/I18n/index.test.js +0 -7
@@ -0,0 +1,39 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { Colors } from '../../../configs';
3
+
4
+ export default StyleSheet.create({
5
+ summaryContainer: {
6
+ flex: 1,
7
+ flexDirection: 'row',
8
+ justifyContent: 'space-between',
9
+ borderWidth: 0.5,
10
+ borderColor: Colors.Gray4,
11
+ paddingHorizontal: 15,
12
+ paddingVertical: 10,
13
+ },
14
+ leftValue: {
15
+ fontWeight: 'bold',
16
+ fontSize: 16,
17
+ lineHeight: 24,
18
+ },
19
+ leftText: {
20
+ fontStyle: 'normal',
21
+ fontWeight: 'normal',
22
+ fontSize: 12,
23
+ lineHeight: 20,
24
+ },
25
+ rightValue: {
26
+ fontStyle: 'normal',
27
+ fontWeight: 'normal',
28
+ fontSize: 12,
29
+ lineHeight: 20,
30
+ top: 2,
31
+ },
32
+ rightText: {
33
+ fontStyle: 'normal',
34
+ fontWeight: 'normal',
35
+ fontSize: 10,
36
+ lineHeight: 20,
37
+ top: 4,
38
+ },
39
+ });
@@ -3,7 +3,7 @@ import { View, StyleSheet } from 'react-native';
3
3
  import { useNavigation } from '@react-navigation/native';
4
4
  import { TouchableOpacity } from 'react-native';
5
5
  import { IconOutline } from '@ant-design/icons-react-native';
6
- import { t } from 'i18n-js';
6
+ import { useTranslations } from '../../hooks/Common/useTranslations';
7
7
 
8
8
  import { API, Colors } from '../../configs';
9
9
  import Routes from '../../utils/Route';
@@ -20,6 +20,7 @@ import WaterQuality from './components/WaterQuality';
20
20
  import { TESTID } from '../../configs/Constants';
21
21
 
22
22
  const UnitSummary = memo(({ route }) => {
23
+ const t = useTranslations();
23
24
  const { unit, summary } = route.params;
24
25
  const [summaryDetail, setSummaryDetail] = useState({});
25
26
 
@@ -5,6 +5,8 @@ import WaterQualityGuide from '../index';
5
5
  import { create, act } from 'react-test-renderer';
6
6
  import { TESTID } from '../../../configs/Constants';
7
7
  import Text from '../../../commons/Text';
8
+ import { SCProvider } from '../../../context';
9
+ import { mockSCStore } from '../../../context/mockStore';
8
10
 
9
11
  jest.mock('react-redux', () => ({
10
12
  ...jest.requireActual('react-redux'),
@@ -16,6 +18,12 @@ jest.mock('react', () => ({
16
18
  useLayoutEffect: jest.fn(),
17
19
  }));
18
20
 
21
+ const wrapComponent = (route) => (
22
+ <SCProvider initState={mockSCStore({})}>
23
+ <WaterQualityGuide route={route} />
24
+ </SCProvider>
25
+ );
26
+
19
27
  describe('Test WaterQualityGuide', () => {
20
28
  let route;
21
29
 
@@ -91,7 +99,7 @@ describe('Test WaterQualityGuide', () => {
91
99
 
92
100
  test('render WaterQualityGuide default turbidityGuide', async () => {
93
101
  act(() => {
94
- tree = create(<WaterQualityGuide route={route} />);
102
+ tree = create(wrapComponent(route));
95
103
  });
96
104
  const instance = tree.root;
97
105
 
@@ -115,14 +123,12 @@ describe('Test WaterQualityGuide', () => {
115
123
  expect(textDescription1).toHaveLength(0);
116
124
  expect(textTitleLevel1).toHaveLength(0);
117
125
  expect(textDescriptionLevel1).toHaveLength(0);
118
-
119
- expect(tree.toJSON()).toMatchSnapshot();
120
126
  });
121
127
 
122
128
  test('render WaterQualityGuide with turbidityGuide', async () => {
123
129
  route.params.waterType = 'turbidity';
124
130
  act(() => {
125
- tree = create(<WaterQualityGuide route={route} />);
131
+ tree = create(wrapComponent(route));
126
132
  });
127
133
  const instance = tree.root;
128
134
 
@@ -146,14 +152,12 @@ describe('Test WaterQualityGuide', () => {
146
152
  expect(textDescription1).toHaveLength(0);
147
153
  expect(textTitleLevel1).toHaveLength(0);
148
154
  expect(textDescriptionLevel1).toHaveLength(0);
149
-
150
- expect(tree.toJSON()).toMatchSnapshot();
151
155
  });
152
156
 
153
157
  test('render WaterQualityGuide with cloGuide', async () => {
154
158
  route.params.waterType = 'clo';
155
159
  act(() => {
156
- tree = create(<WaterQualityGuide route={route} />);
160
+ tree = create(wrapComponent(route));
157
161
  });
158
162
  const instance = tree.root;
159
163
 
@@ -177,14 +181,12 @@ describe('Test WaterQualityGuide', () => {
177
181
  expect(textDescription1).toHaveLength(0);
178
182
  expect(textTitleLevel1).toHaveLength(0);
179
183
  expect(textDescriptionLevel1).toHaveLength(0);
180
-
181
- expect(tree.toJSON()).toMatchSnapshot();
182
184
  });
183
185
 
184
186
  test('render WaterQualityGuide with phGuide', async () => {
185
187
  route.params.waterType = 'ph';
186
188
  act(() => {
187
- tree = create(<WaterQualityGuide route={route} />);
189
+ tree = create(wrapComponent(route));
188
190
  });
189
191
  const instance = tree.root;
190
192
 
@@ -208,7 +210,5 @@ describe('Test WaterQualityGuide', () => {
208
210
  expect(textDescription1).toHaveLength(1);
209
211
  expect(textTitleLevel1).toHaveLength(14);
210
212
  expect(textDescriptionLevel1).toHaveLength(14);
211
-
212
- expect(tree.toJSON()).toMatchSnapshot();
213
213
  });
214
214
  });
@@ -1,6 +1,6 @@
1
1
  import React, { memo, useCallback, useMemo } from 'react';
2
2
  import { View, ScrollView, StyleSheet, SafeAreaView } from 'react-native';
3
- import { t } from 'i18n-js';
3
+ import { useTranslations } from '../../hooks/Common/useTranslations';
4
4
 
5
5
  import Text from '../../commons/Text';
6
6
  import { Colors, Theme } from '../../configs';
@@ -9,6 +9,7 @@ import { TESTID } from '../../configs/Constants';
9
9
  import { useSCContextSelector } from '../../context';
10
10
 
11
11
  const WaterQualityGuide = memo(({ route }) => {
12
+ const t = useTranslations();
12
13
  const { waterType } = route.params;
13
14
  const language = useSCContextSelector((state) => state.language);
14
15
 
@@ -1,6 +1,5 @@
1
1
  import axios from 'axios';
2
2
  import { deleteData, getData, storeData } from '../Storage';
3
- import { ToastBottomHelper } from '../Utils';
4
3
 
5
4
  export const replaceParams = (apiURL, params) => {
6
5
  let _result = apiURL;
@@ -30,9 +29,6 @@ const parseErrorResponse = (error) => {
30
29
  } else {
31
30
  message = error.message;
32
31
  }
33
-
34
- ToastBottomHelper.error(message);
35
-
36
32
  return {
37
33
  success: false,
38
34
  error,
@@ -5,3 +5,7 @@ export const removeDuplicateSearch = (recentSearch, description) => {
5
5
  }
6
6
  });
7
7
  };
8
+
9
+ // Sequence generator function
10
+ export const range = (start, stop, step) =>
11
+ Array.from({ length: (stop - start) / step + 1 }, (_, i) => start + i * step);
@@ -1,4 +1,4 @@
1
- import { t } from 'i18n-js';
1
+ import t from '../../hooks/Common/useTranslations';
2
2
  import moment from 'moment';
3
3
 
4
4
  export const transformDatetime = (data = {}, listFieldName = []) => {
@@ -19,7 +19,7 @@ export const transformDatetime = (data = {}, listFieldName = []) => {
19
19
  });
20
20
  };
21
21
 
22
- export const timeDifference = (current, previous) => {
22
+ export const timeDifference = (current, previous, symbol = false) => {
23
23
  let msPerMinute = 60 * 1000;
24
24
  let msPerHour = msPerMinute * 60;
25
25
  let msPerDay = msPerHour * 24;
@@ -33,9 +33,11 @@ export const timeDifference = (current, previous) => {
33
33
  if (second < 0) {
34
34
  second = 0;
35
35
  }
36
- return `${second} ${t('seconds_ago')}`;
36
+ return `${second} ${symbol ? t('secs_ago') : t('seconds_ago')}`;
37
37
  } else if (elapsed < msPerHour) {
38
- return `${Math.round(elapsed / msPerMinute)} ${t('minutes_ago')}`;
38
+ return `${Math.round(elapsed / msPerMinute)} ${
39
+ symbol ? t('mins_ago') : t('minutes_ago')
40
+ }`;
39
41
  } else if (elapsed < msPerDay) {
40
42
  return `${Math.round(elapsed / msPerHour)} ${t('hours_ago')}`;
41
43
  } else if (elapsed < msPerMonth) {
@@ -62,3 +64,26 @@ export const getTitleFromTime = (time, current) => {
62
64
  return moment(time).format('DD/MM/YYYY');
63
65
  }
64
66
  };
67
+
68
+ export const getDateData = (initialDate, max, min) => {
69
+ let dateData = [];
70
+ let dateIndex = -1;
71
+ const date = moment(min);
72
+ const today = moment();
73
+
74
+ while (date <= max) {
75
+ const dateString = date.isSame(today, 'day')
76
+ ? t('today')
77
+ : date.format('ddd DD/MM');
78
+ dateData.push({
79
+ text: dateString,
80
+ value: moment(date),
81
+ });
82
+ if (date.isSame(initialDate, 'day')) {
83
+ dateIndex = dateData.length - 1;
84
+ }
85
+ date.add(1, 'days');
86
+ }
87
+ const indexInitialDate = dateIndex !== -1 ? dateIndex : 0;
88
+ return [dateData, indexInitialDate];
89
+ };
@@ -0,0 +1,6 @@
1
+ export { getTranslate } from './translations';
2
+ export type {
3
+ InterPolateString,
4
+ Language,
5
+ TranslationString,
6
+ } from './translations';
@@ -98,9 +98,8 @@
98
98
  "text_cloud": "Clouds",
99
99
  "Today": "Today",
100
100
  "Yesterday": "Yesterday",
101
- "last_updated_%{minutes}_minutes_ago": "Last updated %{minutes} minutes ago",
102
- "Last %{days} ago": "Last %{days} days",
103
- "Welcome %{name}": "Welcome %{name}",
101
+ "last_updated_%{minutes}_minutes_ago": "Last updated {minutes} minutes ago",
102
+ "Welcome {name}": "Welcome {name}",
104
103
  "devices": "Devices",
105
104
  "Turbidity": "Turbidity",
106
105
  "pH": "pH",
@@ -170,6 +169,10 @@
170
169
  "resend": "Send again",
171
170
  "model": "Model",
172
171
  "powered_by": "Powered by",
172
+ "shared_unit": "Shared Unit",
173
+ "sensor_device": "Sensor device",
174
+ "sensor_devices": "Sensor devices",
175
+ "owner_unit": "Owner Unit",
173
176
  "hotline_text": "For water leak checking, call hotline ",
174
177
  "water_quality_overall": "Overall Water quality is based on below those conditions",
175
178
  "water_quality_guide": "Water Quality Guide",
@@ -180,6 +183,9 @@
180
183
  "text_recommended_clo": "The higher the residual chlorine levels in the supply, the better and longer the chemical will be able to protect the system from contamination. However, high levels of chlorine make the water smell and give it a bad taste, which will discourage people from drinking it. \nFor normal domestic use, residual chlorine levels at the point where the consumer collects water should be between 0.2 and 0.5 mg/l. The higher level will be close to the disinfection point and the lower level at the far extremities of the supply network.",
181
184
  "text_low_level": "Low",
182
185
  "text_high_level": "High",
186
+ "launch_one_tap": "Launch One-Tap",
187
+ "des_launch_one_tap": "Quick button create at the dashboard",
188
+ "active_list": "Actions List",
183
189
  "text_very_good_level": "Very good",
184
190
  "text_good_level": "Good",
185
191
  "text_moderate_level": "Moderate",
@@ -301,6 +307,7 @@
301
307
  "check_your_network_and_retry": "Check the Wi-Fi/Cellular signal or try to reset it.",
302
308
  "rename_unit": "Rename unit",
303
309
  "rename": "Rename",
310
+ "select_unit": "Select Unit",
304
311
  "remove_unit_name": "Remove %{name}?",
305
312
  "remove_note": "All information and devices that you have added to this unit will be deleted.",
306
313
  "sub_unit_remove_name": "Remove %{name}?",
@@ -308,11 +315,15 @@
308
315
  "text_remove_sub_unit_success": "Remove sub unit success!",
309
316
  "text_remove_sub_unit_fail": "Remove sub unit fail!",
310
317
  "camera": "Camera",
318
+ "favorites": "Favorites",
319
+ "add_to_favorites": "Add to Favorites",
320
+ "remove_from_favorites": "Remove from Favorites",
311
321
  "add_new_device": "Add new device",
312
322
  "add_new_device_message_no_unit": "You cannot add new device. You have to add a new unit first.",
313
323
  "add_member": "Add member",
314
324
  "add_new_member_message_no_unit": "You cannot add new member. You have to add a new unit first.",
315
- "select_devices": "Select devices",
325
+ "select_devices": "Select Devices",
326
+ "select_sensor": "Select Sensor",
316
327
  "sharing_select_devices_hint": "Select devices and what you want to share in details with this member",
317
328
  "members": "Members",
318
329
  "no_member": "No member",
@@ -344,6 +355,7 @@
344
355
  "east": "East",
345
356
  "south": "South",
346
357
  "west": "West",
358
+ "condition": "Condition",
347
359
  "north_east": "North East",
348
360
  "south_east": "South East",
349
361
  "south_west": "South West",
@@ -358,6 +370,7 @@
358
370
  "payment_option": "Payment option",
359
371
  "payment_failed": "Payment failed!",
360
372
  "saved_vehicle": "Saved Vehicle",
373
+ "set_a_number": "Set a number",
361
374
  "text_total_power_consumption": "Total Power Consumption",
362
375
  "smart_parking": "Smart Parking",
363
376
  "smart_parking_add_destination": "I would like to park near...",
@@ -448,7 +461,9 @@
448
461
  "what_is_tds_title": "What is TDS?",
449
462
  "what_is_tds_text": "TDS: is the total dissolved solids present in a certain amount of water - (the total number of charged ions, including salts, minerals or metals) that exist in a certain volume of water. High TDS is also responsible for turbidity and sedimentation in water. TDS is expressed in mg / L or parts per million (parts per million).",
450
463
  "tds_guidlines_title": "TDS guidlines for drinking water",
451
- "tds_guidlines_text": "Ideally, the TDS for drinking water should be below 300ppm and the maximum limit considered safe is 500ppm. Water sources with TDS <50ppm are usually water at a fairly pure level or water after being filtered through the RO system - this is water that contains a small amount of minerals and is completely assured to drink directly.",
464
+ "tds_guidlines_text_1": "Ideally, the TDS for drinking water should be below 300ppm and the maximum limit considered safe is 500ppm. Water sources with TDS <50ppm are usually water at a fairly pure level or water after being filtered through the RO system - this is water that contains a small amount of minerals and is completely assured to drink directly.",
465
+ "tds_guidlines_text_2": "Alpha 139G Water Purifier is certified to the national standards TCVN 11978:2017 & QCVN 4-2009/BKHCN about water purifiers for household use by the Ministry of Science and Technology.",
466
+ "tds_guidlines_text_3": "The quality of filtered water meets the standard of direct drinking water, QCVN 6-1:2010/BYT of the Ministry of Health includes 21 toxic physicochemical indicators such as: Arsenic, Ammonium, Lead, Cyanide, Mercury, Copper, Nitrate.. and 5 microbiological indicators: E.coli bacteria, Coliform, Streptococci feacal, Pseudomonas aeruginosa, Spores of sulfite-reducing anaerobic bacteria, ensuring absolute safety for users' health when drinking directly without boiling .(*).",
452
467
  "your_booking_is_safety": "Your booking is safely reserved. However, please be aware that there is no refund for cancellation.",
453
468
  "no_spot_available": "No spots available",
454
469
  "status_full_info": "No spots available at this moment.",
@@ -591,7 +606,9 @@
591
606
  "emergency_alert": "EMERGENCY ALERT!",
592
607
  "the_emergency_button_has_been_activated": "The Emergency button has been activated at unit ",
593
608
  "seconds_ago": "seconds ago",
609
+ "secs_ago": "secs ago",
594
610
  "minutes_ago": "minutes ago",
611
+ "mins_ago": "mins ago",
595
612
  "hours_ago": "hours ago",
596
613
  "days_ago": "days ago",
597
614
  "months_ago": "months ago",
@@ -611,6 +628,9 @@
611
628
  "select_unit_members": "Select from Unit members",
612
629
  "select_contacts": "Select contacts",
613
630
  "no_contact": "No contacts",
631
+ "is": "is",
632
+ "is_below": "is below",
633
+ "is_above": "is above",
614
634
  "text_notification_title_remind_to_make_payment": "Complete payment for your booking",
615
635
  "text_notification_title_expire_parking_session": "Parking session expires soon",
616
636
  "text_notification_title_remind_to_scan_qr_code": "Scan QR Code to activate your booking",
@@ -669,6 +689,18 @@
669
689
  "owners": "Owners",
670
690
  "guest": "Guest",
671
691
  "no_guest": "No guest",
692
+ "guest_info": "Guest Information",
693
+ "eoh_account_id": "EoH account ID",
694
+ "access_schedule": "Access Schedule",
695
+ "always": "Always",
696
+ "recurring": "Recurring",
697
+ "temporary": "Temporary",
698
+ "set_time": "Set time",
699
+ "set_date_time": "Set date and time",
700
+ "start": "Start",
701
+ "end": "End",
702
+ "repeat": "Repeat",
703
+ "add_action": "Add action",
672
704
  "connecting_your_gateway": "Connecting your gateway",
673
705
  "general_trading_conditions": "General Trading Conditions",
674
706
  "station_name": "Station name",
@@ -688,10 +720,50 @@
688
720
  "request_fail": "Request fail",
689
721
  "modbus_fail": "Modbus failrate",
690
722
  "rssi_node": "RSSI Node",
723
+ "edit_actions_list": "Edit Actions List",
724
+ "des_edit_actions_list": "Click on the order number to rearrange automatic order",
691
725
  "please_add_your_phone_number_and_chip_name": "Please add your phone number and chip name",
692
726
  "phone_number_of_data_sim": "Phone number of data sim",
693
727
  "select_a_sub_unit": "Select a sub-unit that you want to add this gateway",
694
728
  "all_camera": "All Cameras",
695
729
  "gateway_name": "Gateway name",
730
+ "activated_time": "Activated {time}",
731
+ "activated_successfully": "Activated successfully.",
732
+ "activation_failed": "Activation failed.",
733
+ "set_hour": "Set hour",
734
+ "sync_lg_device": "Sync LG device",
735
+ "lg_sync_failed": "Sync LG device failed!",
736
+ "lg_sync_success": "Sync LG device success!",
737
+ "setting_at": "Setting at",
738
+ "name_your_button": "Name your button",
739
+ "continue": "Continue",
740
+ "tap_to_run": "Tap to run",
741
+ "how_to_start": "How to start",
742
+ "set_up {name}": "Setup {name}",
743
+ "action": "Action",
744
+ "actions_list": "Actions list",
745
+ "delette_action": "Delete action?",
746
+ "message_delete_action": "Are you sure you want to delete action of \n{actionName} in {stationName}?",
747
+ "add_script": "Add Script",
748
+ "delete_script": "Delete Script",
749
+ "title_delete_script": "Delete script \"{scriptName}\"?",
750
+ "message_delete_script": "Are you sure you want to delete script \"{scriptName}\"?",
751
+ "rename_automate": "Rename automate",
752
+ "edit_sub_unit": "Edit Sub-unit",
753
+ "no_sub_unit_yet":"No sub-unit yet.",
754
+ "tap_+_to_add_new_sub_unit":"Tap + to add new sub-unit.",
755
+ "go_to_automate_scripts": "Go to automate scripts",
756
+ "One-Tap": "One-Tap",
757
+ "Scenario": "Scenario",
758
+ "set_schedule": "Set schedule",
759
+ "select_date": "Select date",
760
+ "once": "Once",
761
+ "every_day": "Everyday",
762
+ "every_week": "Every Week",
763
+ "button": "Button",
764
+ "create_smart": "Create Smart",
765
+ "automate": "Automate",
766
+ "automate_scripts": "Automate Scripts",
767
+ "choose_the_automation_method_you_want": "Choose the automation method you want",
696
768
  "error_please_try_later": "Error! Please try later"
697
769
  }
@@ -39,6 +39,9 @@
39
39
  "machine_status": "Trạng thái máy",
40
40
  "tank_working_normally": "Máy lọc hoạt động bình thường.",
41
41
  "filters": "Lõi lọc",
42
+ "launch_one_tap": "Khởi chạy một lần chạm",
43
+ "des_launch_one_tap": "Tạo nút nhanh trên trang tổng quan",
44
+ "active_list": "Danh sách hành động",
42
45
  "filtering": "Đang sục rửa",
43
46
  "insufficient_water_input": "Thiếu nước đầu vào.",
44
47
  "check_water_leak": "Kiểm tra rò rỉ nước.",
@@ -50,6 +53,8 @@
50
53
  "auth_already_have_an_account": "Bạn đã có tài khoản? ",
51
54
  "tds_infomation": "Chỉ số TDS",
52
55
  "what_is_tds_title": "TDS là gì?",
56
+ "set_a_number": "Đặt một số",
57
+ "add_action": "Thêm hành động",
53
58
  "what_is_tds_text": "TDS là tổng chất rắn hoà tan tồn tại trong một lượng nước nhất định - (tổng số các ion mang điện tích, bao gồm muối, khoáng chất hoặc kim loại) tồn tại trong một thể tích nước nhất định. TDS cao cũng là nguyên nhân gây ra độ đục và trầm tích trong nước. TDS được biểu thị bằng đơn vị mg/L hoặc ppm (parts per million - phần triệu).",
54
59
  "tds_guidlines_title": "Chỉ số TDS cho nước uống",
55
60
  "tds_guidlines_text_1": "Lý tưởng nhất, TDS cho nước uống phải dưới 300mg/lít và giới hạn tối đa được coi là an toàn là 500mg/lít. Với các nguồn nước có TDS < 50ppm thường là nước ở mức khá tinh khiết hoặc nước sau khi lọc qua hệ thống RO - đây là nước có chứa lượng khoáng nhỏ và hoàn toàn yên tâm để sử dụng uống trực tiếp.",
@@ -61,6 +66,11 @@
61
66
  "verify": "Xác nhận",
62
67
  "text_new_unit": "Địa điểm",
63
68
  "text_sub_units": "Khu vực",
69
+ "là": "là",
70
+ "is_below": "dưới",
71
+ "is_above": "trên",
72
+ "edit_actions_list": "Chỉnh sửa danh sách hành động",
73
+ "des_edit_actions_list": "Bấm vào số đơn hàng để sắp xếp lại đơn hàng tự động",
64
74
  "sub_unit": "Khu vực",
65
75
  "sub_units": "Khu vực",
66
76
  "device": "Thiết bị",
@@ -107,9 +117,8 @@
107
117
  "UV Index": "Chỉ số UV",
108
118
  "Protection advices:": "Khuyến nghị về sức khoẻ:",
109
119
  "Today": "Hôm nay",
110
- "last_updated_%{minutes}_minutes_ago": "Cập nhật lần cuối %{minutes} phút trước",
111
- "Last %{days} ago": "%{days} ngày qua",
112
- "Welcome %{name}": "Chào mừng đến %{name}",
120
+ "last_updated_%{minutes}_minutes_ago": "Cập nhật lần cuối {minutes} phút trước",
121
+ "Welcome {name}": "Chào mừng đến {name}",
113
122
  "devices": "thiết bị",
114
123
  "text_no_units": "Chưa có địa điểm. Nhấn + để tạo địa điểm đầu tiên.",
115
124
  "text_last_7_days": "7 ngày qua",
@@ -327,6 +336,11 @@
327
336
  "wind_speed": "Tốc độ gió",
328
337
  "from": "từ",
329
338
  "to": "đến",
339
+ "condition": "Điều kiện",
340
+ "shared_unit": "Khu vực được chia sẻ",
341
+ "owner_unit": "Chủ khu vực",
342
+ "sensor_device": "Thiết bị cảm biến",
343
+ "sensor_devices": "Thiết bị cảm biến",
330
344
  "check_device_power": "Kiểm tra lại nguồn điện của thiết bị.",
331
345
  "check_your_network_and_retry": "Kiểm tra lại Wi-Fi/tín hiệu di động hoặc thử khởi động lại.",
332
346
  "rename_unit": "Đổi tên địa điểm",
@@ -338,11 +352,15 @@
338
352
  "text_remove_sub_unit_success": "Xóa khu vực thành công!",
339
353
  "text_remove_sub_unit_fail": "Xóa khu vực thất bại!",
340
354
  "camera": "Camera",
355
+ "favorites": "Yêu thích",
356
+ "add_to_favorites": "Thêm vào yêu thích",
357
+ "remove_from_favorites": "Loại khỏi yêu thích",
341
358
  "add_new_device": "Thêm thiết bị",
342
359
  "add_new_device_message_no_unit": "Để thêm thiết bị mới, trước tiên bạn cần tạo một địa điểm.",
343
360
  "add_member": "Thêm thành viên",
344
361
  "add_new_member_message_no_unit": "Để thêm thành viên mới, trước tiên bạn cần tạo một điạ điểm.",
345
362
  "select_devices": "Lựa chọn thiết bị",
363
+ "select_sensor": "Lựa chọn cảm biến",
346
364
  "sharing_select_devices_hint": "Lựa chọn thiết bị mà bạn muốn chia sẻ quyền điều khiển",
347
365
  "members": "Thành viên",
348
366
  "no_member": "Không có thành viên nào",
@@ -471,6 +489,7 @@
471
489
  "spots_available": "chỗ trống",
472
490
  "extend_at": "Gia hạn lúc",
473
491
  "details": "Chi tiết",
492
+ "select_unit": "Chọn khu vực",
474
493
  "view_my_booking_details": "Xem thông tin đặt chỗ của tôi",
475
494
  "back_to_map_dashboard": "Quay lại màn hình chính",
476
495
  "text_pay_now": "Thanh toán",
@@ -594,7 +613,9 @@
594
613
  "emergency_alert": "Khẩn cấp!",
595
614
  "the_emergency_button_has_been_activated": "Nút cảnh báo khẩn cấp vừa được kích hoạt tại địa điểm ",
596
615
  "seconds_ago": "giây trước",
616
+ "secs_ago": "giây trước",
597
617
  "minutes_ago": "phút trước",
618
+ "mins_ago": "phút trước",
598
619
  "hours_ago": "giờ trước",
599
620
  "days_ago": "ngày trước",
600
621
  "months_ago": "tháng trước",
@@ -665,6 +686,17 @@
665
686
  "owners": "Chủ sỡ hữu",
666
687
  "guest": "Khách",
667
688
  "no_guest": "Không có vị khách nào",
689
+ "guest_info": "Thông tin khách",
690
+ "eoh_account_id": "ID tài khoản EoH",
691
+ "access_schedule": "Lịch truy cập",
692
+ "always": "Luôn luôn",
693
+ "recurring": "Tuần hoàn",
694
+ "temporary": "Tạm thời",
695
+ "set_time": "Chọn thời gian",
696
+ "set_date_time": "Chọn ngày và thời gian",
697
+ "start": "Bắt đầu",
698
+ "end": "Kết thúc",
699
+ "repeat": "Lặp lại",
668
700
  "please_select_a_wifi_network": "Vui lòng chọn mạng Wi-Fi và nhập mật khẩu",
669
701
  "wifi_name": "Tên Wi-Fi",
670
702
  "password": "Mật khẩu",
@@ -696,5 +728,43 @@
696
728
  "select_a_sub_unit": "Lựa chọn một khu vực mà bạn muốn thêm gateway",
697
729
  "all_camera": "All Cameras",
698
730
  "gateway_name": "Tên Gateway",
731
+ "activated_time": "Đã kích hoạt {time}",
732
+ "activated_successfully": "Đã kích hoạt thành công.",
733
+ "activation_failed": "Kích hoạt đã thất bại.",
734
+ "set_hour": "Đặt giờ",
735
+ "sync_lg_device": "Đồng bộ thiết bị LG",
736
+ "lg_sync_failed": "Đồng bộ thiết bị LG thất bại!",
737
+ "lg_sync_success": "Đồng bộ thiết bị LG thành công!",
738
+ "setting_at": "Thiết lập tại",
739
+ "name_your_button": "Đặt tên cho nút nhấn của bạn",
740
+ "continue": "Tiếp tục",
741
+ "tap_to_run": "Nhấn để chạy",
742
+ "how_to_start": "Cách khởi động",
743
+ "set_up {name}": "Thiết lập {name}",
744
+ "action": "Hành động",
745
+ "actions_list": "Dánh sách hành động",
746
+ "delette_action": "Xoá hành động ?",
747
+ "message_delete_action": "Bạn có chắc chắn muốn xóa hành động của {actionName} trong {stationName} không ?",
748
+ "add_script": "Thêm Kịch Bản",
749
+ "delete_script": "Xóa kịch bản",
750
+ "title_delete_script": "Xóa kịch bản \"{scriptName}\"?",
751
+ "message_delete_script": "Bạn có chắc chắn muốn xóa kịch bản \"{scriptName}\"?",
752
+ "rename_automate": "Đổi tên tự động hóa",
753
+ "edit_sub_unit": "Chỉnh sửa khu vực",
754
+ "no_sub_unit_yet":"Chưa có khu vực nào.",
755
+ "tap_+_to_add_new_sub_unit":"Nhấn + để thêm khu vực.",
756
+ "go_to_automate_scripts": "Đi đến kịch bản tự động",
757
+ "One-Tap": "Một chạm",
758
+ "Scenario": "Kịch bản",
759
+ "set_schedule": "Đặt lịch",
760
+ "select_date": "Chọn ngày",
761
+ "once": "Một lần",
762
+ "every_day": "Hằng ngày",
763
+ "every_week": "Hằng tuần",
764
+ "create_smart": "Tạo thông minh",
765
+ "automate": "Tự động",
766
+ "automate_scripts": "Kịch bản tự động",
767
+ "button": "Nút nhấn",
768
+ "choose_the_automation_method_you_want": "Chọn phương thức tự động hóa mà bạn mong muốn",
699
769
  "error_please_try_later": "Lỗi! Vui lòng thử lại sau"
700
770
  }
@@ -0,0 +1,45 @@
1
+ import MessageFormat from '@messageformat/core';
2
+
3
+ import en from './translations/en.json';
4
+ import vi from './translations/vi.json';
5
+
6
+ export type TranslationString = keyof typeof en;
7
+ export type Language = 'en' | 'vi';
8
+
9
+ const res = {
10
+ en,
11
+ vi,
12
+ };
13
+ export type InterPolateString = {
14
+ [name: string]: string;
15
+ };
16
+
17
+ const formatMess = new MessageFormat('en');
18
+
19
+ const formatMessage = (message: string, interpolateStr: InterPolateString) => {
20
+ try {
21
+ const compiledMsg = formatMess.compile(message);
22
+ return compiledMsg(interpolateStr);
23
+ } catch {
24
+ return message;
25
+ }
26
+ };
27
+
28
+ export const getTranslate = (
29
+ language: Language,
30
+ key: TranslationString,
31
+ interpolateStr?: InterPolateString
32
+ ) => {
33
+ // @ts-ignore
34
+ if (!res[language][key]) {
35
+ return key;
36
+ }
37
+
38
+ if (!interpolateStr) {
39
+ // @ts-ignore
40
+ return res[language][key];
41
+ }
42
+
43
+ // @ts-ignore
44
+ return formatMessage(res[language][key], interpolateStr);
45
+ };
@@ -15,6 +15,7 @@ const Routes = {
15
15
  AddMemberStack: 'AddMemberStack',
16
16
  AddUnitStack: 'AddUnitStack',
17
17
  AddGatewayStack: 'AddGatewayStack',
18
+ EditSubUnit: 'EditSubUnit',
18
19
  Language: 'Language',
19
20
  MyAllUnit: 'MyAllUnit',
20
21
  SubUnit: 'SubUnit',
@@ -94,10 +95,22 @@ const Routes = {
94
95
  TermAndPolicy: 'TermAndPolicy',
95
96
  Browser: 'Browser',
96
97
  ManageAccess: 'ManageAccess',
98
+ SelectSensorDevices: 'SelectSensorDevices',
99
+ SelectAction: 'SelectAction',
100
+ GuestInfo: 'GuestInfo',
97
101
  AddLGDevice: 'AddLGDevice',
98
102
  AddLGDeviceStack: 'AddLGDeviceStack',
103
+ ScriptDetail: 'ScriptDetail',
104
+ EditActionsList: 'EditActionsList',
99
105
  PlaybackCamera: 'PlaybackCamera',
106
+ SetUpSensor: 'SetUpSensor',
107
+ AddNewAutoSmart: 'AddNewAutoSmart',
100
108
  AllCamera: 'AllCamera',
109
+ AddNewOneTap: 'AddNewOneTap',
110
+ SelectUnit: 'SelectUnit',
111
+ AddNewScriptAction: 'AddNewScriptAction',
112
+ Automate: 'Automate',
113
+ SetSchedule: 'SetSchedule',
101
114
  };
102
115
 
103
116
  export default Routes;