@eohjsc/react-native-smart-city 0.3.30 → 0.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -5
- package/src/Images/DevMode/close.png +0 -0
- package/src/Images/DevMode/close@2x.png +0 -0
- package/src/Images/DevMode/close@3x.png +0 -0
- package/src/Images/DevMode/plus.png +0 -0
- package/src/Images/DevMode/plus@2x.png +0 -0
- package/src/Images/DevMode/plus@3x.png +0 -0
- package/src/Images/DevMode/remove_circle.png +0 -0
- package/src/Images/DevMode/remove_circle@2x.png +0 -0
- package/src/Images/DevMode/remove_circle@3x.png +0 -0
- package/src/commons/Action/ItemQuickAction.js +20 -4
- package/src/commons/Action/__test__/ItemQuickAction.test.js +35 -11
- package/src/commons/ActionGroup/ColorPickerTemplate.js +36 -17
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +6 -6
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +23 -15
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +5 -2
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +10 -4
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +4 -4
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +38 -45
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLockStyle.js +1 -0
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +12 -6
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +8 -4
- package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +9 -10
- package/src/commons/ActionGroup/OnOffTemplate/index.js +30 -12
- package/src/commons/ActionGroup/OneBigButtonTemplate.js +5 -5
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +51 -28
- package/src/commons/ActionGroup/SliderRangeTemplate.js +2 -2
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +25 -9
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +13 -7
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +9 -5
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +25 -9
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +16 -6
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +10 -4
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/RectangleButton.js +7 -3
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +21 -7
- package/src/commons/ActionGroup/ThreeButtonTemplate.js +50 -60
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +135 -133
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +7 -7
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +3 -3
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +3 -3
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +9 -5
- package/src/commons/ActionGroup/__test__/index.test.js +7 -5
- package/src/commons/ActionGroup/index.js +35 -10
- package/src/commons/ActionTemplate/OnOffButtonAction.js +14 -5
- package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +23 -2
- package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
- package/src/commons/ActionTemplate/index.js +1 -0
- package/src/commons/AlertAction/index.js +2 -2
- package/src/commons/Auth/AccountItem.js +9 -3
- package/src/commons/Auth/__test__/AccountItem.test.js +6 -3
- package/src/commons/Automate/ItemAutomate.js +22 -3
- package/src/commons/BackDefault/index.js +2 -2
- package/src/commons/BottomButtonView/index.js +4 -5
- package/src/commons/Button/index.js +0 -2
- package/src/commons/ButtonPopup/index.js +3 -3
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +4 -2
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +6 -3
- package/src/commons/Dashboard/MyUnit/index.js +5 -3
- package/src/commons/DevMode/CardDevMode.js +42 -0
- package/src/commons/DevMode/EmptyComponent.js +18 -0
- package/src/commons/DevMode/Item.js +21 -0
- package/src/commons/DevMode/Styles/CardStyles.js +40 -0
- package/src/commons/DevMode/Styles/EmptyComponentStyles.js +15 -0
- package/src/commons/DevMode/Styles/ItemStyles.js +27 -0
- package/src/commons/DevMode/Styles/TextWithLabelStyles.js +36 -0
- package/src/commons/DevMode/TextWithLabel.js +30 -0
- package/src/commons/DevMode/index.js +5 -1
- package/src/commons/Device/ConnectedViewHeader.js +2 -2
- package/src/commons/Device/DeviceAlertStatus.js +3 -3
- package/src/commons/Device/DisconnectedView.js +2 -2
- package/src/commons/Device/Emergency/EmergencyButton.js +2 -2
- package/src/commons/Device/Emergency/EmergencyDetail.js +1 -1
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +3 -2
- package/src/commons/Device/FlatListItems.js +2 -2
- package/src/commons/Device/ItemAddNew/index.js +7 -12
- package/src/commons/Device/ItemDevice.js +16 -11
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +1 -1
- package/src/commons/Device/RainningSensor/CurrentRainSensor.js +1 -1
- package/src/commons/Device/SensorConnectedStatus.js +5 -2
- package/src/commons/Device/WindDirection/Compass/index.js +6 -3
- package/src/commons/Device/WindSpeed/Anemometer/index.js +1 -1
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +8 -4
- package/src/commons/Device/__test__/FlatListItems.test.js +3 -2
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +4 -2
- package/src/commons/Explore/ActivityIndicator/index.js +5 -2
- package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +3 -3
- package/src/commons/Explore/SearchBox/index.js +2 -2
- package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +4 -4
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +11 -8
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -2
- package/src/commons/FieldTemplate/PasscodeField/index.js +2 -2
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +12 -7
- package/src/commons/Form/TextInput.js +2 -2
- package/src/commons/Form/TextInputPassword.js +2 -2
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +5 -3
- package/src/commons/GroupCheckBox/index.js +2 -2
- package/src/commons/Header/HeaderCustom.js +8 -2
- package/src/commons/HeaderAni/index.js +2 -3
- package/src/commons/MediaPlayerDetail/index.js +2 -2
- package/src/commons/MenuActionList/index.js +2 -2
- package/src/commons/MenuActionMore/index.js +5 -4
- package/src/commons/NavBar/index.js +2 -3
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +12 -6
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +7 -3
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +4 -2
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +11 -8
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +9 -5
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +5 -3
- package/src/commons/Popover/index.js +2 -13
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +5 -3
- package/src/commons/PreventAccess/index.js +3 -3
- package/src/commons/{Connecting → Processing}/__test__/Connecting.test.js +5 -4
- package/src/commons/Processing/index.js +93 -0
- package/src/commons/{Connecting → Processing}/styles.js +9 -1
- package/src/commons/SelectGateway/index.js +105 -0
- package/src/commons/SelectGateway/styles.js +55 -0
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +106 -0
- package/src/commons/SelectSubUnit/index.js +124 -0
- package/src/commons/SelectSubUnit/styles.js +55 -0
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +120 -0
- package/src/commons/SelectUnit/index.js +106 -0
- package/src/commons/SelectUnit/styles.js +54 -0
- package/src/commons/Sharing/WrapHeaderScrollable.js +6 -4
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +4 -4
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +25 -10
- package/src/commons/SubUnit/OneTap/index.js +9 -4
- package/src/commons/SubUnit/ShortDetail.js +11 -29
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +15 -10
- package/src/commons/SummaryItem/index.js +2 -2
- package/src/commons/Tabbar/__test__/index.test.js +97 -0
- package/src/commons/Unit/HeaderUnit/index.js +4 -5
- package/src/commons/Unit/SharedUnit.js +10 -8
- package/src/commons/Unit/__test__/HeaderUnit.test.js +13 -5
- package/src/commons/Unit/__test__/SharedUnit.test.js +30 -11
- package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +13 -8
- package/src/commons/UnitSummary/AirQuality/index.js +7 -3
- package/src/commons/UnitSummary/TotalPowerBox.js +2 -2
- package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -2
- package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +3 -2
- package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +4 -2
- package/src/commons/ViewButtonBottom/index.js +4 -4
- package/src/commons/WheelDateTimePicker/index.js +5 -3
- package/src/commons/WrapParallaxScrollView/index.js +2 -1
- package/src/configs/API.js +12 -14
- package/src/configs/AccessibilityLabel.js +611 -0
- package/src/configs/Colors.js +4 -0
- package/src/configs/Constants.js +1 -604
- package/src/configs/Images.js +3 -0
- package/src/context/actionType.ts +19 -3
- package/src/context/mockStore.ts +18 -3
- package/src/context/reducer.ts +66 -9
- package/src/hoc/__test__/withRemoteControl.test.js +24 -0
- package/src/hoc/withRemoteControl.js +1 -0
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +55 -0
- package/src/hooks/Common/index.js +2 -2
- package/src/hooks/Common/useDevicesStatus.js +19 -15
- package/src/hooks/Common/{useGGHomeDeviceConnected.js → useHomeAssistantDeviceConnected.js} +3 -3
- package/src/hooks/Common/usePopover.js +6 -1
- package/src/hooks/IoT/__test__/{useGGHomeConnection.test.js → useHomeAssistantConnection.test.js} +18 -18
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +17 -12
- package/src/hooks/IoT/index.js +2 -2
- package/src/hooks/IoT/useHomeAssistantConnection.js +91 -0
- package/src/hooks/IoT/useRemoteControl.js +6 -6
- package/src/hooks/__test__/useInitDeepLink.test.js +28 -0
- package/src/hooks/useReceiveNotifications.js +2 -4
- package/src/iot/RemoteControl/{GoogleHome.js → HomeAssistant.js} +21 -17
- package/src/iot/RemoteControl/LG.js +2 -1
- package/src/iot/RemoteControl/__test__/{GoogleHome.test.js → HomeAssistant.test.js} +30 -30
- package/src/navigations/AddDeviceStack.js +0 -14
- package/src/navigations/AddGatewayStack.js +51 -21
- package/src/navigations/Main.js +28 -4
- package/src/navigations/SmartIrStack.js +3 -3
- package/src/navigations/UnitStack.js +1 -1
- package/src/screens/AQIGuide/__test__/AQIGuide.test.js +5 -3
- package/src/screens/AQIGuide/index.js +5 -3
- package/src/screens/ActivityLog/FilterPopup.js +2 -2
- package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
- package/src/screens/ActivityLog/__test__/index.test.js +3 -2
- package/src/screens/ActivityLog/index.js +3 -3
- package/src/screens/AddCommon/SelectSubUnit.js +44 -191
- package/src/screens/AddCommon/SelectUnit.js +51 -204
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +7 -50
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +28 -26
- package/src/screens/AddLocationMaps/__test__/index.test.js +13 -7
- package/src/screens/AddLocationMaps/index.js +3 -3
- package/src/screens/AddNewAction/Device/index.js +2 -2
- package/src/screens/AddNewAction/SelectAction.js +16 -7
- package/src/screens/AddNewAction/SelectSensorDevices.js +3 -3
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +2 -2
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +8 -3
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +11 -7
- package/src/screens/AddNewAutoSmart/index.js +9 -12
- package/src/screens/AddNewDevice/ConnectingDevices.js +1 -1
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +7 -4
- package/src/screens/AddNewDevice/index.js +4 -4
- package/src/screens/AddNewGateway/ConnectingDevice.js +40 -0
- package/src/screens/AddNewGateway/ConnectingModbusDevice.js +61 -0
- package/src/screens/AddNewGateway/ConnectingWifiDevice.js +70 -0
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +60 -0
- package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +21 -8
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +23 -4
- package/src/screens/AddNewGateway/RenameNewDevices.js +141 -0
- package/src/screens/AddNewGateway/RenameNewDevicesStyles.js +75 -0
- package/src/screens/AddNewGateway/ScanGatewayQR.js +57 -0
- package/src/screens/AddNewGateway/ScanModbusQR.js +53 -0
- package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +55 -0
- package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +31 -0
- package/src/screens/AddNewGateway/SelectDeviceType.js +52 -0
- package/src/screens/AddNewGateway/SelectDeviceUnit.js +29 -0
- package/src/screens/AddNewGateway/SelectModbusGateway.js +34 -0
- package/src/screens/AddNewGateway/SelectZigbeeGateway.js +34 -0
- package/src/screens/AddNewGateway/ShareWifiPassword.js +302 -0
- package/src/screens/AddNewGateway/ShareWifiPasswordStyles.js +44 -0
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -4
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +63 -0
- package/src/screens/AddNewGateway/__test__/{SelectGateway.test.js → ConnectingWifiDevice.test.js} +15 -10
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +62 -0
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +191 -0
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +73 -0
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +75 -0
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +73 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +47 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +89 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +48 -0
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +77 -0
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +77 -0
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +294 -0
- package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +27 -0
- package/src/screens/AddNewGateway/index.js +4 -4
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +5 -4
- package/src/screens/AddNewOneTap/index.js +4 -4
- package/src/screens/Automate/__test__/index.test.js +2 -2
- package/src/screens/Automate/index.js +6 -2
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +3 -2
- package/src/screens/ConfirmUnitDeletion/index.js +3 -3
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +5 -5
- package/src/screens/Device/EditDevice/index.js +3 -3
- package/src/screens/Device/__test__/detail.test.js +38 -22
- package/src/screens/Device/components/DetailHistoryChart.js +7 -5
- package/src/screens/Device/components/SensorConnectStatusViewHeader.js +6 -6
- package/src/screens/Device/components/SensorDisplayItem.js +51 -26
- package/src/screens/Device/detail.js +31 -23
- package/src/screens/Device/hooks/useEvaluateValue.js +0 -2
- package/src/screens/DeviceInfo/__test__/index.test.js +8 -4
- package/src/screens/DeviceInfo/index.js +10 -6
- package/src/screens/Drawer/index.js +30 -13
- package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +8 -4
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -1
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +5 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +9 -5
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +7 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -3
- package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +3 -2
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +6 -3
- package/src/screens/EnterPassword/index.js +5 -3
- package/src/screens/GuestInfo/__test__/index.test.js +18 -12
- package/src/screens/GuestInfo/components/AccessScheduleItem.js +2 -2
- package/src/screens/GuestInfo/components/AccessScheduleSheet.js +3 -3
- package/src/screens/GuestInfo/components/HeaderGuestInfo.js +2 -2
- package/src/screens/GuestInfo/components/RecurringDetail.js +4 -4
- package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -3
- package/src/screens/GuestInfo/index.js +1 -1
- package/src/screens/HanetCamera/Detail.js +10 -4
- package/src/screens/HanetCamera/ManageAccess.js +4 -4
- package/src/screens/HanetCamera/MemberInfo.js +1 -1
- package/src/screens/HanetCamera/__test__/Detail.test.js +5 -3
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +10 -4
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +4 -2
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
- package/src/screens/ManageAccess/index.js +1 -1
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +4 -4
- package/src/screens/MoveToAnotherSubUnit/index.js +2 -2
- package/src/screens/PlayBackCamera/__test__/index.test.js +9 -6
- package/src/screens/PlayBackCamera/index.js +6 -6
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
- package/src/screens/ScanChipQR/components/QRScan/index.js +10 -3
- package/src/screens/ScriptDetail/__test__/index.test.js +43 -38
- package/src/screens/ScriptDetail/index.js +26 -16
- package/src/screens/SelectUnit/__test__/index.test.js +4 -3
- package/src/screens/SelectUnit/index.js +3 -3
- package/src/screens/SetSchedule/index.js +1 -1
- package/src/screens/Sharing/Components/{SensorItem.js → DeviceItem.js} +16 -22
- package/src/screens/Sharing/Components/Styles/{SensorItemStyles.js → DeviceItemStyles.js} +0 -0
- package/src/screens/Sharing/Components/__test__/{SensorItem.test.js → DeviceItem.test.js} +10 -8
- package/src/screens/Sharing/Components/index.js +2 -2
- package/src/screens/Sharing/InfoMemberUnit.js +7 -6
- package/src/screens/Sharing/MemberList.js +4 -4
- package/src/screens/Sharing/SelectPermission.js +72 -72
- package/src/screens/Sharing/SelectUser.js +9 -5
- package/src/screens/Sharing/Styles/SelectPermissionStyles.js +2 -2
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +3 -2
- package/src/screens/Sharing/__test__/SelectPermission.test.js +12 -12
- package/src/screens/Sharing/__test__/SelectUser.test.js +7 -4
- package/src/screens/SideMenuDetail/__test__/index.test.js +11 -7
- package/src/screens/SideMenuDetail/index.js +2 -2
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +4 -2
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
- package/src/screens/SmartIr/__test__/SmartIr.test.js +14 -6
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +4 -2
- package/src/screens/SmartIr/components/{SelectDeviceType.js → SelectIrDeviceType.js} +2 -2
- package/src/screens/SmartIr/index.js +1 -1
- package/src/screens/SubUnit/AddSubUnit.js +7 -3
- package/src/screens/SubUnit/Detail.js +6 -6
- package/src/screens/SubUnit/EditSubUnit.js +10 -6
- package/src/screens/SubUnit/ManageSubUnit.js +2 -2
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +6 -3
- package/src/screens/SubUnit/__test__/Detail.test.js +5 -3
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +9 -5
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +3 -2
- package/src/screens/SyncLGDevice/AddLGDevice.js +4 -4
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -4
- package/src/screens/TDSGuide/__test__/TDSGuide.test.js +4 -2
- package/src/screens/TDSGuide/index.js +2 -2
- package/src/screens/Template/EditTemplate.js +152 -0
- package/src/screens/Template/GatewayList.js +51 -0
- package/src/screens/Template/Information.js +41 -0
- package/src/screens/Template/Styles/EditTemplateStyle.js +109 -0
- package/src/screens/Template/Styles/GatewayStyles.js +46 -0
- package/src/screens/Template/Styles/InformationStyles.js +16 -0
- package/src/screens/Template/Styles/detailStyles.js +35 -0
- package/src/screens/Template/Styles/indexStyles.js +2 -33
- package/src/screens/Template/__test__/EditTemplate.test.js +89 -0
- package/src/screens/Template/__test__/GatewayList.test.js +26 -0
- package/src/screens/Template/__test__/Information.test.js +16 -0
- package/src/screens/Template/__test__/detail.test.js +68 -0
- package/src/screens/Template/__test__/index.test.js +26 -1
- package/src/screens/Template/detail.js +154 -0
- package/src/screens/Template/index.js +38 -32
- package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -2
- package/src/screens/UVIndexGuide/index.js +2 -2
- package/src/screens/Unit/AddMenu.js +6 -20
- package/src/screens/Unit/ChooseLocation.js +1 -1
- package/src/screens/Unit/Detail.js +10 -10
- package/src/screens/Unit/ManageUnit.js +21 -15
- package/src/screens/Unit/MyAllUnit/index.js +1 -1
- package/src/screens/Unit/SelectAddToFavorites.js +7 -8
- package/src/screens/Unit/SelectAddress.js +4 -4
- package/src/screens/Unit/SmartAccount.js +1 -1
- package/src/screens/Unit/SmartAccountItem.js +3 -3
- package/src/screens/Unit/Station/__test__/index.test.js +19 -3
- package/src/screens/Unit/Station/index.js +2 -2
- package/src/screens/Unit/Summaries.js +2 -2
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +6 -6
- package/src/screens/Unit/__test__/Detail.test.js +90 -55
- package/src/screens/Unit/__test__/ManageUnit.test.js +40 -18
- package/src/screens/Unit/__test__/SelectAddress.test.js +15 -8
- package/src/screens/Unit/__test__/SmartAccount.test.js +42 -25
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +4 -3
- package/src/screens/Unit/components/AutomateScript/index.js +5 -2
- package/src/screens/Unit/components/ListMyAllUnit/index.js +1 -1
- package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +9 -5
- package/src/screens/Unit/components/MyAllUnit/index.js +1 -1
- package/src/screens/Unit/components/MyUnitDevice/index.js +8 -5
- package/src/screens/Unit/components/SharedUnit/index.js +12 -6
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +24 -9
- package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +25 -11
- package/src/screens/UnitSummary/__test__/index.test.js +4 -2
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +5 -4
- package/src/screens/UnitSummary/components/RunningDevices/index.js +6 -3
- package/src/screens/UnitSummary/components/TotalPowerBox/index.js +2 -2
- package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +3 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/index.js +10 -8
- package/src/screens/WaterQualityGuide/__test__/index.test.js +17 -12
- package/src/screens/WaterQualityGuide/index.js +26 -10
- package/src/utils/Apis/axios.js +1 -0
- package/src/utils/I18n/translations/en.json +20 -10
- package/src/utils/I18n/translations/vi.json +17 -9
- package/src/utils/Route/index.js +22 -10
- package/src/utils/Utils.js +6 -7
- package/src/commons/Connecting/index.js +0 -67
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +0 -28
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +0 -41
- package/src/commons/ConnectingProcess/__test__/Connecting.test.js +0 -163
- package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +0 -19
- package/src/commons/ConnectingProcess/index.js +0 -213
- package/src/commons/ConnectingProcess/styles.js +0 -69
- package/src/hooks/IoT/useGGHomeConnection.js +0 -91
- package/src/iot/RemoteControl/index.js +0 -55
- package/src/screens/AddNewDevice/ConnectDevices.js +0 -184
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -131
- package/src/screens/AddNewGateway/ConnectedGateway.js +0 -139
- package/src/screens/AddNewGateway/ConnectingGateway.js +0 -137
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +0 -214
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +0 -319
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectWifiWarning.test.js +0 -75
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +0 -130
- package/src/screens/AddNewGateway/SelectGateway.js +0 -133
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +0 -207
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -71
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +0 -96
- package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -120
- package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +0 -115
- package/src/screens/ScanChipQR/hooks/index.js +0 -120
- package/src/screens/ScanChipQR/index.js +0 -29
- package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +0 -111
- package/src/screens/ScanSensorQR/hooks/index.js +0 -40
- package/src/screens/ScanSensorQR/index.js +0 -39
|
@@ -20,7 +20,7 @@ const AlertAction = ({
|
|
|
20
20
|
rightButtonStyle,
|
|
21
21
|
onHide,
|
|
22
22
|
children,
|
|
23
|
-
|
|
23
|
+
accessibilityLabelPrefix = '',
|
|
24
24
|
animatedStyle,
|
|
25
25
|
boxLeftButtonStyle,
|
|
26
26
|
boxRightButtonStyle,
|
|
@@ -58,7 +58,7 @@ const AlertAction = ({
|
|
|
58
58
|
styleButtonRightText={rightButtonStyle}
|
|
59
59
|
styleButtonLeft={boxLeftButtonStyle}
|
|
60
60
|
styleButtonRight={boxRightButtonStyle}
|
|
61
|
-
|
|
61
|
+
accessibilityLabelPrefix={accessibilityLabelPrefix}
|
|
62
62
|
/>
|
|
63
63
|
</View>
|
|
64
64
|
</Animated.View>
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { View, StyleSheet, Text } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { Colors } from '../../configs';
|
|
5
|
+
import { shortEmailName } from '../../utils/Utils';
|
|
5
6
|
import Avatar from '../../../assets/images/avatar.svg';
|
|
6
7
|
|
|
7
8
|
const AccountItem = ({ account }) => {
|
|
@@ -12,10 +13,15 @@ const AccountItem = ({ account }) => {
|
|
|
12
13
|
</View>
|
|
13
14
|
<View style={styles.space} />
|
|
14
15
|
<View style={styles.wrap}>
|
|
15
|
-
{account
|
|
16
|
-
<Text style={{ color: Colors.Gray9 }}>
|
|
16
|
+
{(account?.name || account?.email) && (
|
|
17
|
+
<Text style={{ color: Colors.Gray9 }}>
|
|
18
|
+
{account?.name || shortEmailName(account?.email)}
|
|
19
|
+
</Text>
|
|
20
|
+
)}
|
|
21
|
+
|
|
22
|
+
{account?.phone_number && (
|
|
23
|
+
<Text style={{ color: Colors.Gray8 }}>{account?.phone_number}</Text>
|
|
17
24
|
)}
|
|
18
|
-
<Text style={{ color: Colors.Gray8 }}>{account.phone_number}</Text>
|
|
19
25
|
</View>
|
|
20
26
|
</View>
|
|
21
27
|
);
|
|
@@ -5,7 +5,7 @@ import AccountItem from '../AccountItem';
|
|
|
5
5
|
|
|
6
6
|
describe('Test AccountItem', () => {
|
|
7
7
|
let wrapper;
|
|
8
|
-
test('create AccountItem', () => {
|
|
8
|
+
test('create AccountItem invalid', () => {
|
|
9
9
|
act(() => {
|
|
10
10
|
wrapper = renderer.create(
|
|
11
11
|
<AccountItem key={'account'} account={'account'} />
|
|
@@ -13,12 +13,15 @@ describe('Test AccountItem', () => {
|
|
|
13
13
|
});
|
|
14
14
|
const instance = wrapper.root;
|
|
15
15
|
const text = instance.findAllByType(Text);
|
|
16
|
-
expect(text.length).toBe(
|
|
16
|
+
expect(text.length).toBe(0);
|
|
17
17
|
});
|
|
18
18
|
test('create AccountItem account', () => {
|
|
19
19
|
act(() => {
|
|
20
20
|
wrapper = renderer.create(
|
|
21
|
-
<AccountItem
|
|
21
|
+
<AccountItem
|
|
22
|
+
key={'account'}
|
|
23
|
+
account={{ name: 'name', phone_number: '098xxxx' }}
|
|
24
|
+
/>
|
|
22
25
|
);
|
|
23
26
|
});
|
|
24
27
|
const instance = wrapper.root;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
3
|
import Text from '../Text';
|
|
4
4
|
import { Colors } from '../../configs';
|
|
@@ -9,9 +9,11 @@ import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
|
9
9
|
const ItemAutomate = ({
|
|
10
10
|
type,
|
|
11
11
|
isSelected = false,
|
|
12
|
-
onPress = () => {},
|
|
13
12
|
disabledOnPress = false,
|
|
14
13
|
textCondition,
|
|
14
|
+
index,
|
|
15
|
+
setSelectedIndex,
|
|
16
|
+
onPress,
|
|
15
17
|
}) => {
|
|
16
18
|
const t = useTranslations();
|
|
17
19
|
const item = AUTOMATES[type];
|
|
@@ -28,9 +30,26 @@ const ItemAutomate = ({
|
|
|
28
30
|
}
|
|
29
31
|
}, [isItemOneTap, isSelected, item?.explanation, t, textCondition]);
|
|
30
32
|
|
|
33
|
+
const handleSelectIndex = useCallback(() => {
|
|
34
|
+
if (onPress) {
|
|
35
|
+
onPress();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!setSelectedIndex) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
setSelectedIndex((currentIndex) => {
|
|
43
|
+
if (currentIndex !== index) {
|
|
44
|
+
return index;
|
|
45
|
+
}
|
|
46
|
+
return -1;
|
|
47
|
+
});
|
|
48
|
+
}, [index, setSelectedIndex, onPress]);
|
|
49
|
+
|
|
31
50
|
return (
|
|
32
51
|
<TouchableOpacity
|
|
33
|
-
onPress={
|
|
52
|
+
onPress={handleSelectIndex}
|
|
34
53
|
disabled={disabledOnPress}
|
|
35
54
|
style={[styles.wrap, isSelected && styles.active]}
|
|
36
55
|
>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
5
5
|
|
|
6
6
|
const BackDefault = memo(({ goBack, color, fixedHeight }) => {
|
|
7
7
|
return (
|
|
8
8
|
<TouchableOpacity
|
|
9
|
-
|
|
9
|
+
accessibilityLabel={AccessibilityLabel.BACK_DEFAULT_TOUCH}
|
|
10
10
|
onPress={goBack}
|
|
11
11
|
style={[styles.wrap, fixedHeight && styles.noPaddingVertical]}
|
|
12
12
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
5
5
|
import Button from '../Button';
|
|
6
6
|
|
|
7
7
|
const BottomButtonView = memo(
|
|
@@ -19,7 +19,7 @@ const BottomButtonView = memo(
|
|
|
19
19
|
textTypeMain = 'H4',
|
|
20
20
|
typeMain = 'primary',
|
|
21
21
|
typeSecondary = 'cancel',
|
|
22
|
-
|
|
22
|
+
accessibilityLabelPrefix = '',
|
|
23
23
|
}) => {
|
|
24
24
|
return (
|
|
25
25
|
<View
|
|
@@ -41,8 +41,7 @@ const BottomButtonView = memo(
|
|
|
41
41
|
textSemiBold={semiboldMain}
|
|
42
42
|
textType={textTypeMain}
|
|
43
43
|
style={rowButton && styleCustom.buttonMainRow}
|
|
44
|
-
|
|
45
|
-
accessibilityLabel={TESTID.BOTTOM_VIEW_MAIN}
|
|
44
|
+
accessibilityLabel={`${accessibilityLabelPrefix}${AccessibilityLabel.BOTTOM_VIEW_MAIN}`}
|
|
46
45
|
/>
|
|
47
46
|
)}
|
|
48
47
|
{secondaryTitle && (
|
|
@@ -56,7 +55,7 @@ const BottomButtonView = memo(
|
|
|
56
55
|
? styleCustom.buttonSecondaryRow
|
|
57
56
|
: styleCustom.buttonSecondaryColumn
|
|
58
57
|
}
|
|
59
|
-
|
|
58
|
+
accessibilityLabel={`${accessibilityLabelPrefix}${AccessibilityLabel.BOTTOM_VIEW_SECONDARY}`}
|
|
60
59
|
/>
|
|
61
60
|
)}
|
|
62
61
|
</View>
|
|
@@ -132,7 +132,6 @@ export default ({
|
|
|
132
132
|
textType = 'H4',
|
|
133
133
|
textSemiBold = true,
|
|
134
134
|
style,
|
|
135
|
-
testID,
|
|
136
135
|
accessibilityLabel,
|
|
137
136
|
}) => {
|
|
138
137
|
const styleButton = ButtonStyle[type];
|
|
@@ -145,7 +144,6 @@ export default ({
|
|
|
145
144
|
const PreventDoubleTouch = withPreventDoubleClick(TouchableOpacity);
|
|
146
145
|
return (
|
|
147
146
|
<PreventDoubleTouch
|
|
148
|
-
testID={testID}
|
|
149
147
|
style={[
|
|
150
148
|
{
|
|
151
149
|
width,
|
|
@@ -3,7 +3,7 @@ import { StyleSheet, View } from 'react-native';
|
|
|
3
3
|
import { Icon } from '@ant-design/react-native';
|
|
4
4
|
|
|
5
5
|
import { Colors, Device } from '../../configs';
|
|
6
|
-
import {
|
|
6
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
7
7
|
|
|
8
8
|
import BottomButtonView from '../BottomButtonView';
|
|
9
9
|
import { ModalCustom } from '../Modal';
|
|
@@ -35,7 +35,7 @@ const ButtonPopup = ({
|
|
|
35
35
|
onModalHide={onHide}
|
|
36
36
|
useNativeDriver={true}
|
|
37
37
|
useNativeDriverForBackdrop={true}
|
|
38
|
-
|
|
38
|
+
accessibilityLabel={AccessibilityLabel.MODAL_BUTTON_POPUP}
|
|
39
39
|
>
|
|
40
40
|
<View style={styles.popoverStyle}>
|
|
41
41
|
<View style={styles.modalWrapper}>
|
|
@@ -57,7 +57,7 @@ const ButtonPopup = ({
|
|
|
57
57
|
onPressMain={onPressMain}
|
|
58
58
|
typeMain={typeMain}
|
|
59
59
|
typeSecondary={typeSecondary}
|
|
60
|
-
|
|
60
|
+
accessibilityLabelPrefix={AccessibilityLabel.PREFIX.BUTTON_POPUP}
|
|
61
61
|
semiboldSecond={semiboldSecond}
|
|
62
62
|
/>
|
|
63
63
|
{thirdTitle && (
|
|
@@ -7,7 +7,7 @@ import { Text } from 'react-native';
|
|
|
7
7
|
import { getTranslate } from '../../../../utils/I18n';
|
|
8
8
|
import { SCProvider } from '../../../../context';
|
|
9
9
|
import { mockSCStore } from '../../../../context/mockStore';
|
|
10
|
-
import {
|
|
10
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
11
11
|
import { API } from '../../../../configs';
|
|
12
12
|
import { TouchableOpacity } from 'react-native';
|
|
13
13
|
import api from '../../../../utils/Apis/axios';
|
|
@@ -51,7 +51,8 @@ describe('Test MyPinnedSharedUnit', () => {
|
|
|
51
51
|
|
|
52
52
|
const goToAllSharedUnits = instance.find(
|
|
53
53
|
(el) =>
|
|
54
|
-
el.props.
|
|
54
|
+
el.props.accessibilityLabel ===
|
|
55
|
+
AccessibilityLabel.DASHBOARD_VIEW_ALL_SHARED_UNITS &&
|
|
55
56
|
el.type === TouchableOpacity
|
|
56
57
|
);
|
|
57
58
|
|
|
@@ -7,7 +7,7 @@ import Text from '../../Text';
|
|
|
7
7
|
import { API, Colors } from '../../../configs';
|
|
8
8
|
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
9
9
|
import Routes from '../../../utils/Route';
|
|
10
|
-
import {
|
|
10
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
11
11
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
12
12
|
import SharedUnit from '../../Unit/SharedUnit';
|
|
13
13
|
import { fetchWithCache } from '../../../utils/Apis/axios';
|
|
@@ -50,7 +50,9 @@ const MyPinnedSharedUnit = () => {
|
|
|
50
50
|
|
|
51
51
|
<TouchableOpacity
|
|
52
52
|
onPress={goToAllSharedUnits}
|
|
53
|
-
|
|
53
|
+
accessibilityLabel={
|
|
54
|
+
AccessibilityLabel.DASHBOARD_VIEW_ALL_SHARED_UNITS
|
|
55
|
+
}
|
|
54
56
|
>
|
|
55
57
|
<Text color={Colors.Primary} style={styles.viewAll}>
|
|
56
58
|
{t('view_all')}
|
|
@@ -3,7 +3,7 @@ import renderer, { act } from 'react-test-renderer';
|
|
|
3
3
|
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
import MyUnit from '..';
|
|
5
5
|
import MyUnitDevice from '../../../../screens/Unit/components/MyUnitDevice';
|
|
6
|
-
import {
|
|
6
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
7
7
|
import { SCProvider } from '../../../../context';
|
|
8
8
|
import { mockSCStore } from '../../../../context/mockStore';
|
|
9
9
|
import api from '../../../../utils/Apis/axios';
|
|
@@ -76,10 +76,13 @@ describe('Test MyUnit', () => {
|
|
|
76
76
|
|
|
77
77
|
const getElement = (instance) => {
|
|
78
78
|
const goToDetail = instance.findAll(
|
|
79
|
-
(item) =>
|
|
79
|
+
(item) =>
|
|
80
|
+
item.props.accessibilityLabel ===
|
|
81
|
+
AccessibilityLabel.MY_UNIT_GO_TO_DETAIL
|
|
80
82
|
);
|
|
81
83
|
const textNoUnit = instance.findAll(
|
|
82
|
-
(item) =>
|
|
84
|
+
(item) =>
|
|
85
|
+
item.props.accessibilityLabel === AccessibilityLabel.MY_UNIT_NO_UNIT
|
|
83
86
|
);
|
|
84
87
|
return { goToDetail, textNoUnit };
|
|
85
88
|
};
|
|
@@ -26,7 +26,7 @@ import { SCContext } from '../../../context';
|
|
|
26
26
|
import { Action } from '../../../context/actionType';
|
|
27
27
|
|
|
28
28
|
import Carousel from 'react-native-snap-carousel';
|
|
29
|
-
import {
|
|
29
|
+
import { AccessibilityLabel, DEVICE_TYPE } from '../../../configs/Constants';
|
|
30
30
|
import Routes from '../../../utils/Route';
|
|
31
31
|
import MyUnitDevice from '../../../screens/Unit/components/MyUnitDevice';
|
|
32
32
|
|
|
@@ -107,7 +107,7 @@ const MyUnit = () => {
|
|
|
107
107
|
onPress={() => goToDetail(item)}
|
|
108
108
|
style={styles.btnItem}
|
|
109
109
|
activeOpacity={0.75}
|
|
110
|
-
|
|
110
|
+
accessibilityLabel={AccessibilityLabel.MY_UNIT_GO_TO_DETAIL}
|
|
111
111
|
>
|
|
112
112
|
<View style={styles.overlay} />
|
|
113
113
|
<Image
|
|
@@ -146,7 +146,9 @@ const MyUnit = () => {
|
|
|
146
146
|
/>
|
|
147
147
|
) : (
|
|
148
148
|
<View>
|
|
149
|
-
<Text
|
|
149
|
+
<Text accessibilityLabel={AccessibilityLabel.MY_UNIT_NO_UNIT}>
|
|
150
|
+
{t('text_no_units')}
|
|
151
|
+
</Text>
|
|
150
152
|
</View>
|
|
151
153
|
)}
|
|
152
154
|
</View>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import Text from '../Text';
|
|
4
|
+
import { useSCContextSelector } from '../../context';
|
|
5
|
+
import t from '../../hooks/Common/useTranslations';
|
|
6
|
+
import styles from './Styles/CardStyles';
|
|
7
|
+
|
|
8
|
+
const CardDevMode = ({
|
|
9
|
+
title = t('label'),
|
|
10
|
+
children,
|
|
11
|
+
style,
|
|
12
|
+
rightHeaderComponent,
|
|
13
|
+
id,
|
|
14
|
+
isWrap,
|
|
15
|
+
}) => {
|
|
16
|
+
const { itemDraggingId, isEditingTemplate, isInEditTemplateScreen } =
|
|
17
|
+
useSCContextSelector((state) => state.devMode);
|
|
18
|
+
|
|
19
|
+
if (isEditingTemplate || isWrap) {
|
|
20
|
+
return (
|
|
21
|
+
<View
|
|
22
|
+
style={[
|
|
23
|
+
styles.card,
|
|
24
|
+
isEditingTemplate && styles.isEditingTemplate,
|
|
25
|
+
style,
|
|
26
|
+
id === itemDraggingId && styles.activeCard,
|
|
27
|
+
]}
|
|
28
|
+
>
|
|
29
|
+
<View style={styles.headerTitle}>
|
|
30
|
+
<Text style={styles.headerLeft}>{title}</Text>
|
|
31
|
+
{!!rightHeaderComponent && rightHeaderComponent}
|
|
32
|
+
</View>
|
|
33
|
+
{children}
|
|
34
|
+
{/* // NOTE: For user can not control sensor at EditTemplateScreen */}
|
|
35
|
+
{isInEditTemplateScreen && <View style={styles.editing} />}
|
|
36
|
+
</View>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return children;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default memo(CardDevMode);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import Text from '../Text';
|
|
3
|
+
import t from '../../hooks/Common/useTranslations';
|
|
4
|
+
import styles from './Styles/EmptyComponentStyles';
|
|
5
|
+
|
|
6
|
+
const EmptyComponent = ({
|
|
7
|
+
text1 = t('no_template_yet'),
|
|
8
|
+
text2 = t('add_your_template'),
|
|
9
|
+
}) => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<Text style={styles.textEmpty1}>{text1}</Text>
|
|
13
|
+
<Text style={styles.textEmpty2}>{text2}</Text>
|
|
14
|
+
</>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default memo(EmptyComponent);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { TouchableOpacity } from 'react-native';
|
|
3
|
+
import Text from '../Text';
|
|
4
|
+
import t from '../../hooks/Common/useTranslations';
|
|
5
|
+
import styles from './Styles/ItemStyles';
|
|
6
|
+
|
|
7
|
+
const Item = ({ item, index, onPress }) => {
|
|
8
|
+
return (
|
|
9
|
+
<TouchableOpacity
|
|
10
|
+
onPress={onPress}
|
|
11
|
+
style={[styles.item, index % 2 === 0 && styles.oddItem]}
|
|
12
|
+
>
|
|
13
|
+
<Text style={styles.nameItem}>{item?.name}</Text>
|
|
14
|
+
<Text style={styles.countItem}>{`${
|
|
15
|
+
item?.count > 0 ? item?.count : t('no')
|
|
16
|
+
} ${t('gateways').toLowerCase()}`}</Text>
|
|
17
|
+
</TouchableOpacity>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default memo(Item);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors } from '../../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
card: {
|
|
6
|
+
marginVertical: 14,
|
|
7
|
+
marginHorizontal: 16,
|
|
8
|
+
padding: 16,
|
|
9
|
+
backgroundColor: Colors.White,
|
|
10
|
+
borderRadius: 10,
|
|
11
|
+
shadowColor: Colors.Shadow,
|
|
12
|
+
shadowOffset: {
|
|
13
|
+
width: 0,
|
|
14
|
+
height: 2,
|
|
15
|
+
},
|
|
16
|
+
shadowOpacity: 0.1,
|
|
17
|
+
shadowRadius: 3,
|
|
18
|
+
elevation: 6,
|
|
19
|
+
},
|
|
20
|
+
headerTitle: { justifyContent: 'space-between', flexDirection: 'row' },
|
|
21
|
+
headerLeft: {
|
|
22
|
+
color: Colors.Gray8,
|
|
23
|
+
fontSize: 16,
|
|
24
|
+
lineHeight: 24,
|
|
25
|
+
},
|
|
26
|
+
activeCard: {
|
|
27
|
+
borderWidth: 1,
|
|
28
|
+
borderColor: Colors.Red,
|
|
29
|
+
},
|
|
30
|
+
editing: {
|
|
31
|
+
width: '100%',
|
|
32
|
+
height: '100%',
|
|
33
|
+
zIndex: 9999,
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
},
|
|
36
|
+
isEditingTemplate: {
|
|
37
|
+
borderWidth: 1,
|
|
38
|
+
borderColor: Colors.Neutral.Neutral3,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors } from '../../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
textEmpty1: {
|
|
6
|
+
fontSize: 20,
|
|
7
|
+
fontWeight: 'bold',
|
|
8
|
+
},
|
|
9
|
+
textEmpty2: {
|
|
10
|
+
fontSize: 14,
|
|
11
|
+
fontWeight: '400',
|
|
12
|
+
color: Colors.Neutral.Neutral5,
|
|
13
|
+
marginTop: 7,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors, Constants } from '../../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
item: {
|
|
6
|
+
width: (Constants.width - 42) / 2,
|
|
7
|
+
height: 128,
|
|
8
|
+
borderRadius: 8,
|
|
9
|
+
borderWidth: 1,
|
|
10
|
+
borderColor: Colors.Neutral.Neutral3,
|
|
11
|
+
marginBottom: 16,
|
|
12
|
+
justifyContent: 'space-around',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
},
|
|
15
|
+
oddItem: {
|
|
16
|
+
marginRight: 10,
|
|
17
|
+
},
|
|
18
|
+
nameItem: {
|
|
19
|
+
fontSize: 14,
|
|
20
|
+
fontWeight: 'bold',
|
|
21
|
+
},
|
|
22
|
+
countItem: {
|
|
23
|
+
fontSize: 12,
|
|
24
|
+
fontWeight: 400,
|
|
25
|
+
color: Colors.Neutral.Neutral5,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors } from '../../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
wrap: {
|
|
6
|
+
marginBottom: 16,
|
|
7
|
+
},
|
|
8
|
+
label: {
|
|
9
|
+
fontSize: 12,
|
|
10
|
+
fontWeight: '400',
|
|
11
|
+
color: Colors.Neutral.Neutral5,
|
|
12
|
+
marginBottom: 8,
|
|
13
|
+
},
|
|
14
|
+
box: {
|
|
15
|
+
borderRadius: 8,
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
borderColor: Colors.Neutral.Neutral3,
|
|
18
|
+
height: 45,
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
paddingHorizontal: 16,
|
|
21
|
+
backgroundColor: Colors.White,
|
|
22
|
+
},
|
|
23
|
+
disable: {
|
|
24
|
+
backgroundColor: Colors.Neutral.Neutral3,
|
|
25
|
+
borderColor: Colors.Neutral.Neutral4,
|
|
26
|
+
},
|
|
27
|
+
textDisable: {
|
|
28
|
+
color: Colors.Neutral.Neutral5,
|
|
29
|
+
},
|
|
30
|
+
text: {
|
|
31
|
+
fontSize: 16,
|
|
32
|
+
fontWeight: '100',
|
|
33
|
+
lineHeight: 22,
|
|
34
|
+
color: Colors.BlackRussian,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import Text from '../Text';
|
|
4
|
+
import styles from './Styles/TextWithLabelStyles';
|
|
5
|
+
|
|
6
|
+
const TextWithLabel = ({
|
|
7
|
+
label = '',
|
|
8
|
+
text = '',
|
|
9
|
+
isDisable = false,
|
|
10
|
+
isBox = false,
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<View style={styles.wrap}>
|
|
14
|
+
<Text style={styles.label}>{label}</Text>
|
|
15
|
+
{!isBox ? (
|
|
16
|
+
<Text numberOfLines={5} style={styles.text}>
|
|
17
|
+
{text}
|
|
18
|
+
</Text>
|
|
19
|
+
) : (
|
|
20
|
+
<View style={[styles.box, isDisable && styles.disable]}>
|
|
21
|
+
<Text numberOfLines={1} style={[isDisable && styles.textDisable]}>
|
|
22
|
+
{text}
|
|
23
|
+
</Text>
|
|
24
|
+
</View>
|
|
25
|
+
)}
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default memo(TextWithLabel);
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import Item from './Item';
|
|
1
2
|
import Label from './Label';
|
|
3
|
+
import Search from './Search';
|
|
4
|
+
import EmptyComponent from './EmptyComponent';
|
|
5
|
+
import CardDevMode from './CardDevMode';
|
|
2
6
|
|
|
3
|
-
export { Label };
|
|
7
|
+
export { Label, Search, Item, EmptyComponent, CardDevMode };
|
|
@@ -11,8 +11,8 @@ const DisplayTextConnected = memo(({ type }) => {
|
|
|
11
11
|
const t = useTranslations();
|
|
12
12
|
let text = '';
|
|
13
13
|
switch (type) {
|
|
14
|
-
case '
|
|
15
|
-
text = t('
|
|
14
|
+
case 'HomeAssistant':
|
|
15
|
+
text = t('home_assistant_connected');
|
|
16
16
|
break;
|
|
17
17
|
case 'Bluetooth':
|
|
18
18
|
text = t('connected_via_bluetooth');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { memo, useEffect } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import AlertStatusMachine from './WaterPurifierStatus/AlertStatusMachine';
|
|
4
|
-
import {
|
|
4
|
+
import { AccessibilityLabel } from '../../configs/Constants';
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
6
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
7
7
|
|
|
8
8
|
const DeviceAlertStatus = memo(
|
|
9
|
-
({ data, style, offsetTitle, setOffsetTitle }) => {
|
|
9
|
+
({ data = [], style, offsetTitle, setOffsetTitle }) => {
|
|
10
10
|
const t = useTranslations();
|
|
11
11
|
const listStatus = data.filter((item) => item.value === 1);
|
|
12
12
|
|
|
@@ -74,7 +74,7 @@ const DeviceAlertStatus = memo(
|
|
|
74
74
|
{listStatus &&
|
|
75
75
|
listStatus.map((status) => (
|
|
76
76
|
<AlertStatusMachine
|
|
77
|
-
|
|
77
|
+
accessibilityLabel={AccessibilityLabel.ALERT_STATUS_MACHINE}
|
|
78
78
|
message={
|
|
79
79
|
(status.standard && t(status.standard)) ||
|
|
80
80
|
t('tank_working_normally')
|
|
@@ -32,8 +32,8 @@ const DisplayTextDisconnected = memo(({ type }) => {
|
|
|
32
32
|
const t = useTranslations();
|
|
33
33
|
let text = '';
|
|
34
34
|
switch (type) {
|
|
35
|
-
case '
|
|
36
|
-
text = t('
|
|
35
|
+
case 'HomeAssistant':
|
|
36
|
+
text = t('home_assistant_disconnected');
|
|
37
37
|
break;
|
|
38
38
|
default:
|
|
39
39
|
text = t('disconnected');
|
|
@@ -4,7 +4,7 @@ import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
|
4
4
|
|
|
5
5
|
import Text from '../../Text';
|
|
6
6
|
import { Colors } from '../../../configs';
|
|
7
|
-
import {
|
|
7
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
8
8
|
import SvgEmergencyButton from '../../../../assets/images/Emergency/emergency-button.svg';
|
|
9
9
|
import { Card } from '../../../commons/CardShadow';
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ const EmergencyButton = memo(({ emergency }) => {
|
|
|
16
16
|
<TouchableOpacity
|
|
17
17
|
delayLongPress={3000}
|
|
18
18
|
onLongPress={emergency}
|
|
19
|
-
|
|
19
|
+
accessibilityLabel={AccessibilityLabel.EMERGENCY_BUTTON}
|
|
20
20
|
>
|
|
21
21
|
<SvgEmergencyButton />
|
|
22
22
|
</TouchableOpacity>
|
|
@@ -17,7 +17,7 @@ const { standardizeHeight } = standardizeCameraScreenSize(
|
|
|
17
17
|
|
|
18
18
|
const EmergencyDetail = memo(({ item }) => {
|
|
19
19
|
const t = useTranslations();
|
|
20
|
-
const groupId = item
|
|
20
|
+
const groupId = item?.configuration?.device?.group?.id;
|
|
21
21
|
const isFocused = useIsFocused();
|
|
22
22
|
const { listContacts, getListContacts } = useEmeragencyContacts();
|
|
23
23
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import renderer, { act } from 'react-test-renderer';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
6
6
|
import { SCProvider } from '../../../../context';
|
|
7
7
|
import { mockSCStore } from '../../../../context/mockStore';
|
|
8
8
|
import Text from '../../../Text';
|
|
@@ -35,7 +35,8 @@ describe('Test EmergencyButton', () => {
|
|
|
35
35
|
const instance = tree.root;
|
|
36
36
|
const button = instance.findAllByType(TouchableOpacity);
|
|
37
37
|
const emergencyButton = button.find(
|
|
38
|
-
(item) =>
|
|
38
|
+
(item) =>
|
|
39
|
+
item.props.accessibilityLabel === AccessibilityLabel.EMERGENCY_BUTTON
|
|
39
40
|
);
|
|
40
41
|
|
|
41
42
|
act(() => {
|