@eohjsc/react-native-smart-city 0.3.10 → 0.3.13

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 (39) hide show
  1. package/index.js +2 -0
  2. package/package.json +1 -1
  3. package/src/commons/Action/ItemQuickAction.js +1 -1
  4. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +2 -0
  5. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +1 -1
  6. package/src/commons/ActionGroup/__test__/index.test.js +1 -1
  7. package/src/commons/Device/HistoryChart.js +2 -2
  8. package/src/commons/Device/ItemDevice.js +2 -2
  9. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +5 -1
  10. package/src/commons/SubUnit/Favorites/index.js +6 -2
  11. package/src/configs/API.js +4 -0
  12. package/src/configs/SCConfig.js +1 -1
  13. package/src/context/actionType.ts +5 -2
  14. package/src/context/mockStore.ts +17 -3
  15. package/src/context/reducer.ts +38 -4
  16. package/src/hooks/IoT/__test__/useValueEvaluation.test.js +58 -0
  17. package/src/hooks/IoT/index.js +2 -1
  18. package/src/hooks/IoT/useValueEvaluation.js +45 -0
  19. package/src/hooks/useReceiveNotifications.js +12 -18
  20. package/src/navigations/UnitStack.js +8 -0
  21. package/src/screens/AddNewAction/SelectAction.js +3 -2
  22. package/src/screens/AddNewAction/SetupSensor.js +3 -2
  23. package/src/screens/Device/detail.js +18 -27
  24. package/src/screens/Device/hooks/useEvaluateValue.js +97 -0
  25. package/src/screens/Device/hooks/useFavoriteDevice.js +2 -2
  26. package/src/screens/ScriptDetail/index.js +13 -3
  27. package/src/screens/Unit/Detail.js +10 -5
  28. package/src/screens/Unit/SelectAddress.js +1 -3
  29. package/src/screens/Unit/SelectDevices.js +158 -0
  30. package/src/screens/Unit/SelectDevicesStyles.js +40 -0
  31. package/src/screens/Unit/Summaries.js +1 -1
  32. package/src/screens/Unit/__test__/SelectAddress.test.js +90 -1
  33. package/src/screens/Unit/__test__/SelectDevices.test.js +110 -0
  34. package/src/screens/UnitSummary/components/RunningDevices/index.js +3 -1
  35. package/src/utils/Apis/axios.js +6 -0
  36. package/src/utils/I18n/translations/en.json +2 -0
  37. package/src/utils/I18n/translations/vi.json +2 -0
  38. package/src/utils/Route/index.js +1 -0
  39. package/src/utils/Validation.js +3 -0
@@ -995,5 +995,7 @@
995
995
  "detected": "Detected",
996
996
  "not_detected": "Not detected",
997
997
  "activated": "Activated",
998
+ "text_unit_add_to_favorites_no_devices": "You don't have any devices or all your devices was added to your favorites",
999
+ "not_found": "Not found",
998
1000
  "not_activated": "Not activated"
999
1001
  }
@@ -996,5 +996,7 @@
996
996
  "detected": "Phát hiện",
997
997
  "not_detected": "Không phát hiện",
998
998
  "activated": "Được kích hoạt",
999
+ "text_unit_add_to_favorites_no_devices": "Bạn không có thiết bị nào hoặc tất cả thiết bị của bạn đã được thêm vào yêu thích",
1000
+ "not_found": "Không tìm thấy",
999
1001
  "not_activated": "Không kích hoạt"
1000
1002
  }
@@ -146,6 +146,7 @@ const Routes = {
146
146
  ItemPasscode: 'ItemPasscode',
147
147
  UnitMemberInformation: 'UnitMemberInformation',
148
148
  EnterPassword: 'EnterPassword',
149
+ SelectDevices: 'SelectDevices',
149
150
  };
150
151
 
151
152
  export default Routes;
@@ -7,3 +7,6 @@ export const isValidPhoneNumber = (phoneNumber) => {
7
7
  export const isValidEmailAddress = (emailAddress) => {
8
8
  return /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(emailAddress);
9
9
  };
10
+
11
+ export const isHTML = (string) =>
12
+ /<[a-z]+\d?(\s+[\w-]+=("[^"]*"|'[^']*'))*\s*\/?>|&#?\w+;/i.test(string);