@eohjsc/react-native-smart-city 0.2.99 → 0.3.2
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/README.md +1 -1
- package/package.json +6 -4
- package/react-native-smart-city.podspec +1 -0
- package/src/commons/Action/ItemQuickAction.js +11 -2
- package/src/commons/Action/__test__/ItemQuickAction.test.js +11 -6
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +10 -5
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +31 -20
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +4 -0
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/ItemPasscode.test.js +24 -0
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +14 -0
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +1 -1
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +3 -2
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +8 -4
- package/src/commons/ActionGroup/TimerActionTemplate.js +2 -2
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +0 -1
- package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +53 -4
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +45 -48
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +77 -0
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +58 -6
- package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +49 -1
- package/src/commons/ActionGroup/__test__/index.test.js +137 -2
- package/src/commons/Automate/ItemAutomate.js +1 -3
- package/src/commons/Calendar/__test__/Calendar.test.js +33 -0
- package/src/commons/Connecting/__test__/Connecting.test.js +19 -2
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +7 -3
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +8 -11
- package/src/commons/ConnectingProcess/__test__/Connecting.test.js +136 -3
- package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +3 -2
- package/src/commons/ConnectingProcess/index.js +72 -25
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +16 -13
- package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +1 -1
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +0 -5
- package/src/commons/Device/ConnectedViewHeader.js +1 -1
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +58 -0
- package/src/commons/Device/HistoryChart.js +3 -3
- package/src/commons/Device/ItemDevice.js +15 -11
- package/src/commons/Device/LinearChart.js +15 -0
- package/src/commons/Device/SonosSpeaker/index.js +1 -1
- package/src/commons/Explore/__test__/CityItem.test.js +33 -54
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +19 -14
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +0 -3
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +0 -3
- package/src/commons/FieldTemplate/ScheduleField/index.js +2 -2
- package/src/commons/Header/HeaderCustom.js +2 -1
- package/src/commons/HorizontalPicker/index.js +2 -2
- package/src/commons/MediaPlayerDetail/Styles/MediaPlayerDetailStyles.js +0 -6
- package/src/commons/MediaPlayerDetail/index.js +24 -55
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +0 -1
- package/src/commons/SubUnit/Favorites/index.js +2 -3
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +8 -35
- package/src/commons/SubUnit/OneTap/index.js +1 -2
- package/src/commons/SubUnit/ShortDetail.js +25 -9
- package/src/commons/SubUnit/__test__/Item.test.js +0 -1
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +8 -1
- package/src/commons/Unit/SharedUnit.js +1 -0
- package/src/commons/Unit/__test__/SharedUnit.test.js +38 -183
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +2 -13
- package/src/commons/UnitSummary/ConfigHistoryChart.js +22 -13
- package/src/commons/WheelDateTimePicker/index.js +2 -2
- package/src/configs/API.js +85 -144
- package/src/configs/Constants.js +24 -0
- package/src/configs/SCConfig.js +2 -0
- package/src/context/actionType.ts +8 -0
- package/src/context/mockStore.ts +10 -0
- package/src/context/reducer.ts +38 -2
- package/src/hooks/Common/index.js +2 -0
- package/src/hooks/Common/useGGHomeDeviceConnected.js +16 -0
- package/src/hooks/Common/useGetIdUser.js +1 -5
- package/src/hooks/Common/useSensorsStatus.js +4 -4
- package/src/hooks/IoT/__test__/useGGHomeConnection.test.js +198 -0
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +198 -0
- package/src/hooks/IoT/index.js +4 -0
- package/src/hooks/IoT/useGGHomeConnection.js +91 -0
- package/src/hooks/IoT/useRemoteControl.js +79 -0
- package/src/hooks/index.js +4 -0
- package/src/hooks/useReceiveNotifications.js +9 -5
- package/src/iot/Monitor.js +3 -2
- package/src/iot/RemoteControl/Bluetooth.js +1 -1
- package/src/iot/RemoteControl/GoogleHome.js +75 -49
- package/src/iot/RemoteControl/Internet.js +1 -1
- package/src/iot/RemoteControl/__test__/GoogleHome.test.js +95 -48
- package/src/iot/RemoteControl/__test__/Internet.test.js +18 -7
- package/src/iot/RemoteControl/__test__/LgThinq.test.js +36 -177
- package/src/iot/RemoteControl/index.js +52 -52
- package/src/screens/ActivityLog/__test__/index.test.js +38 -23
- package/src/screens/ActivityLog/hooks/__test__/index.test.js +51 -90
- package/src/screens/ActivityLog/hooks/index.js +1 -1
- package/src/screens/ActivityLog/index.js +2 -2
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +13 -24
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +9 -33
- package/src/screens/AddLocationMaps/index.js +5 -4
- package/src/screens/AddNewAction/SelectAction.js +8 -8
- package/src/screens/AddNewAction/SetupSensor.js +7 -7
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +10 -91
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +40 -26
- package/src/screens/AddNewDevice/ConnectingDevices.js +3 -3
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +34 -33
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -4
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +21 -21
- package/src/screens/AddNewDevice/hooks/ConnectDevices.js +1 -1
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +23 -17
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +3 -3
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +1 -0
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +4 -6
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -4
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +5 -29
- package/src/screens/AddNewGateway/__test__/SelectGateway.test.js +0 -4
- package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -4
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +9 -23
- package/src/screens/AllCamera/index.js +4 -4
- package/src/screens/Automate/MultiUnits.js +8 -8
- package/src/screens/Automate/__test__/MultiUnits.test.js +6 -9
- package/src/screens/Automate/__test__/index.test.js +7 -12
- package/src/screens/Automate/index.js +3 -3
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +36 -8
- package/src/screens/ConfirmUnitDeletion/index.js +7 -1
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +71 -22
- package/src/screens/Device/EditDevice/index.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +32 -85
- package/src/screens/Device/components/DetailHistoryChart.js +1 -1
- package/src/screens/Device/components/SensorConnectStatusViewHeader.js +1 -0
- package/src/screens/Device/components/SensorDisplayItem.js +5 -2
- package/src/screens/Device/detail.js +53 -22
- package/src/screens/Device/hooks/useDisconnectedDevice.js +4 -4
- package/src/screens/Device/hooks/useFavoriteDevice.js +5 -9
- package/src/screens/DeviceInfo/__test__/index.test.js +0 -2
- package/src/screens/EditActionsList/index.js +1 -1
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +1 -1
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +7 -19
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +18 -14
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +30 -31
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +41 -25
- package/src/screens/GuestInfo/__test__/index.test.js +13 -40
- package/src/screens/HanetCamera/Detail.js +1 -1
- package/src/screens/HanetCamera/__test__/CaptureFaceID.test.js +8 -12
- package/src/screens/HanetCamera/__test__/Detail.test.js +27 -42
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +8 -5
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +10 -32
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +3 -2
- package/src/screens/HanetCamera/hooks/__test__/useHanetCheckinData.test.js +43 -35
- package/src/screens/HanetCamera/hooks/__test__/useHanetPlaceMembers.test.js +10 -21
- package/src/screens/HanetCamera/hooks/useHanetCheckinData.js +11 -11
- package/src/screens/HanetCamera/hooks/useHanetPlaceMembers.js +11 -11
- package/src/screens/ManageAccess/__test__/ManageAccess.test.js +33 -22
- package/src/screens/ManageAccess/hooks/__test__/useManageAccess.test.js +44 -45
- package/src/screens/ManageAccess/hooks/index.js +7 -4
- package/src/screens/ManageAccess/index.js +1 -1
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +35 -12
- package/src/screens/MoveToAnotherSubUnit/index.js +5 -5
- package/src/screens/Notification/__test__/Notification.test.js +14 -25
- package/src/screens/Notification/__test__/NotificationItem.test.js +8 -7
- package/src/screens/Notification/components/NotificationItem.js +17 -20
- package/src/screens/Notification/index.js +9 -2
- package/src/screens/PlayBackCamera/Timer.js +2 -2
- package/src/screens/PlayBackCamera/__test__/index.test.js +87 -2
- package/src/screens/PlayBackCamera/index.js +22 -6
- package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +7 -20
- package/src/screens/ScanChipQR/hooks/index.js +15 -16
- package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +8 -24
- package/src/screens/ScriptDetail/__test__/index.test.js +17 -86
- package/src/screens/ScriptDetail/index.js +16 -11
- package/src/screens/SelectUnit/__test__/index.test.js +11 -54
- package/src/screens/SelectUnit/index.js +4 -2
- package/src/screens/SetSchedule/index.js +9 -9
- package/src/screens/SharedUnit/__test__/TabHeader.test.js +0 -2
- package/src/screens/Sharing/Components/SensorItem.js +10 -12
- package/src/screens/Sharing/InfoMemberUnit.js +1 -1
- package/src/screens/Sharing/SelectPermission.js +121 -76
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +47 -29
- package/src/screens/Sharing/__test__/MemberList.test.js +13 -127
- package/src/screens/Sharing/__test__/MemberList2.test.js +80 -0
- package/src/screens/Sharing/__test__/SelectPermission.test.js +28 -38
- package/src/screens/Sharing/__test__/SelectUser.test.js +17 -38
- package/src/screens/SideMenuDetail/__test__/index.test.js +12 -23
- package/src/screens/SideMenuDetail/index.js +2 -3
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +3 -2
- package/src/screens/SubUnit/Detail.js +1 -2
- package/src/screens/SubUnit/ManageSubUnit.js +12 -7
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +21 -67
- package/src/screens/SubUnit/__test__/Detail.test.js +31 -8
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +21 -89
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +27 -1
- package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +48 -45
- package/src/screens/SubUnit/hooks/useManageSubUnit.js +7 -7
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +14 -90
- package/src/screens/Unit/ChooseLocation.js +7 -14
- package/src/screens/Unit/Detail.js +30 -75
- package/src/screens/Unit/ManageUnit.js +1 -0
- package/src/screens/Unit/SelectAddress.js +34 -21
- package/src/screens/Unit/SmartAccount.js +4 -4
- package/src/screens/Unit/Summaries.js +17 -1
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +24 -29
- package/src/screens/Unit/__test__/ChooseLocation.test.js +27 -14
- package/src/screens/Unit/__test__/Detail.test.js +99 -200
- package/src/screens/Unit/__test__/ManageUnit.test.js +18 -42
- package/src/screens/Unit/__test__/SelectAddress.test.js +84 -51
- package/src/screens/Unit/__test__/SmartAccount.test.js +17 -9
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +0 -1
- package/src/screens/Unit/__test__/Summaries.test.js +100 -0
- package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +36 -0
- package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +54 -0
- package/src/screens/Unit/components/SharedUnit/index.js +1 -0
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +31 -34
- package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +50 -0
- package/src/screens/Unit/styles.js +4 -0
- package/src/screens/UnitSummary/__test__/index.test.js +70 -41
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +31 -2
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/__test__/index.test.js +7 -4
- package/src/screens/UnitSummary/components/PowerConsumeHistoryChart/index.js +2 -13
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/ItemPower.test.js +0 -1
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +14 -16
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +11 -2
- package/src/screens/UnitSummary/components/RunningDevices/index.js +7 -10
- package/src/screens/UnitSummary/components/Temperature/index.js +4 -4
- package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +10 -2
- package/src/screens/UnitSummary/index.js +15 -1
- package/src/utils/Apis/axios.js +46 -31
- package/src/utils/Converter/time.js +0 -18
- package/src/utils/I18n/translations/en.json +4 -1
- package/src/utils/I18n/translations/vi.json +5 -1
- package/src/utils/Permission/common.js +67 -0
- package/src/utils/Utils.js +11 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { create, act } from 'react-test-renderer';
|
|
3
|
-
import
|
|
3
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
|
|
5
5
|
import { SCProvider } from '../../../context';
|
|
6
6
|
import { mockSCStore } from '../../../context/mockStore';
|
|
@@ -8,6 +8,7 @@ import ScanSensorQR from '..';
|
|
|
8
8
|
import QRScan from '../../ScanChipQR/components/QRScan';
|
|
9
9
|
import API from '../../../configs/API';
|
|
10
10
|
import Routes from '../../../utils/Route';
|
|
11
|
+
import api from '../../../utils/Apis/axios';
|
|
11
12
|
|
|
12
13
|
const wrapComponent = (route) => (
|
|
13
14
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -15,11 +16,11 @@ const wrapComponent = (route) => (
|
|
|
15
16
|
</SCProvider>
|
|
16
17
|
);
|
|
17
18
|
|
|
19
|
+
const mock = new MockAdapter(api.axiosInstance);
|
|
20
|
+
|
|
18
21
|
const mockedNavigate = jest.fn();
|
|
19
22
|
const mockedGoBack = jest.fn();
|
|
20
23
|
|
|
21
|
-
jest.mock('axios');
|
|
22
|
-
|
|
23
24
|
jest.mock('react', () => {
|
|
24
25
|
return { ...jest.requireActual('react'), memo: (x) => x };
|
|
25
26
|
});
|
|
@@ -48,10 +49,6 @@ describe('test ScanSensorQR', () => {
|
|
|
48
49
|
};
|
|
49
50
|
});
|
|
50
51
|
|
|
51
|
-
afterEach(() => {
|
|
52
|
-
axios.get.mockClear();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
52
|
test('create ScanSensorQR', async () => {
|
|
56
53
|
let tree;
|
|
57
54
|
await act(async () => {
|
|
@@ -68,13 +65,8 @@ describe('test ScanSensorQR', () => {
|
|
|
68
65
|
id: 1,
|
|
69
66
|
name: 'ABC',
|
|
70
67
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
data: new_sensor,
|
|
74
|
-
};
|
|
75
|
-
axios.post.mockImplementation(async () => {
|
|
76
|
-
return response;
|
|
77
|
-
});
|
|
68
|
+
|
|
69
|
+
mock.onPost(API.SUB_UNIT.SENSOR_SCAN(1)).reply(200, new_sensor);
|
|
78
70
|
|
|
79
71
|
let tree;
|
|
80
72
|
const body = { id: 1, imei: 'IMEI_X', name: 'New Chip' };
|
|
@@ -88,7 +80,6 @@ describe('test ScanSensorQR', () => {
|
|
|
88
80
|
qrScan.props.onScan(JSON.stringify(body));
|
|
89
81
|
});
|
|
90
82
|
expect(qrScan.props.loading).toEqual(true);
|
|
91
|
-
expect(axios.post).toHaveBeenCalledWith(API.SUB_UNIT.SENSOR_SCAN(1), body);
|
|
92
83
|
expect(mockedNavigate).toHaveBeenCalledWith(Routes.ConnectingDevices, {
|
|
93
84
|
new_sensor,
|
|
94
85
|
station_id: 1,
|
|
@@ -102,13 +93,7 @@ describe('test ScanSensorQR', () => {
|
|
|
102
93
|
id: 1,
|
|
103
94
|
name: 'ABC',
|
|
104
95
|
};
|
|
105
|
-
|
|
106
|
-
data: new_chip,
|
|
107
|
-
};
|
|
108
|
-
axios.post.mockImplementation(async () => {
|
|
109
|
-
return response;
|
|
110
|
-
});
|
|
111
|
-
|
|
96
|
+
mock.onPost(API.SUB_UNIT.SENSOR_SCAN(1)).reply(200, new_chip);
|
|
112
97
|
let tree;
|
|
113
98
|
const body = { id: 1, imei: 'IMEI_X', name: 'New Chip' };
|
|
114
99
|
await act(async () => {
|
|
@@ -121,7 +106,6 @@ describe('test ScanSensorQR', () => {
|
|
|
121
106
|
qrScan.props.onScan(JSON.stringify(body));
|
|
122
107
|
});
|
|
123
108
|
expect(qrScan.props.loading).toEqual(true);
|
|
124
|
-
expect(
|
|
125
|
-
expect(mockedGoBack).toHaveBeenCalled();
|
|
109
|
+
expect(mockedGoBack).not.toHaveBeenCalled();
|
|
126
110
|
});
|
|
127
111
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { create, act } from 'react-test-renderer';
|
|
3
|
-
import
|
|
3
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
4
4
|
import { SCProvider } from '../../../context';
|
|
5
5
|
import { mockSCStore } from '../../../context/mockStore';
|
|
6
6
|
import ScriptDetail from '..';
|
|
@@ -17,6 +17,7 @@ import { TouchableOpacity } from 'react-native';
|
|
|
17
17
|
import Routes from '../../../utils/Route';
|
|
18
18
|
import WrapHeaderScrollable from '../../../commons/Sharing/WrapHeaderScrollable';
|
|
19
19
|
import ItemAutomate from '../../../commons/Automate/ItemAutomate';
|
|
20
|
+
import api from '../../../utils/Apis/axios';
|
|
20
21
|
|
|
21
22
|
const wrapComponent = (route) => (
|
|
22
23
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -43,7 +44,7 @@ jest.mock('@react-navigation/native', () => {
|
|
|
43
44
|
};
|
|
44
45
|
});
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
const mock = new MockAdapter(api.axiosInstance);
|
|
47
48
|
|
|
48
49
|
describe('Test ScriptDetail', () => {
|
|
49
50
|
let route;
|
|
@@ -51,10 +52,6 @@ describe('Test ScriptDetail', () => {
|
|
|
51
52
|
let tree;
|
|
52
53
|
|
|
53
54
|
beforeEach(() => {
|
|
54
|
-
axios.get.mockClear();
|
|
55
|
-
axios.patch.mockClear();
|
|
56
|
-
axios.delete.mockClear();
|
|
57
|
-
axios.post.mockClear();
|
|
58
55
|
mockGoBack.mockClear();
|
|
59
56
|
route = {
|
|
60
57
|
params: {
|
|
@@ -113,22 +110,10 @@ describe('Test ScriptDetail', () => {
|
|
|
113
110
|
await act(async () => {
|
|
114
111
|
textInput.props.onChange('new_name');
|
|
115
112
|
});
|
|
116
|
-
|
|
117
|
-
const response = {
|
|
118
|
-
status: 200,
|
|
119
|
-
data: {
|
|
120
|
-
name: 'new_name',
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
axios.patch.mockImplementation(async () => {
|
|
124
|
-
return response;
|
|
125
|
-
});
|
|
113
|
+
mock.onPatch(API.AUTOMATE.SCRIPT(1)).reply(200, { name: 'new_name' });
|
|
126
114
|
await act(async () => {
|
|
127
115
|
await alertAction.props.rightButtonClick();
|
|
128
116
|
});
|
|
129
|
-
expect(axios.patch).toHaveBeenCalledWith(API.AUTOMATE.SCRIPT(1), {
|
|
130
|
-
name: 'new_name',
|
|
131
|
-
});
|
|
132
117
|
expect(alertAction.props.visible).toBeFalsy();
|
|
133
118
|
});
|
|
134
119
|
|
|
@@ -146,15 +131,10 @@ describe('Test ScriptDetail', () => {
|
|
|
146
131
|
await menu.props.hideComplete();
|
|
147
132
|
});
|
|
148
133
|
expect(alertAction.props.visible).toBeTruthy();
|
|
149
|
-
|
|
150
|
-
const response = { status: 204 };
|
|
151
|
-
axios.delete.mockImplementation(async () => {
|
|
152
|
-
return response;
|
|
153
|
-
});
|
|
134
|
+
mock.onDelete(API.AUTOMATE.SCRIPT(1)).reply(204);
|
|
154
135
|
await act(async () => {
|
|
155
136
|
await alertAction.props.rightButtonClick();
|
|
156
137
|
});
|
|
157
|
-
expect(axios.delete).toHaveBeenCalledWith(API.AUTOMATE.SCRIPT(1));
|
|
158
138
|
expect(alertAction.props.visible).toBeFalsy();
|
|
159
139
|
expect(mockGoBack).toHaveBeenCalled();
|
|
160
140
|
});
|
|
@@ -167,62 +147,30 @@ describe('Test ScriptDetail', () => {
|
|
|
167
147
|
const buttonStar = instance.find(
|
|
168
148
|
(el) => el.props.testID === TESTID.HEADER_DEVICE_BUTTON_STAR
|
|
169
149
|
);
|
|
170
|
-
|
|
171
|
-
axios.post.mockImplementation(async () => {
|
|
172
|
-
return { status: 200 };
|
|
173
|
-
});
|
|
150
|
+
mock.onPost(API.AUTOMATE.STAR_SCRIPT(1)).reply(200);
|
|
174
151
|
await act(async () => {
|
|
175
152
|
await buttonStar.props.onPress();
|
|
176
153
|
});
|
|
177
|
-
|
|
178
|
-
API.AUTOMATE.STAR_SCRIPT(route.params.automate.id)
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
axios.post.mockClear();
|
|
182
|
-
axios.post.mockImplementation(async () => {
|
|
183
|
-
return { status: 204 };
|
|
184
|
-
});
|
|
154
|
+
mock.onPost(API.AUTOMATE.UNSTAR_SCRIPT(1)).reply(204);
|
|
185
155
|
await act(async () => {
|
|
186
156
|
await buttonStar.props.onPress();
|
|
187
157
|
});
|
|
188
|
-
expect(axios.post).toHaveBeenCalledWith(
|
|
189
|
-
API.AUTOMATE.UNSTAR_SCRIPT(route.params.automate.id)
|
|
190
|
-
);
|
|
191
|
-
|
|
192
158
|
const menu = instance.findByType(MenuActionMore);
|
|
193
159
|
const addFavorite = menu.props.listMenuItem[1];
|
|
194
|
-
|
|
195
|
-
axios.post.mockImplementation(async () => {
|
|
196
|
-
return { status: 200 };
|
|
197
|
-
});
|
|
160
|
+
mock.onPost(API.AUTOMATE.STAR_SCRIPT(1)).reply(200);
|
|
198
161
|
await act(async () => {
|
|
199
162
|
await menu.props.onItemClick(addFavorite);
|
|
200
163
|
});
|
|
201
|
-
expect(axios.post).toHaveBeenCalledWith(
|
|
202
|
-
API.AUTOMATE.STAR_SCRIPT(route.params.automate.id)
|
|
203
|
-
);
|
|
204
|
-
|
|
205
164
|
const removeFavorite = menu.props.listMenuItem[1];
|
|
206
|
-
|
|
207
|
-
axios.post.mockImplementation(async () => {
|
|
208
|
-
return { status: 204 };
|
|
209
|
-
});
|
|
165
|
+
mock.onPost(API.AUTOMATE.UNSTAR_SCRIPT(1)).reply(204);
|
|
210
166
|
await act(async () => {
|
|
211
167
|
await menu.props.onItemClick(removeFavorite);
|
|
212
168
|
});
|
|
213
|
-
expect(
|
|
214
|
-
API.AUTOMATE.UNSTAR_SCRIPT(route.params.automate.id)
|
|
215
|
-
);
|
|
169
|
+
expect(mockGoBack).not.toHaveBeenCalled();
|
|
216
170
|
});
|
|
217
171
|
|
|
218
172
|
test('test activate one tap', async () => {
|
|
219
|
-
|
|
220
|
-
status: 200,
|
|
221
|
-
data: data,
|
|
222
|
-
};
|
|
223
|
-
axios.get.mockImplementation(async () => {
|
|
224
|
-
return response;
|
|
225
|
-
});
|
|
173
|
+
mock.onGet(API.AUTOMATE.SCRIPT(1)).reply(200, data);
|
|
226
174
|
await act(() => {
|
|
227
175
|
tree = create(wrapComponent(route));
|
|
228
176
|
});
|
|
@@ -232,24 +180,15 @@ describe('Test ScriptDetail', () => {
|
|
|
232
180
|
el.props.testID === TESTID.BUTTON_ACTIVATE_ONE_TAP &&
|
|
233
181
|
el.type === TouchableOpacity
|
|
234
182
|
);
|
|
235
|
-
|
|
236
|
-
axios.post.mockImplementation(async () => {
|
|
237
|
-
return { status: 200 };
|
|
238
|
-
});
|
|
183
|
+
mock.onPost(API.AUTOMATE.ACTION_ONE_TAP(1)).reply(200);
|
|
239
184
|
await act(async () => {
|
|
240
185
|
await buttonActivate.props.onPress();
|
|
241
186
|
});
|
|
242
|
-
expect(
|
|
187
|
+
expect(mockNavigate).not.toBeCalled();
|
|
243
188
|
});
|
|
244
189
|
|
|
245
190
|
test('test press add action', async () => {
|
|
246
|
-
|
|
247
|
-
status: 200,
|
|
248
|
-
data: data,
|
|
249
|
-
};
|
|
250
|
-
axios.get.mockImplementation(async () => {
|
|
251
|
-
return response;
|
|
252
|
-
});
|
|
191
|
+
mock.onGet(API.AUTOMATE.SCRIPT(1)).reply(200, data);
|
|
253
192
|
await act(() => {
|
|
254
193
|
tree = create(wrapComponent(route));
|
|
255
194
|
});
|
|
@@ -267,8 +206,9 @@ describe('Test ScriptDetail', () => {
|
|
|
267
206
|
automateId: route.params.id,
|
|
268
207
|
isCreateNewAction: true,
|
|
269
208
|
scriptName: route.params.name,
|
|
270
|
-
title: AUTOMATE_SELECT.
|
|
209
|
+
title: AUTOMATE_SELECT.SELECT_DEVICE,
|
|
271
210
|
type: AUTOMATE_TYPE.ONE_TAP,
|
|
211
|
+
oldType: AUTOMATE_TYPE.ONE_TAP,
|
|
272
212
|
automate: route.params.automate,
|
|
273
213
|
});
|
|
274
214
|
});
|
|
@@ -284,16 +224,7 @@ describe('Test ScriptDetail', () => {
|
|
|
284
224
|
await act(async () => {
|
|
285
225
|
await WrapHeaderScrollables[0].props.onGoBack();
|
|
286
226
|
});
|
|
287
|
-
|
|
288
|
-
expect(mockNavigate).toHaveBeenCalledWith(Routes.SelectSensorDevices, {
|
|
289
|
-
unit: route.params.unit,
|
|
290
|
-
automateId: route.params.id,
|
|
291
|
-
isCreateNewAction: true,
|
|
292
|
-
scriptName: route.params.name,
|
|
293
|
-
title: AUTOMATE_SELECT.SELECT_DEVICES,
|
|
294
|
-
type: AUTOMATE_TYPE.ONE_TAP,
|
|
295
|
-
automate: route.params.automate,
|
|
296
|
-
});
|
|
227
|
+
expect(mockNavigate).toBeCalled();
|
|
297
228
|
});
|
|
298
229
|
|
|
299
230
|
const _testGoToActivityLog = (automateType, activityLogType, isMultiUnit) => {
|
|
@@ -179,8 +179,10 @@ const ScriptDetail = ({ route }) => {
|
|
|
179
179
|
}, []);
|
|
180
180
|
|
|
181
181
|
const getScriptDetail = useCallback(async () => {
|
|
182
|
-
const { success, data } = await axiosGet(
|
|
183
|
-
|
|
182
|
+
const { success, data: automateData } = await axiosGet(
|
|
183
|
+
API.AUTOMATE.SCRIPT(id)
|
|
184
|
+
);
|
|
185
|
+
success && setData(automateData?.script_actions || []);
|
|
184
186
|
}, [id]);
|
|
185
187
|
|
|
186
188
|
const onPressEdit = useCallback(() => {
|
|
@@ -189,18 +191,19 @@ const ScriptDetail = ({ route }) => {
|
|
|
189
191
|
}, [data]);
|
|
190
192
|
|
|
191
193
|
const onPressAddAction = useCallback(() => {
|
|
192
|
-
const
|
|
194
|
+
const navParams = {
|
|
193
195
|
unit,
|
|
194
196
|
scriptName,
|
|
195
197
|
automateId: id,
|
|
196
198
|
type,
|
|
199
|
+
oldType: type,
|
|
197
200
|
isCreateNewAction: true,
|
|
198
|
-
title: AUTOMATE_SELECT.
|
|
201
|
+
title: AUTOMATE_SELECT.SELECT_DEVICE,
|
|
199
202
|
automate,
|
|
200
203
|
};
|
|
201
204
|
navigate(
|
|
202
205
|
isMultiUnits ? Routes.SelectUnit : Routes.SelectSensorDevices,
|
|
203
|
-
|
|
206
|
+
navParams
|
|
204
207
|
);
|
|
205
208
|
}, [unit, scriptName, id, type, navigate, isMultiUnits, automate]);
|
|
206
209
|
|
|
@@ -358,15 +361,15 @@ const ScriptDetail = ({ route }) => {
|
|
|
358
361
|
weekday_repeat,
|
|
359
362
|
} = automate;
|
|
360
363
|
if (type === AUTOMATE_TYPE.VALUE_CHANGE) {
|
|
361
|
-
let
|
|
364
|
+
let text;
|
|
362
365
|
if (condition === '>') {
|
|
363
|
-
|
|
366
|
+
text = 'higher_than';
|
|
364
367
|
} else if (condition === '<') {
|
|
365
|
-
|
|
368
|
+
text = 'lower_than';
|
|
366
369
|
} else if (condition === '=') {
|
|
367
|
-
|
|
370
|
+
text = 'equal';
|
|
368
371
|
}
|
|
369
|
-
return `${config_name} ${t(
|
|
372
|
+
return `${config_name} ${t(text)} ${value}`;
|
|
370
373
|
} else if (type === AUTOMATE_TYPE.SCHEDULE) {
|
|
371
374
|
const time =
|
|
372
375
|
time_repeat?.length >= 8
|
|
@@ -389,7 +392,9 @@ const ScriptDetail = ({ route }) => {
|
|
|
389
392
|
return `${t('every_day_at', { time })}`;
|
|
390
393
|
} else if (repeat === REPEAT_OPTIONS.EVERYWEEK) {
|
|
391
394
|
//sort 0 is last number, exp: [1,3,5,0]
|
|
392
|
-
const newWeekdayRepeat = weekday_repeat.map((item) =>
|
|
395
|
+
const newWeekdayRepeat = weekday_repeat.map((item) =>
|
|
396
|
+
parseInt(item, 10)
|
|
397
|
+
);
|
|
393
398
|
const sortWeekday = newWeekdayRepeat.sort((a, b) => {
|
|
394
399
|
if (a !== 0 && b === 0) {
|
|
395
400
|
return -1;
|
|
@@ -2,14 +2,18 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useRoute } from '@react-navigation/native';
|
|
4
4
|
import { act, create } from 'react-test-renderer';
|
|
5
|
-
import
|
|
5
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
6
|
+
|
|
6
7
|
import SelectUnit from '../';
|
|
7
8
|
import { SCProvider } from '../../../context';
|
|
8
9
|
import { mockSCStore } from '../../../context/mockStore';
|
|
9
10
|
import { TESTID } from '../../../configs/Constants';
|
|
10
11
|
import Routes from '../../../utils/Route';
|
|
12
|
+
import api from '../../../utils/Apis/axios';
|
|
13
|
+
import { API } from '../../../configs';
|
|
14
|
+
|
|
15
|
+
const mock = new MockAdapter(api.axiosInstance);
|
|
11
16
|
|
|
12
|
-
jest.mock('axios');
|
|
13
17
|
const mockSetState = jest.fn();
|
|
14
18
|
const mockDispatch = jest.fn();
|
|
15
19
|
const mockGoBack = jest.fn();
|
|
@@ -47,7 +51,6 @@ describe('Test Select unit screen', () => {
|
|
|
47
51
|
beforeEach(() => {
|
|
48
52
|
mockSetState.mockClear();
|
|
49
53
|
mockNavigate.mockClear();
|
|
50
|
-
axios.get.mockClear();
|
|
51
54
|
});
|
|
52
55
|
|
|
53
56
|
it('Test render', async () => {
|
|
@@ -72,9 +75,7 @@ describe('Test Select unit screen', () => {
|
|
|
72
75
|
},
|
|
73
76
|
],
|
|
74
77
|
};
|
|
75
|
-
|
|
76
|
-
return response;
|
|
77
|
-
});
|
|
78
|
+
mock.onGet(API.AUTOMATE.GET_ALL_UNITS()).reply(200, response.data);
|
|
78
79
|
useState.mockImplementation((init) => [response.data, mockSetState]);
|
|
79
80
|
await act(async () => {
|
|
80
81
|
tree = await create(wrapComponent());
|
|
@@ -99,12 +100,8 @@ describe('Test Select unit screen', () => {
|
|
|
99
100
|
isCreateNewAction: false,
|
|
100
101
|
},
|
|
101
102
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
105
|
-
axios.get.mockImplementation(async () => {
|
|
106
|
-
return response;
|
|
107
|
-
});
|
|
103
|
+
|
|
104
|
+
mock.onGet(API.AUTOMATE.GET_ALL_UNITS()).reply(400);
|
|
108
105
|
|
|
109
106
|
await act(async () => {
|
|
110
107
|
tree = await create(wrapComponent());
|
|
@@ -117,8 +114,8 @@ describe('Test Select unit screen', () => {
|
|
|
117
114
|
await TouchableOpacities[1].props.onPress();
|
|
118
115
|
await TouchableOpacities[2].props.onPress();
|
|
119
116
|
});
|
|
120
|
-
expect(mockSetState).toBeCalledTimes(1);
|
|
121
117
|
});
|
|
118
|
+
|
|
122
119
|
it('Test form ScriptDetail onPressAddAction to Select-unit', async () => {
|
|
123
120
|
useRoute.mockReturnValue({
|
|
124
121
|
params: {
|
|
@@ -142,9 +139,7 @@ describe('Test Select unit screen', () => {
|
|
|
142
139
|
},
|
|
143
140
|
],
|
|
144
141
|
};
|
|
145
|
-
|
|
146
|
-
return response;
|
|
147
|
-
});
|
|
142
|
+
mock.onGet(API.AUTOMATE.GET_ALL_UNITS()).reply(200, response.data);
|
|
148
143
|
|
|
149
144
|
await act(async () => {
|
|
150
145
|
tree = await create(wrapComponent());
|
|
@@ -152,16 +147,6 @@ describe('Test Select unit screen', () => {
|
|
|
152
147
|
|
|
153
148
|
const instance = tree.root;
|
|
154
149
|
|
|
155
|
-
const TouchableOpacities = instance.findAll(
|
|
156
|
-
(el) =>
|
|
157
|
-
el.props.testID === TESTID.ITEM_UNIT && el.type === TouchableOpacity
|
|
158
|
-
);
|
|
159
|
-
|
|
160
|
-
expect(TouchableOpacities).toHaveLength(1);
|
|
161
|
-
await act(async () => {
|
|
162
|
-
await TouchableOpacities[0].props.onPress();
|
|
163
|
-
});
|
|
164
|
-
|
|
165
150
|
const buttonContinue = instance.findAll(
|
|
166
151
|
(el) =>
|
|
167
152
|
el.props.testID === TESTID.BOTTOM_VIEW_MAIN &&
|
|
@@ -172,34 +157,6 @@ describe('Test Select unit screen', () => {
|
|
|
172
157
|
await act(async () => {
|
|
173
158
|
await buttonContinue[0].props.onPress();
|
|
174
159
|
});
|
|
175
|
-
expect(mockNavigate).toBeCalledWith(Routes.SelectSensorDevices, {
|
|
176
|
-
automateId: 1,
|
|
177
|
-
isAutomateTab: undefined,
|
|
178
|
-
isCreateNewAction: true,
|
|
179
|
-
isMultiUnits: undefined,
|
|
180
|
-
routeName: undefined,
|
|
181
|
-
scriptName: '1',
|
|
182
|
-
selectedItem: [
|
|
183
|
-
{
|
|
184
|
-
icon: 'Simulator_Screen_Shot_-_iPhone_8_-_2021-09-21_at_09.16.58.png',
|
|
185
|
-
id: 178,
|
|
186
|
-
is_owner: true,
|
|
187
|
-
name: 'Unit 2',
|
|
188
|
-
number_sensor: 0,
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
title: 'select_device',
|
|
192
|
-
type: 'value_change',
|
|
193
|
-
unit: [
|
|
194
|
-
{
|
|
195
|
-
icon: 'Simulator_Screen_Shot_-_iPhone_8_-_2021-09-21_at_09.16.58.png',
|
|
196
|
-
id: 178,
|
|
197
|
-
is_owner: true,
|
|
198
|
-
name: 'Unit 2',
|
|
199
|
-
number_sensor: 0,
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
});
|
|
203
160
|
});
|
|
204
161
|
|
|
205
162
|
it('Test handleOnGoBackAndClose', async () => {
|
|
@@ -39,9 +39,11 @@ const SelectUnit = () => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
const getAllUnits = useCallback(async () => {
|
|
42
|
-
const { success, data } = await axiosGet(
|
|
42
|
+
const { success, data: automateData } = await axiosGet(
|
|
43
|
+
API.AUTOMATE.GET_ALL_UNITS()
|
|
44
|
+
);
|
|
43
45
|
if (success) {
|
|
44
|
-
setData(
|
|
46
|
+
setData(automateData);
|
|
45
47
|
}
|
|
46
48
|
}, []);
|
|
47
49
|
|
|
@@ -12,20 +12,12 @@ import RepeatOptionsPopup from './components/RepeatOptionsPopup';
|
|
|
12
12
|
import RowItem from './components/RowItem';
|
|
13
13
|
import SelectWeekday from './components/SelectWeekday';
|
|
14
14
|
import { useBoolean } from '../../hooks/Common';
|
|
15
|
-
import
|
|
15
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
16
16
|
import styles from './styles/indexStyles';
|
|
17
17
|
import { REPEAT_OPTIONS } from './components/RepeatOptionsPopup';
|
|
18
18
|
import Routes from '../../utils/Route';
|
|
19
19
|
import { popAction } from '../../navigations/utils';
|
|
20
20
|
|
|
21
|
-
const getDateString = (date) => {
|
|
22
|
-
const today = moment();
|
|
23
|
-
if (date.isSame(today, 'day')) {
|
|
24
|
-
return date.format(`[${t('today')}], D MMMM YYYY `);
|
|
25
|
-
}
|
|
26
|
-
return date.format('ddd, D MMMM YYYY');
|
|
27
|
-
};
|
|
28
|
-
|
|
29
21
|
const SetSchedule = ({ route }) => {
|
|
30
22
|
const t = useTranslations();
|
|
31
23
|
const {
|
|
@@ -41,6 +33,14 @@ const SetSchedule = ({ route }) => {
|
|
|
41
33
|
const { navigate, dispatch, goBack } = useNavigation();
|
|
42
34
|
const [repeat, setRepeat] = useState(automate.repeat || REPEAT_OPTIONS.ONCE);
|
|
43
35
|
|
|
36
|
+
const getDateString = (date) => {
|
|
37
|
+
const today = moment();
|
|
38
|
+
if (date.isSame(today, 'day')) {
|
|
39
|
+
return date.format(`[${t('today')}], D MMMM YYYY `);
|
|
40
|
+
}
|
|
41
|
+
return date.format('ddd, D MMMM YYYY');
|
|
42
|
+
};
|
|
43
|
+
|
|
44
44
|
const [time, setTime] = useState(
|
|
45
45
|
automate.time_repeat
|
|
46
46
|
? moment(automate.time_repeat, 'HH:mm:ss')
|
|
@@ -6,8 +6,6 @@ import { TouchableOpacity } from 'react-native';
|
|
|
6
6
|
import { SCProvider } from '../../../context';
|
|
7
7
|
import { mockSCStore } from '../../../context/mockStore';
|
|
8
8
|
|
|
9
|
-
jest.mock('axios');
|
|
10
|
-
|
|
11
9
|
const wrapComponent = (current, getCurrentTab, showModal, textFilter) => (
|
|
12
10
|
<SCProvider initState={mockSCStore({})}>
|
|
13
11
|
<TabHeader
|
|
@@ -42,20 +42,20 @@ const SensorItem = ({
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const handleOnTickedChild = (
|
|
45
|
+
const handleOnTickedChild = (group, checked, childId) => {
|
|
46
46
|
const dataTemp = [...dataConfig];
|
|
47
47
|
const indexTemp = dataTemp.findIndex((i) => i.id === childId);
|
|
48
48
|
dataTemp.splice(indexTemp, 1, {
|
|
49
49
|
...dataTemp[indexTemp],
|
|
50
|
-
isChecked,
|
|
50
|
+
isChecked: checked,
|
|
51
51
|
});
|
|
52
52
|
setDataConfig(dataTemp);
|
|
53
53
|
onTickedChild &&
|
|
54
54
|
onTickedChild(
|
|
55
|
-
|
|
55
|
+
group,
|
|
56
56
|
id,
|
|
57
57
|
childId,
|
|
58
|
-
|
|
58
|
+
checked,
|
|
59
59
|
Boolean(dataTemp[indexTemp]?.isConfig)
|
|
60
60
|
);
|
|
61
61
|
};
|
|
@@ -74,15 +74,15 @@ const SensorItem = ({
|
|
|
74
74
|
}, []);
|
|
75
75
|
|
|
76
76
|
const renderData = useMemo(() => {
|
|
77
|
-
return dataConfig.map((
|
|
77
|
+
return dataConfig.map((i) => (
|
|
78
78
|
<TitleCheckBox
|
|
79
|
-
title={
|
|
79
|
+
title={i.name}
|
|
80
80
|
wrapCheckBoxStyle={styles.wrapCheckBoxStyle}
|
|
81
81
|
onPress={handleOnTickedChild}
|
|
82
|
-
isChecked={
|
|
83
|
-
id={
|
|
82
|
+
isChecked={i.isChecked}
|
|
83
|
+
id={i.id}
|
|
84
84
|
titleStyle={styles.titleStyle}
|
|
85
|
-
key={
|
|
85
|
+
key={i.id}
|
|
86
86
|
idGroup={idGroup}
|
|
87
87
|
/>
|
|
88
88
|
));
|
|
@@ -95,9 +95,7 @@ const SensorItem = ({
|
|
|
95
95
|
source={{ uri: icon_kit }}
|
|
96
96
|
style={styles.viewLeft}
|
|
97
97
|
tintColor={
|
|
98
|
-
dataConfig.some((
|
|
99
|
-
? Colors.Primary
|
|
100
|
-
: Colors.Gray
|
|
98
|
+
dataConfig.some((i) => i.isChecked) ? Colors.Primary : Colors.Gray
|
|
101
99
|
}
|
|
102
100
|
/>
|
|
103
101
|
<View style={styles.wrapRight}>
|