@eohjsc/react-native-smart-city 0.7.3 → 0.7.5
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/assets/images/Automation-fill.svg +85 -0
- package/assets/images/Map/LocationPin.svg +10 -0
- package/assets/images/Scenario-filled.svg +22 -0
- package/assets/images/schedule-fill.svg +48 -0
- package/package.json +20 -17
- package/src/commons/Action/ItemQuickAction.js +1 -1
- package/src/commons/Action/__test__/ItemQuickAction.test.js +6 -6
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +5 -5
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
- package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
- package/src/commons/ActionGroup/SliderRangeTemplate.js +7 -7
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +5 -5
- package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
- package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
- package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonCircle.test.js +2 -2
- package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonDefault.test.js +2 -2
- package/src/commons/ActionGroup/TimerActionTemplate.js +6 -3
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
- package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +9 -10
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +5 -5
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +5 -5
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +8 -8
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +3 -3
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +6 -6
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/index.test.js +6 -6
- package/src/commons/ActionGroup/index.js +2 -2
- package/src/commons/ActionTemplate/__test__/index.test.js +4 -4
- package/src/commons/Automate/ItemAutomate.js +9 -41
- package/src/commons/Automate/ItemConditionScriptDetail.js +67 -0
- package/src/commons/Automate/ItemConditionScriptDetailStyles.js +46 -0
- package/src/commons/Automate/__test__/ItemAutomate.test.js +0 -21
- package/src/commons/BackDefault/index.js +2 -2
- package/src/commons/BottomButtonView/index.js +1 -0
- package/src/commons/ButtonPopup/index.js +3 -2
- package/src/commons/ChartAggregationOption/__test__/FourButtonFilterHistory.test.js +2 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +8 -9
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +7 -7
- package/src/commons/DateTimeRangeChange/DateTimeButton.js +3 -3
- package/src/commons/DateTimeRangeChange/index.js +1 -1
- package/src/commons/Device/ConnectedViewHeader.js +2 -2
- package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +1 -1
- package/src/commons/Device/FlatListItems.js +20 -19
- package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -3
- package/src/commons/Device/HorizontalBarChart.js +54 -34
- package/src/commons/Device/ItemAddNew/index.js +2 -2
- package/src/commons/Device/ItemDevice.js +5 -21
- package/src/commons/Device/SonosSpeaker/index.js +3 -3
- package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
- package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +6 -2
- package/src/commons/DisplayChecking/index.js +2 -2
- package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -3
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +6 -6
- package/src/commons/FlatListDnD/__test__/index.test.js +4 -4
- package/src/commons/FlatListDnD/index.js +12 -9
- package/src/commons/Grid/GridItem.js +10 -2
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +3 -3
- package/src/commons/Header/HeaderCustom.js +2 -2
- package/src/commons/Header/__test__/HeaderCT.test.js +3 -3
- package/src/commons/HeaderAni/index.js +2 -2
- package/src/commons/IconComponent/index.js +3 -3
- package/src/commons/ImagePicker/__test__/ImagePicker.test.js +5 -5
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +6 -4
- package/src/commons/MenuActionMore/MenuActionMoreStyles.js +2 -1
- package/src/commons/MenuActionMore/index.js +1 -1
- package/src/commons/NavBar/NavBarStyles.js +1 -1
- package/src/commons/NavBar/index.js +2 -2
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +1 -1
- package/src/commons/Popover/__test__/index.test.js +3 -3
- package/src/commons/Processing/__test__/Connecting.test.js +4 -4
- package/src/commons/SearchLocation/index.js +3 -3
- package/src/commons/SelectActionCard/index.js +2 -2
- package/src/commons/SelectSubUnit/index.js +6 -2
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +5 -5
- package/src/commons/Sharing/BtnRemoveMember.js +2 -2
- package/src/commons/Sharing/StationDevicePermissions.js +2 -2
- package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
- package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
- package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +6 -7
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +0 -2
- package/src/commons/SubUnit/OneTap/index.js +9 -8
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +8 -8
- package/src/commons/Unit/HeaderUnit/index.js +30 -22
- package/src/commons/Unit/SharedUnit.js +7 -7
- package/src/commons/Widgets/IFrame/__tests__/IFrame.test.js +9 -13
- package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +34 -2
- package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +88 -8
- package/src/commons/WrapParallaxScrollView/index.js +9 -10
- package/src/configs/API.js +1 -1
- package/src/configs/AccessibilityLabel.js +2 -0
- package/src/configs/Constants.js +3 -3
- package/src/configs/Theme.js +1 -1
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +5 -5
- package/src/hooks/IoT/__test__/useHomeAssistantConnection.test.js +12 -12
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +14 -7
- package/src/hooks/IoT/__test__/useWatchConfigs.test.js +3 -3
- package/src/hooks/IoT/useRemoteControl.js +24 -13
- package/src/hooks/useMqtt.js +2 -2
- package/src/iot/RemoteControl/Bluetooth.js +19 -22
- package/src/iot/RemoteControl/Internet.js +13 -5
- package/src/iot/RemoteControl/__test__/Internet.test.js +7 -7
- package/src/navigations/EmergencyContactsStack.js +4 -3
- package/src/navigations/SharedStack.js +2 -0
- package/src/navigations/UnitStack.js +56 -57
- package/src/screens/AQIGuide/index.js +0 -2
- package/src/screens/ActivityLog/index.js +2 -2
- package/src/screens/AddLocationMaps/__test__/index.test.js +12 -12
- package/src/screens/AddLocationMaps/index.js +16 -19
- package/src/screens/AddLocationMaps/indexStyle.js +1 -0
- package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
- package/src/screens/AddNewGateway/SelectDeviceType.js +1 -1
- package/src/screens/AddNewGateway/ShareWifiPassword.js +16 -15
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -7
- package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +8 -8
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +7 -7
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +8 -8
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +5 -5
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +4 -4
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +6 -6
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +0 -4
- package/src/screens/AddNewGateway/hooks/__Tests__/useWifiManage.test.js +2 -2
- package/src/screens/AllGateway/DetailConfigActionModbus/__test__/index.test.js +6 -6
- package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +19 -17
- package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +19 -17
- package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +18 -16
- package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +43 -35
- package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +38 -22
- package/src/screens/AllGateway/__test__/index.test.js +6 -6
- package/src/screens/AllGateway/components/Detail/__test__/index.test.js +3 -5
- package/src/screens/AllGateway/components/GatewayItem/__test__/index.test.js +3 -3
- package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +6 -6
- package/src/screens/AllGateway/hooks/__test__/index.test.js +2 -2
- package/src/screens/AllGateway/test-utils.js +3 -4
- package/src/screens/Automate/AddNewAction/ChooseAction.js +17 -3
- package/src/screens/Automate/AddNewAction/ChooseConfig.js +7 -6
- package/src/screens/Automate/AddNewAction/NewActionWrapper.js +8 -8
- package/src/screens/Automate/AddNewAction/SelectControlDevices.js +30 -20
- package/src/screens/Automate/AddNewAction/SelectMonitorDevices.js +17 -10
- package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +58 -44
- package/src/screens/Automate/AddNewAction/SetupScriptDelay.js +1 -1
- package/src/screens/Automate/AddNewAction/SetupScriptNotify.js +3 -3
- package/src/screens/Automate/AddNewAction/Styles/SetupSensorStyles.js +20 -4
- package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +12 -12
- package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +14 -8
- package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +13 -7
- package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +54 -15
- package/src/screens/Automate/AddNewAction/__test__/SetupScriptDelay.test.js +9 -9
- package/src/screens/Automate/AddNewAction/__test__/SetupScriptNotify.test.js +39 -10
- package/src/screens/Automate/AddNewAutoSmart/AddTypeSmart.js +10 -10
- package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +13 -8
- package/src/screens/Automate/Components/InputName.js +10 -7
- package/src/screens/Automate/EditActionsList/__tests__/UpdateActionScript.test.js +8 -8
- package/src/screens/Automate/EditActionsList/__tests__/UpdateDelayScript.test.js +6 -6
- package/src/screens/Automate/EditActionsList/__tests__/UpdateNotifyScript.test.js +7 -7
- package/src/screens/Automate/EditActionsList/index.js +19 -17
- package/src/screens/Automate/MultiUnits.js +19 -22
- package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +18 -8
- package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +15 -7
- package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +14 -6
- package/src/screens/Automate/ScriptDetail/Components/RenameScript.js +4 -7
- package/src/screens/Automate/ScriptDetail/__test__/index.test.js +56 -18
- package/src/screens/Automate/ScriptDetail/__test__/useStarredScript.test.js +6 -6
- package/src/screens/Automate/ScriptDetail/index.js +105 -41
- package/src/screens/Automate/SetSchedule/__test__/SelectWeekday.test.js +4 -4
- package/src/screens/Automate/SetSchedule/__test__/index.test.js +29 -18
- package/src/screens/Automate/SetSchedule/components/RowItem.js +5 -5
- package/src/screens/Automate/SetSchedule/index.js +8 -7
- package/src/screens/Automate/Styles/indexStyles.js +1 -1
- package/src/screens/Automate/__test__/MultiUnits.test.js +1 -4
- package/src/screens/Automate/__test__/index.test.js +0 -1
- package/src/screens/Automate/index.js +36 -34
- package/src/screens/ChangePosition/__test__/index.test.js +6 -6
- package/src/screens/ChangePosition/index.js +2 -1
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +13 -13
- package/src/screens/Device/EditDevice/index.js +4 -4
- package/src/screens/Device/__test__/BluetoothDevice.test.js +300 -0
- package/src/screens/Device/__test__/detail.test.js +14 -14
- package/src/screens/Device/__test__/mqttDetail.test.js +9 -9
- package/src/screens/Device/components/BluetoothDevice.js +135 -0
- package/src/screens/Device/components/SensorDisplayItem.js +9 -8
- package/src/screens/Device/detail.js +70 -62
- package/src/screens/Device/hooks/useEvaluateValue.js +1 -1
- package/src/screens/Drawer/Drawer.test.js +2 -2
- package/src/screens/Drawer/index.js +3 -3
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +8 -4
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -7
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +8 -8
- package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
- package/src/screens/GuestInfo/components/__test__/AccessScheduleSheet.test.js +3 -3
- package/src/screens/GuestInfo/index.js +2 -2
- package/src/screens/HanetCamera/ManageAccess.js +3 -3
- package/src/screens/HanetCamera/MemberInfo.js +2 -2
- package/src/screens/HanetCamera/__test__/Detail.test.js +9 -9
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +10 -10
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
- package/src/screens/ManageAccess/index.js +3 -3
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +9 -9
- package/src/screens/Notification/__test__/Notification.test.js +9 -9
- package/src/screens/Notification/components/NotificationItem.js +3 -4
- package/src/screens/Notification/index.js +3 -3
- package/src/screens/Notification/styles/NotificationItemStyles.js +0 -1
- package/src/screens/PlayBackCamera/__test__/index.test.js +1 -1
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
- package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
- package/src/screens/SelectUnit/__test__/index.test.js +8 -8
- package/src/screens/SelectUnit/index.js +4 -4
- package/src/screens/SharedUnit/TabHeader.js +2 -2
- package/src/screens/Sharing/Components/EndDevice.js +3 -3
- package/src/screens/Sharing/UnitMemberList.js +2 -2
- package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +7 -7
- package/src/screens/SideMenuDetail/__test__/index.test.js +8 -8
- package/src/screens/SmartAccount/Connecting/index.js +5 -5
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +8 -8
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +7 -7
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +2 -2
- package/src/screens/SmartAccount/__test__/Connecting.test.js +6 -6
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +10 -10
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +3 -2
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +2 -2
- package/src/screens/SmartIr/components/SelectBrand.js +2 -2
- package/src/screens/SubUnit/AddSubUnit.js +28 -26
- package/src/screens/SubUnit/AddSubUnitStyles.js +10 -4
- package/src/screens/SubUnit/EditSubUnit.js +12 -11
- package/src/screens/SubUnit/ManageSubUnit.js +3 -3
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +13 -13
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +3 -3
- package/src/screens/Template/EditTemplate.js +6 -4
- package/src/screens/Template/__test__/EditTemplate.test.js +7 -7
- package/src/screens/Template/__test__/detail.test.js +4 -4
- package/src/screens/Template/__test__/index.test.js +1 -1
- package/src/screens/UVIndexGuide/index.js +2 -4
- package/src/screens/Unit/Detail.js +1 -5
- package/src/screens/Unit/MoreMenu.js +6 -5
- package/src/screens/Unit/SelectAddToFavorites.js +2 -2
- package/src/screens/Unit/SelectAddress.js +16 -12
- package/src/screens/Unit/Station/__test__/index.test.js +1 -1
- package/src/screens/Unit/__test__/MoreMenu.test.js +5 -1
- package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +9 -9
- package/src/screens/Unit/__test__/SelectAddress.test.js +11 -17
- package/src/screens/Unit/__test__/Summaries.test.js +7 -7
- package/src/screens/Unit/components/AutomateScript/index.js +5 -5
- package/src/screens/Unit/components/ButtonWrapper/index.js +3 -3
- package/src/screens/Unit/components/Header/index.js +2 -2
- package/src/screens/Unit/components/SharedUnit/index.js +5 -5
- package/src/screens/Unit/components/__test__/AutomateScript.test.js +3 -3
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +8 -8
- package/src/screens/Unit/hook/__test__/useUnitConnectRemoteDevices.test.js +2 -2
- package/src/screens/UnitSummary/components/AirQuality/index.js +6 -11
- package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +5 -5
- package/src/screens/UnitSummary/index.js +6 -2
- package/src/utils/Apis/axios.js +5 -5
- package/src/utils/Functions/ShortEmail.js +1 -0
- package/src/utils/I18n/translations/en.js +6 -3
- package/src/utils/I18n/translations/vi.js +8 -4
- package/src/utils/__test__/Utils.test.js +16 -16
- package/src/utils/bluetooth.js +3 -0
- package/assets/images/OneTap.svg +0 -14
- package/assets/images/Schedule.svg +0 -39
- package/assets/images/ValueChange.svg +0 -49
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { act, create } from 'react-test-renderer';
|
|
3
|
-
import { TouchableOpacity } from 'react-native';
|
|
4
3
|
|
|
5
4
|
import { SCProvider } from '../../../context';
|
|
6
5
|
import { mockSCStore } from '../../../context/mockStore';
|
|
@@ -23,24 +22,4 @@ describe('Test ItemAutomate', () => {
|
|
|
23
22
|
const texts = instance.findAllByType(Text);
|
|
24
23
|
expect(texts[0].props.children).toEqual('Launch One-Tap');
|
|
25
24
|
});
|
|
26
|
-
|
|
27
|
-
it('Test render TouchableOpacity', async () => {
|
|
28
|
-
const mockOnPress = jest.fn();
|
|
29
|
-
await act(async () => {
|
|
30
|
-
tree = await create(
|
|
31
|
-
wrapComponent({
|
|
32
|
-
automate: {
|
|
33
|
-
type: 'one_tap',
|
|
34
|
-
},
|
|
35
|
-
onPress: mockOnPress,
|
|
36
|
-
})
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
const instance = tree.root;
|
|
40
|
-
const touchableOpacities = instance.findAllByType(TouchableOpacity);
|
|
41
|
-
await act(async () => {
|
|
42
|
-
touchableOpacities[0].props.onPress();
|
|
43
|
-
});
|
|
44
|
-
expect(mockOnPress).toBeCalledTimes(1);
|
|
45
|
-
});
|
|
46
25
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
5
5
|
|
|
6
6
|
const BackDefault = memo(({ goBack, color, fixedHeight }) => {
|
|
@@ -10,7 +10,7 @@ const BackDefault = memo(({ goBack, color, fixedHeight }) => {
|
|
|
10
10
|
onPress={goBack}
|
|
11
11
|
style={[styles.wrap, fixedHeight && styles.noPaddingVertical]}
|
|
12
12
|
>
|
|
13
|
-
<
|
|
13
|
+
<IconOutline name="left" size={27} color={color} />
|
|
14
14
|
</TouchableOpacity>
|
|
15
15
|
);
|
|
16
16
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
|
|
5
5
|
import { Colors, Device } from '../../configs';
|
|
6
6
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
@@ -42,7 +42,7 @@ const ButtonPopup = ({
|
|
|
42
42
|
<View style={styles.popoverStyle}>
|
|
43
43
|
<View style={styles.modalWrapper}>
|
|
44
44
|
{!hideClose && (
|
|
45
|
-
<
|
|
45
|
+
<IconOutline
|
|
46
46
|
name={'close'}
|
|
47
47
|
color={Colors.Gray8}
|
|
48
48
|
style={styles.close}
|
|
@@ -92,6 +92,7 @@ const styles = StyleSheet.create({
|
|
|
92
92
|
position: 'relative',
|
|
93
93
|
backgroundColor: Colors.White,
|
|
94
94
|
borderRadius: 10,
|
|
95
|
+
/* istanbul ignore next */
|
|
95
96
|
marginBottom: Device.isIphoneX ? 20 : 0,
|
|
96
97
|
},
|
|
97
98
|
modalHeader: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TouchableOpacity } from 'react-native';
|
|
2
3
|
import { act, create } from 'react-test-renderer';
|
|
3
4
|
import { SCProvider } from '../../../context';
|
|
4
5
|
import { mockSCStore } from '../../../context/mockStore';
|
|
5
6
|
import ChartAggregationOption from '../index';
|
|
6
|
-
import { TouchableOpacity } from 'react-native';
|
|
7
7
|
|
|
8
8
|
const wrapComponent = (props) => (
|
|
9
9
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -31,7 +31,7 @@ it('test', async () => {
|
|
|
31
31
|
await act(async () => {
|
|
32
32
|
await buttons[index].props.onPress();
|
|
33
33
|
});
|
|
34
|
-
expect(mockSetGroupBy).
|
|
34
|
+
expect(mockSetGroupBy).toHaveBeenCalledWith(data);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
await clickButton(0, 'date');
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
1
2
|
import React, { useContext } from 'react';
|
|
2
3
|
import { act, create } from 'react-test-renderer';
|
|
3
|
-
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Text, TouchableOpacity } from 'react-native';
|
|
6
|
+
import { API } from '../../../../configs';
|
|
7
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
8
8
|
import { SCProvider } from '../../../../context';
|
|
9
|
+
import { Action } from '../../../../context/actionType';
|
|
9
10
|
import { mockSCStore } from '../../../../context/mockStore';
|
|
10
|
-
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
11
|
-
import { API } from '../../../../configs';
|
|
12
|
-
import { TouchableOpacity } from 'react-native';
|
|
13
11
|
import api from '../../../../utils/Apis/axios';
|
|
12
|
+
import { getTranslate } from '../../../../utils/I18n';
|
|
14
13
|
import SharedUnit from '../../../Unit/SharedUnit';
|
|
15
|
-
import
|
|
14
|
+
import MyPinnedSharedUnit from '../index';
|
|
16
15
|
|
|
17
16
|
const mock = new MockAdapter(api.axiosInstance);
|
|
18
17
|
|
|
@@ -61,7 +60,7 @@ describe('Test MyPinnedSharedUnit', () => {
|
|
|
61
60
|
goToAllSharedUnits.props.onPress();
|
|
62
61
|
});
|
|
63
62
|
expect(global.mockedNavigate).toHaveBeenCalled();
|
|
64
|
-
expect(mockSetAction).
|
|
63
|
+
expect(mockSetAction).toHaveBeenCalledWith(
|
|
65
64
|
Action.IS_CHECK_CLEAR_CACHE_UNITS,
|
|
66
65
|
false
|
|
67
66
|
);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import renderer, { act } from 'react-test-renderer';
|
|
3
|
-
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
|
|
5
|
+
import FastImage from 'react-native-fast-image';
|
|
5
6
|
import MyUnit from '..';
|
|
6
|
-
import
|
|
7
|
+
import { API } from '../../../../configs';
|
|
7
8
|
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
8
9
|
import { SCProvider } from '../../../../context';
|
|
9
10
|
import { mockSCStore } from '../../../../context/mockStore';
|
|
11
|
+
import { flushPromises } from '../../../../screens/AllGateway/test-utils';
|
|
12
|
+
import MyUnitDevice from '../../../../screens/Unit/components/MyUnitDevice';
|
|
10
13
|
import api from '../../../../utils/Apis/axios';
|
|
11
|
-
import { API } from '../../../../configs';
|
|
12
14
|
import Routes from '../../../../utils/Route';
|
|
13
|
-
import { flushPromises } from '../../../../screens/AllGateway/test-utils';
|
|
14
|
-
import FastImage from 'react-native-fast-image';
|
|
15
15
|
import { removeMultiple, STORAGE_KEY } from '../../../../utils/Storage';
|
|
16
16
|
|
|
17
17
|
const mock = new MockAdapter(api.axiosInstance);
|
|
@@ -103,7 +103,7 @@ describe('Test MyUnit', () => {
|
|
|
103
103
|
await act(async () => {
|
|
104
104
|
await button.props.onPress(data[0]);
|
|
105
105
|
});
|
|
106
|
-
expect(global.mockedNavigate).
|
|
106
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith(Routes.UnitStack, {
|
|
107
107
|
params: { unitId: 1 },
|
|
108
108
|
screen: Routes.UnitDetail,
|
|
109
109
|
});
|
|
@@ -123,7 +123,7 @@ describe('Test MyUnit', () => {
|
|
|
123
123
|
await act(async () => {
|
|
124
124
|
await button.props.onPress(data[1]);
|
|
125
125
|
});
|
|
126
|
-
expect(global.mockedNavigate).
|
|
126
|
+
expect(global.mockedNavigate).toHaveBeenCalledWith('UnitStack', {
|
|
127
127
|
params: { unitId: 2 },
|
|
128
128
|
screen: 'UnitDetail',
|
|
129
129
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { Colors } from '../../configs';
|
|
5
5
|
|
|
6
6
|
const DateTimeButton = memo(({ onPress, style, children }) => {
|
|
7
7
|
return (
|
|
8
8
|
<TouchableOpacity style={[styles.dateSelect, style]} onPress={onPress}>
|
|
9
9
|
{children}
|
|
10
|
-
<
|
|
10
|
+
<IconOutline style={styles.iconDateTime} name={'calendar'} />
|
|
11
11
|
</TouchableOpacity>
|
|
12
12
|
);
|
|
13
13
|
});
|
|
@@ -25,7 +25,7 @@ const styles = StyleSheet.create({
|
|
|
25
25
|
marginHorizontal: 8,
|
|
26
26
|
flexDirection: 'row',
|
|
27
27
|
justifyContent: 'space-between',
|
|
28
|
-
width:
|
|
28
|
+
width: 130,
|
|
29
29
|
alignItems: 'center',
|
|
30
30
|
},
|
|
31
31
|
txtTime: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
6
|
import Text from '../../commons/Text';
|
|
@@ -30,7 +30,7 @@ const ConnectedViewHeader = memo(
|
|
|
30
30
|
return (
|
|
31
31
|
<View style={styles.statusContainer}>
|
|
32
32
|
<View style={styles.connectStatus}>
|
|
33
|
-
<
|
|
33
|
+
<IconOutline name={'wifi'} color={Colors.Green6} size={16} />
|
|
34
34
|
<DisplayTextConnected type={type} />
|
|
35
35
|
</View>
|
|
36
36
|
{isDisplayTime && (
|
|
@@ -6,7 +6,7 @@ import MediaPlayer from '../../MediaPlayer';
|
|
|
6
6
|
import { standardizeCameraScreenSize } from '../../../utils/Utils';
|
|
7
7
|
import { Colors, Device } from '../../../configs';
|
|
8
8
|
import { RowUser } from '../../RowUser';
|
|
9
|
-
import
|
|
9
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
10
10
|
import { useEmeragencyContacts } from '../../../screens/EmergencyContacts/hook';
|
|
11
11
|
import { useIsFocused } from '@react-navigation/native';
|
|
12
12
|
|
|
@@ -49,12 +49,12 @@ const EmergencyDetail = memo(({ item }) => {
|
|
|
49
49
|
key={contact.id.toString()}
|
|
50
50
|
index={index}
|
|
51
51
|
leftIcon={
|
|
52
|
-
<
|
|
52
|
+
<IconOutline name={'user'} size={20} color={Colors.White} />
|
|
53
53
|
}
|
|
54
54
|
text={contact.name}
|
|
55
55
|
rightComponent={
|
|
56
56
|
<View style={styles.rightComponent}>
|
|
57
|
-
<
|
|
57
|
+
<IconOutline
|
|
58
58
|
name={'phone'}
|
|
59
59
|
size={20}
|
|
60
60
|
color={Colors.Gray9}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { memo, useCallback, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import AlertStatusMachine from './WaterPurifierStatus/AlertStatusMachine';
|
|
5
|
-
import { useBoolean } from '../../hooks/Common';
|
|
6
|
-
import Text from '../Text';
|
|
7
|
-
import Routes from '../../utils/Route';
|
|
8
|
-
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
2
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
9
4
|
import { Colors, Constants } from '../../configs';
|
|
10
|
-
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
11
5
|
import { AccessibilityLabel } from '../../configs/Constants';
|
|
6
|
+
import { useBoolean } from '../../hooks/Common';
|
|
7
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
8
|
+
import Routes from '../../utils/Route';
|
|
12
9
|
import { ModalCustom } from '../Modal';
|
|
10
|
+
import Text from '../Text';
|
|
11
|
+
import AlertStatusMachine from './WaterPurifierStatus/AlertStatusMachine';
|
|
12
|
+
import QualityIndicatorItem from './WaterQualitySensor/QualityIndicatorsItem';
|
|
13
13
|
|
|
14
14
|
const marginHorizontal = 20;
|
|
15
15
|
const widthItem = (Constants.width - marginHorizontal * 2) / 2;
|
|
@@ -75,20 +75,21 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
|
|
|
75
75
|
style={styles.iconInfo}
|
|
76
76
|
accessibilityLabel={AccessibilityLabel.TOUCH_INFO_FLAT_LIST_ITEM}
|
|
77
77
|
>
|
|
78
|
-
<
|
|
78
|
+
<IconOutline name={'info-circle'} size={16} color={Colors.Gray8} />
|
|
79
79
|
</TouchableOpacity>
|
|
80
80
|
)}
|
|
81
81
|
</View>
|
|
82
82
|
|
|
83
|
-
{filtersNeedReplace.length > 0 &&
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
number
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
{filtersNeedReplace.length > 0 &&
|
|
84
|
+
filtersNeedReplace[0].measure === 'H' && (
|
|
85
|
+
<AlertStatusMachine
|
|
86
|
+
message={t('{number}_filter_need_to_be_replaced', {
|
|
87
|
+
number: filtersNeedReplace.length,
|
|
88
|
+
})}
|
|
89
|
+
style={styles.alertReplaceFilter}
|
|
90
|
+
icon={'warning'}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
92
93
|
<View style={styles.listBox}>{renderFlatList()}</View>
|
|
93
94
|
|
|
94
95
|
{isFilters && !viewFull && (
|
|
@@ -97,7 +98,7 @@ const FlatListItems = memo(({ data, style, title, offsetTitle }) => {
|
|
|
97
98
|
onPress={() => setViewFull(true)}
|
|
98
99
|
>
|
|
99
100
|
<Text style={styles.textSeeMore}>{t('see_more')}</Text>
|
|
100
|
-
<
|
|
101
|
+
<IconOutline name={'caret-down'} color={Colors.Gray8} size={16} />
|
|
101
102
|
</TouchableOpacity>
|
|
102
103
|
)}
|
|
103
104
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
TouchableWithoutFeedback,
|
|
6
6
|
View,
|
|
7
7
|
} from 'react-native';
|
|
8
|
-
import
|
|
8
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
9
9
|
import { useNavigation } from '@react-navigation/native';
|
|
10
10
|
|
|
11
11
|
import Text from '../../Text';
|
|
@@ -35,7 +35,7 @@ const ItemHanetDevice = memo(
|
|
|
35
35
|
return iconKit ? (
|
|
36
36
|
<FImage source={{ uri: iconKit }} style={styles.iconSensor} />
|
|
37
37
|
) : (
|
|
38
|
-
<
|
|
38
|
+
<IconOutline name={svgMain} size={32} color={Colors.Red6} />
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -58,7 +58,7 @@ const ItemHanetDevice = memo(
|
|
|
58
58
|
{title}
|
|
59
59
|
</Text>
|
|
60
60
|
<View style={styles.row}>
|
|
61
|
-
<
|
|
61
|
+
<IconOutline name="right" size={12} />
|
|
62
62
|
</View>
|
|
63
63
|
</TouchableOpacity>
|
|
64
64
|
</View>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { useNavigation } from '@react-navigation/native';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { TouchableWithoutFeedback } from 'react-native';
|
|
3
4
|
import renderer, { act } from 'react-test-renderer';
|
|
4
|
-
import ItemHanetDevice from './ItemHanetDevice';
|
|
5
5
|
import { SCProvider } from '../../../context';
|
|
6
6
|
import { mockSCStore } from '../../../context/mockStore';
|
|
7
|
-
import
|
|
7
|
+
import ItemHanetDevice from './ItemHanetDevice';
|
|
8
8
|
|
|
9
9
|
const wrapComponent = (props) => (
|
|
10
10
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -35,7 +35,7 @@ describe('Test ItemHanetDevice', () => {
|
|
|
35
35
|
await act(async () => {
|
|
36
36
|
tree = touches[0].props.onPress();
|
|
37
37
|
});
|
|
38
|
-
expect(navigate).
|
|
38
|
+
expect(navigate).toHaveBeenCalled();
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
it('render ItemHanetDevice sensor has icon', async () => {
|
|
@@ -1,11 +1,46 @@
|
|
|
1
|
-
import React, { memo, useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
1
|
import { isEmpty } from 'lodash';
|
|
2
|
+
import React, { memo, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
6
|
import { getMaxValueIndex } from '../../utils/chartHelper/getMaxValueIndex';
|
|
7
7
|
import Highcharts from '../Highcharts';
|
|
8
8
|
|
|
9
|
+
// https://github.com/facebook/hermes/issues/114#issuecomment-887106990
|
|
10
|
+
// 'show source' unstable, work sometime, use this to generate formatter function
|
|
11
|
+
|
|
12
|
+
// function formatter() {
|
|
13
|
+
// 'show source';
|
|
14
|
+
// const { unit, price } = JSON.parse(this.series.name);
|
|
15
|
+
// const textColor =
|
|
16
|
+
// this.color === '#00979D'
|
|
17
|
+
// ? this.y === 0
|
|
18
|
+
// ? '#262626'
|
|
19
|
+
// : '#FFFFFF'
|
|
20
|
+
// : '#262626';
|
|
21
|
+
// const valueStyle = `color:${textColor};font-weight:normal;font-size:12px;`;
|
|
22
|
+
// const costStyle = valueStyle + 'font-weight:bold;';
|
|
23
|
+
// let label = `<span style="${valueStyle}">` + `${this.y}${unit}`;
|
|
24
|
+
// if (price === '' || price === null || isNaN(price)) {
|
|
25
|
+
// return label + '</span>';
|
|
26
|
+
// }
|
|
27
|
+
// const formatMoney = (number) => {
|
|
28
|
+
// const formatNumber = number.toFixed();
|
|
29
|
+
// return (
|
|
30
|
+
// parseInt(formatNumber, 10)
|
|
31
|
+
// .toFixed(0)
|
|
32
|
+
// .toString()
|
|
33
|
+
// .replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1.') + 'đ'
|
|
34
|
+
// );
|
|
35
|
+
// };
|
|
36
|
+
// return (
|
|
37
|
+
// label +
|
|
38
|
+
// `/<span style="${costStyle}">` +
|
|
39
|
+
// formatMoney(this.y * price) +
|
|
40
|
+
// '</span></span>'
|
|
41
|
+
// );
|
|
42
|
+
// }
|
|
43
|
+
|
|
9
44
|
const HorizontalBarChart = memo(({ datas, config }) => {
|
|
10
45
|
const [chartOptions, setChartOptions] = useState({
|
|
11
46
|
chart: {
|
|
@@ -57,38 +92,23 @@ const HorizontalBarChart = memo(({ datas, config }) => {
|
|
|
57
92
|
dataLabels: {
|
|
58
93
|
enabled: true,
|
|
59
94
|
useHTML: true,
|
|
60
|
-
formatter: function () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const formatNumber = number.toFixed();
|
|
78
|
-
return (
|
|
79
|
-
parseInt(formatNumber, 10)
|
|
80
|
-
.toFixed(0)
|
|
81
|
-
.toString()
|
|
82
|
-
.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1.') + 'đ'
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
return (
|
|
86
|
-
label +
|
|
87
|
-
`/<span style="${costStyle}">` +
|
|
88
|
-
formatMoney(this.y * price) +
|
|
89
|
-
'</span></span>'
|
|
90
|
-
);
|
|
91
|
-
},
|
|
95
|
+
formatter: `function formatter() {
|
|
96
|
+
var _JSON$parse = JSON.parse(this.series.name),
|
|
97
|
+
unit = _JSON$parse.unit,
|
|
98
|
+
price = _JSON$parse.price;
|
|
99
|
+
var textColor = this.color === '#00979D' ? this.y === 0 ? '#262626' : '#FFFFFF' : '#262626';
|
|
100
|
+
var valueStyle = "color:" + textColor + ";font-weight:normal;font-size:12px;";
|
|
101
|
+
var costStyle = valueStyle + 'font-weight:bold;';
|
|
102
|
+
var label = "<span style=\\"" + valueStyle + "\\">" + ("" + this.y + unit);
|
|
103
|
+
if (price === '' || price === null || isNaN(price)) {
|
|
104
|
+
return label + '</span>';
|
|
105
|
+
}
|
|
106
|
+
var formatMoney = function formatMoney(number) {
|
|
107
|
+
var formatNumber = number.toFixed();
|
|
108
|
+
return parseInt(formatNumber, 10).toFixed(0).toString().replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '$1.') + 'đ';
|
|
109
|
+
};
|
|
110
|
+
return label + ("/<span style=\\"" + costStyle + "\\">") + formatMoney(this.y * price) + '</span></span>';
|
|
111
|
+
}`,
|
|
92
112
|
align: 'right',
|
|
93
113
|
inside: false,
|
|
94
114
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import Text from '../../Text';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../../configs';
|
|
@@ -16,7 +16,7 @@ const ItemAddNew = memo(({ title, onAddNew, wrapStyle }) => {
|
|
|
16
16
|
<View style={[styles.container, wrapStyle]}>
|
|
17
17
|
<View style={styles.boxIcon}>
|
|
18
18
|
<View style={styles.buttonPlus}>
|
|
19
|
-
<
|
|
19
|
+
<IconOutline name="plus" size={22} color={Colors.Gray8} />
|
|
20
20
|
</View>
|
|
21
21
|
</View>
|
|
22
22
|
<View>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo } from 'react';
|
|
2
2
|
import { Platform, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import Routes from '../../utils/Route';
|
|
4
|
-
import
|
|
4
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
5
5
|
import { useNavigation } from '@react-navigation/native';
|
|
6
6
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
7
7
|
import ItemQuickAction from '../../commons/Action/ItemQuickAction';
|
|
@@ -21,7 +21,8 @@ const ItemDevice = memo(
|
|
|
21
21
|
({ description, title, sensor, unit, station, wrapStyle }) => {
|
|
22
22
|
const t = useTranslations();
|
|
23
23
|
const navigation = useNavigation();
|
|
24
|
-
const { is_managed_by_backend, device_type, icon_kit, icon } =
|
|
24
|
+
const { is_managed_by_backend, device_type, icon_kit, icon, quick_action } =
|
|
25
|
+
sensor;
|
|
25
26
|
|
|
26
27
|
const {
|
|
27
28
|
isConnected: isEoHBackendConnected,
|
|
@@ -72,24 +73,7 @@ const ItemDevice = memo(
|
|
|
72
73
|
t,
|
|
73
74
|
]);
|
|
74
75
|
|
|
75
|
-
const canRenderQuickAction = useMemo(() =>
|
|
76
|
-
if (is_managed_by_backend) {
|
|
77
|
-
return (
|
|
78
|
-
device_type === DEVICE_TYPE.LG_THINQ ||
|
|
79
|
-
isBluetoothConnected ||
|
|
80
|
-
!isFetchingStatusFromEoHBackend
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
return device_type === DEVICE_TYPE.GOOGLE_HOME
|
|
84
|
-
? isHomeAssistantConnected
|
|
85
|
-
: true;
|
|
86
|
-
}, [
|
|
87
|
-
device_type,
|
|
88
|
-
isBluetoothConnected,
|
|
89
|
-
isFetchingStatusFromEoHBackend,
|
|
90
|
-
isHomeAssistantConnected,
|
|
91
|
-
is_managed_by_backend,
|
|
92
|
-
]);
|
|
76
|
+
const canRenderQuickAction = useMemo(() => !!quick_action, [quick_action]);
|
|
93
77
|
|
|
94
78
|
return (
|
|
95
79
|
<ItemDeviceWrapper
|
|
@@ -132,7 +116,7 @@ const ItemDevice = memo(
|
|
|
132
116
|
>
|
|
133
117
|
{description || textConnected}
|
|
134
118
|
</Text>
|
|
135
|
-
<
|
|
119
|
+
<IconOutline name="right" size={12} />
|
|
136
120
|
</View>
|
|
137
121
|
</TouchableOpacity>
|
|
138
122
|
</ItemDeviceWrapper>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useState } from 'react';
|
|
2
2
|
import { View, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
4
|
-
import
|
|
4
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
5
5
|
import { Slider } from '@miblanchard/react-native-slider';
|
|
6
6
|
|
|
7
7
|
import Text from '../../Text';
|
|
@@ -44,7 +44,7 @@ const SonosSpeaker = memo(() => {
|
|
|
44
44
|
</TouchableOpacity>
|
|
45
45
|
<View style={styles.threeButton}>
|
|
46
46
|
<TouchableOpacity style={styles.buttonLeft}>
|
|
47
|
-
<
|
|
47
|
+
<IconOutline name={'backward'} size={35} color={Colors.Black} />
|
|
48
48
|
</TouchableOpacity>
|
|
49
49
|
<TouchableOpacity
|
|
50
50
|
style={styles.buttonCenter}
|
|
@@ -53,7 +53,7 @@ const SonosSpeaker = memo(() => {
|
|
|
53
53
|
{active ? <SvgButtonPauseActive /> : <SvgButtonPauseNotActive />}
|
|
54
54
|
</TouchableOpacity>
|
|
55
55
|
<TouchableOpacity style={styles.buttonRight}>
|
|
56
|
-
<
|
|
56
|
+
<IconOutline name={'forward'} size={35} color={Colors.Black} />
|
|
57
57
|
</TouchableOpacity>
|
|
58
58
|
</View>
|
|
59
59
|
</View>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import Text from '../../../commons/Text';
|
|
4
|
-
import
|
|
4
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
5
5
|
|
|
6
6
|
const AlertStatusMachine = memo(({ message, style, icon }) => {
|
|
7
7
|
return (
|
|
8
8
|
<View style={[styles.container, style]}>
|
|
9
|
-
<
|
|
9
|
+
<IconOutline
|
|
10
10
|
name={icon}
|
|
11
11
|
size={20}
|
|
12
12
|
color={style.borderColor}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { View, Dimensions, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../../configs';
|
|
@@ -35,7 +35,11 @@ const QualityIndicatorItem = memo(
|
|
|
35
35
|
onPress={() => navigation.navigate(descriptionScreen)}
|
|
36
36
|
style={styles.iconInfo}
|
|
37
37
|
>
|
|
38
|
-
<
|
|
38
|
+
<IconOutline
|
|
39
|
+
name={'info-circle'}
|
|
40
|
+
size={18}
|
|
41
|
+
color={Colors.Gray8}
|
|
42
|
+
/>
|
|
39
43
|
</TouchableOpacity>
|
|
40
44
|
)}
|
|
41
45
|
</View>
|
|
@@ -3,7 +3,7 @@ import { View, TouchableOpacity } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { Colors } from '../../configs';
|
|
5
5
|
import Text from '../../commons/Text';
|
|
6
|
-
import
|
|
6
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
7
7
|
import styles from './styles';
|
|
8
8
|
import { ModalCustom } from '../Modal';
|
|
9
9
|
import Loading from '../../screens/Automate/Components/Loading';
|
|
@@ -18,7 +18,7 @@ const LoadingMessage = memo(({ visible, onClose, message }) => {
|
|
|
18
18
|
onPress={onClose}
|
|
19
19
|
>
|
|
20
20
|
<Loading
|
|
21
|
-
icon={<
|
|
21
|
+
icon={<IconOutline name={'sync'} color={Colors.Green6} size={16} />}
|
|
22
22
|
/>
|
|
23
23
|
<Text type={'Body'} style={styles.text}>
|
|
24
24
|
{message}
|