@eohjsc/react-native-smart-city 0.3.71 → 0.3.73
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/index.js +0 -2
- package/package.json +4 -5
- package/src/Images/ThreeButton/buttonCircleBig.png +0 -0
- package/src/Images/ThreeButton/buttonCircleSmall.png +0 -0
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLockStyle.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +12 -11
- package/src/commons/ActionGroup/SliderRangeTemplate.js +2 -3
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +1 -0
- package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonCircle.test.js +52 -0
- package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonDefault.test.js +52 -0
- package/src/commons/ActionGroup/{__test__ → ThreeButtonTemplate/__test__}/ThreeButtonTemplate.test.js +21 -8
- package/src/commons/ActionGroup/ThreeButtonTemplate/components/ThreeButtonCircle.js +103 -0
- package/src/commons/ActionGroup/ThreeButtonTemplate/components/ThreeButtonCircleStyles.js +31 -0
- package/src/commons/ActionGroup/ThreeButtonTemplate/components/ThreeButtonDefault.js +96 -0
- package/src/commons/ActionGroup/{ThreeButtonTemplateStyle.js → ThreeButtonTemplate/components/ThreeButtonDefaultStyles.js} +11 -34
- package/src/commons/ActionGroup/{ThreeButtonTemplate.js → ThreeButtonTemplate/index.js} +48 -51
- package/src/commons/ActionGroup/ThreeButtonTemplate/styles.js +27 -0
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +1 -0
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +39 -34
- package/src/commons/ActionGroup/__test__/SliderRangeTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +19 -10
- package/src/commons/ActionGroup/__test__/TimerActionTemplateWithutConfigValue.test.js +0 -1
- package/src/commons/ActionGroup/__test__/index.test.js +24 -16
- package/src/commons/ActionTemplate/__test__/index.test.js +5 -1
- package/src/commons/AlertAction/__test__/AlertAction.test.js +2 -2
- package/src/commons/Automate/__test__/ItemAutomate.test.js +1 -1
- package/src/commons/Calendar/__test__/Calendar.test.js +3 -5
- package/src/commons/CameraDevice/index.js +37 -22
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -3
- package/src/commons/Dashboard/MyUnit/index.js +1 -1
- package/src/commons/Device/ConnectedViewHeader.js +2 -1
- package/src/commons/Device/DeviceAlertStatus.js +1 -1
- package/src/commons/Device/DisconnectedView.js +10 -14
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +1 -1
- package/src/commons/Device/HorizontalBarChart.js +1 -1
- package/src/commons/Device/LinearChart/LinearChart.test.js +10 -4
- package/src/commons/Device/LinearChart.js +5 -1
- package/src/commons/Device/SonosSpeaker/__test__/SonosSpeaker.test.js +1 -1
- package/src/commons/Device/SonosSpeaker/index.js +1 -1
- package/src/commons/Device/WindDirection/Compass/Compass.test.js +12 -27
- package/src/commons/Device/WindDirection/Compass/index.js +15 -23
- package/src/commons/Device/WindSpeed/__test__/Anemometer.test.js +4 -4
- package/src/commons/Device/WindSpeed/__test__/ChartInfo.test.js +2 -2
- package/src/commons/Device/__test__/ConnectedViewHeader.test.js +11 -8
- package/src/commons/Device/__test__/DisconnectedView.test.js +8 -45
- package/src/commons/DisplayChecking/__test__/DisplayChecking.test.js +1 -1
- package/src/commons/DisplayChecking/index.js +4 -3
- package/src/commons/DisplayChecking/styles.js +2 -2
- package/src/commons/MediaPlayer/index.js +2 -1
- package/src/commons/MediaPlayerDetail/MediaPlayerFull.js +1 -1
- package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +0 -1
- package/src/commons/MediaPlayerDetail/index.js +2 -3
- package/src/commons/MenuActionAddnew/__test__/MenuActionAddNew.test.js +2 -1
- package/src/commons/MenuActionList/__test__/MenuActionList.test.js +1 -1
- package/src/commons/MenuActionList/index.js +8 -70
- package/src/commons/MenuActionList/styles.js +68 -0
- package/src/commons/Modal/__test__/ModalBottom.test.js +1 -10
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +45 -31
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +15 -13
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +12 -9
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +19 -13
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +5 -5
- package/src/commons/PreventAccess/index.js +3 -3
- package/src/commons/Sharing/__test__/MemberList.test.js +17 -6
- package/src/commons/Sharing/__test__/RowMember.test.js +0 -2
- package/src/commons/SubUnit/OneTap/index.js +6 -1
- package/src/commons/Today/__test__/Today.test.js +3 -3
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +1 -1
- package/src/configs/IOPinConstants.js +285 -0
- package/src/configs/SCConfig.js +3 -0
- package/src/hooks/IoT/useBluetoothConnection.js +2 -1
- package/src/libs/react-native-parallax-scroll-view/index.js +2 -1
- package/src/navigations/AllGatewayStack.js +3 -3
- package/src/navigations/UnitStack.js +0 -6
- package/src/screens/ActivityLog/__test__/index.test.js +16 -22
- package/src/screens/ActivityLog/index.js +2 -3
- package/src/screens/AddLocationMaps/index.js +1 -1
- package/src/screens/AddNewAction/SelectAction.js +3 -0
- package/src/screens/AddNewAction/SetupSensor.js +3 -3
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +12 -0
- package/src/screens/AddNewAction/__test__/SetupSensor.test.js +11 -24
- package/src/screens/AddNewGateway/ConnectingWifiGuide.js +4 -1
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectRouterGuide.test.js +0 -1
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +0 -1
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ZigbeeDeviceConnectGuide.test.js +0 -1
- package/src/screens/AddNewGateway/SetupGatewayWifiStyles.js +2 -2
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +22 -7
- package/src/screens/AllCamera/__test__/index.test.js +1 -1
- package/src/screens/AllCamera/index.js +1 -1
- package/src/screens/AllGateway/DetailConfigActionInternal/__test__/index.test.js +82 -0
- package/src/screens/AllGateway/DetailConfigActionInternal/index.js +84 -5
- package/src/screens/AllGateway/DetailConfigActionModbus/index.js +6 -4
- package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +63 -57
- package/src/screens/AllGateway/DeviceInternalDetail/index.js +32 -32
- package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +40 -79
- package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +36 -42
- package/src/screens/AllGateway/DeviceZigbeeDetail/index.js +4 -4
- package/src/screens/AllGateway/GatewayConnectionMethods/__test__/index.test.js +4 -1
- package/src/screens/AllGateway/GatewayConnectionMethods/index.js +4 -2
- package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +49 -61
- package/src/screens/AllGateway/GatewayDetail/index.js +2 -1
- package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +2 -1
- package/src/screens/AllGateway/components/Information/__test__/index.test.js +2 -1
- package/src/screens/AllGateway/components/Information/index.js +4 -2
- package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +1 -1
- package/src/screens/AllGateway/components/TabPaneCT/index.js +1 -1
- package/src/screens/AllGateway/hooks/useGateway.js +1 -0
- package/src/screens/AllGateway/test-utils.js +20 -0
- package/src/screens/Device/__test__/detail.test.js +8 -3
- package/src/screens/Device/components/SensorDisplayItem.js +1 -5
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -4
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +32 -4
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -5
- package/src/screens/EmergencyContacts/__test__/hooks.test.js +1 -1
- package/src/screens/GuestInfo/__test__/index.test.js +26 -14
- package/src/screens/GuestInfo/index.js +2 -2
- package/src/screens/HanetCamera/CaptureFaceID.js +1 -1
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +1 -5
- package/src/screens/HanetCamera/styles/captureFaceIDStyles.js +1 -1
- package/src/screens/PlayBackCamera/Timer.js +2 -3
- package/src/screens/PlayBackCamera/__test__/index.test.js +69 -48
- package/src/screens/ScanChipQR/components/QRScan/index.js +8 -8
- package/src/screens/SharedUnit/__test__/ShareUnit.test.js +20 -10
- package/src/screens/SharedUnit/index.js +19 -17
- package/src/screens/Sharing/InfoMemberUnit.js +2 -2
- package/src/screens/SmartAccount/Connecting/index.js +2 -2
- package/src/screens/SmartAccount/ListDevice/__test__/DeviceItem.test.js +4 -2
- package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +17 -8
- package/src/screens/SmartAccount/ListDevice/index.js +1 -1
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +9 -6
- package/src/screens/SmartAccount/SuccessfullyConnected/index.js +1 -0
- package/src/screens/SmartAccount/__test__/Connecting.test.js +2 -1
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +17 -6
- package/src/screens/SubUnit/EditSubUnit.js +6 -6
- package/src/screens/SubUnit/EditSubUnitStyles.js +2 -2
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +5 -6
- package/src/screens/SubUnit/__test__/Detail.test.js +2 -3
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +25 -10
- package/src/screens/Template/EditTemplate.js +13 -3
- package/src/screens/Template/__test__/EditTemplate.test.js +21 -15
- package/src/screens/Unit/Detail.js +157 -121
- package/src/screens/Unit/ManageUnit.js +3 -3
- package/src/screens/Unit/ManageUnitStyles.js +1 -1
- package/src/screens/Unit/SelectAddress.js +1 -1
- package/src/screens/Unit/__test__/Detail.test.js +40 -20
- package/src/screens/Unit/__test__/ManageUnit.test.js +18 -15
- package/src/screens/Unit/components/AutomateScript/index.js +9 -8
- package/src/screens/Unit/components/Header/index.js +1 -14
- package/src/screens/Unit/components/__test__/AutomateScript.test.js +10 -36
- package/src/screens/Unit/components/__test__/Header.test.js +14 -9
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +4 -5
- package/src/utils/I18n/translations/en.json +13 -12
- package/src/utils/I18n/translations/vi.json +12 -11
- package/src/utils/Route/index.js +1 -2
- package/src/utils/Utils.js +62 -2
- package/src/commons/Explore/ActivityIndicator/index.js +0 -49
- package/src/commons/Explore/CityItem/index.js +0 -116
- package/src/commons/Explore/HeaderExplore/index.js +0 -44
- package/src/commons/Explore/HeaderLabel/index.js +0 -46
- package/src/commons/Explore/LocationItem/index.js +0 -71
- package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +0 -58
- package/src/commons/Explore/SearchBox/index.js +0 -59
- package/src/commons/Explore/__test__/CityItem.test.js +0 -156
- package/src/commons/Explore/__test__/HeaderExplore.test.js +0 -25
- package/src/commons/Explore/__test__/HeaderLabel.test.js +0 -33
- package/src/commons/Explore/__test__/LocationItem.test.js +0 -31
- package/src/screens/Explore/__test__/Explore.test.js +0 -43
- package/src/screens/Explore/index.js +0 -201
- package/src/screens/Unit/MyAllUnit/index.js +0 -44
- package/src/screens/Unit/__test__/MyAllUnit.test.js +0 -87
- package/src/screens/Unit/components/ListMyAllUnit/index.js +0 -162
- package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +0 -117
- package/src/screens/Unit/components/MyAllUnit/__test__/MyAllUnit.test.js +0 -36
- package/src/screens/Unit/components/MyAllUnit/__test__/index.test.js +0 -54
- package/src/screens/Unit/components/MyAllUnit/index.js +0 -44
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TouchableOpacity } from 'react-native';
|
|
3
|
-
import { act, create } from 'react-test-renderer';
|
|
4
|
-
import { Colors } from '../../../../../configs';
|
|
5
|
-
import { AccessibilityLabel } from '../../../../../configs/Constants';
|
|
6
|
-
import HeaderUnit from '../../../../../commons/Unit/HeaderUnit';
|
|
7
|
-
const mockGoBack = jest.fn();
|
|
8
|
-
|
|
9
|
-
jest.mock('@react-navigation/native', () => {
|
|
10
|
-
return {
|
|
11
|
-
...jest.requireActual('@react-navigation/native'),
|
|
12
|
-
useNavigation: () => ({
|
|
13
|
-
goBack: mockGoBack,
|
|
14
|
-
}),
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe('Test HeaderUnit', () => {
|
|
19
|
-
let data;
|
|
20
|
-
const mockOnBack = jest.fn();
|
|
21
|
-
const mockOnAdd = jest.fn();
|
|
22
|
-
const mockOnMore = jest.fn();
|
|
23
|
-
|
|
24
|
-
beforeEach(() => {
|
|
25
|
-
data = {
|
|
26
|
-
transparent: false,
|
|
27
|
-
onBack: mockOnBack,
|
|
28
|
-
title: '',
|
|
29
|
-
onAdd: mockOnAdd,
|
|
30
|
-
onMore: mockOnMore,
|
|
31
|
-
hideRight: false,
|
|
32
|
-
hideRightPlus: false,
|
|
33
|
-
styleBoxTitle: {},
|
|
34
|
-
bottomBorder: {},
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
let tree;
|
|
38
|
-
|
|
39
|
-
it('onBack', async () => {
|
|
40
|
-
await act(async () => {
|
|
41
|
-
tree = await create(<HeaderUnit {...data} />);
|
|
42
|
-
});
|
|
43
|
-
const instance = tree.root;
|
|
44
|
-
const button = instance.find(
|
|
45
|
-
(el) =>
|
|
46
|
-
el.props.accessibilityLabel ===
|
|
47
|
-
AccessibilityLabel.HEADER_UNIT_BUTTON_BACK &&
|
|
48
|
-
el.type === TouchableOpacity
|
|
49
|
-
);
|
|
50
|
-
await act(async () => {
|
|
51
|
-
button.props.onPress();
|
|
52
|
-
});
|
|
53
|
-
expect(mockOnBack).toHaveBeenCalledTimes(1);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('goBack', async () => {
|
|
57
|
-
data.onBack = undefined;
|
|
58
|
-
await act(async () => {
|
|
59
|
-
tree = await create(<HeaderUnit {...data} />);
|
|
60
|
-
});
|
|
61
|
-
const instance = tree.root;
|
|
62
|
-
const button = instance.find(
|
|
63
|
-
(el) =>
|
|
64
|
-
el.props.accessibilityLabel ===
|
|
65
|
-
AccessibilityLabel.HEADER_UNIT_BUTTON_BACK &&
|
|
66
|
-
el.type === TouchableOpacity
|
|
67
|
-
);
|
|
68
|
-
await act(async () => {
|
|
69
|
-
button.props.onPress();
|
|
70
|
-
});
|
|
71
|
-
expect(mockGoBack).toHaveBeenCalledTimes(1);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('onAdd', async () => {
|
|
75
|
-
await act(async () => {
|
|
76
|
-
tree = await create(<HeaderUnit {...data} />);
|
|
77
|
-
});
|
|
78
|
-
const instance = tree.root;
|
|
79
|
-
const button = instance.find(
|
|
80
|
-
(el) =>
|
|
81
|
-
el.props.accessibilityLabel ===
|
|
82
|
-
AccessibilityLabel.HEADER_UNIT_BUTTON_ADD &&
|
|
83
|
-
el.type === TouchableOpacity
|
|
84
|
-
);
|
|
85
|
-
await act(async () => {
|
|
86
|
-
button.props.onPress();
|
|
87
|
-
});
|
|
88
|
-
expect(mockOnAdd).toHaveBeenCalledTimes(1);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('onMore', async () => {
|
|
92
|
-
await act(async () => {
|
|
93
|
-
tree = await create(<HeaderUnit {...data} />);
|
|
94
|
-
});
|
|
95
|
-
const instance = tree.root;
|
|
96
|
-
const button = instance.find(
|
|
97
|
-
(el) =>
|
|
98
|
-
el.props.accessibilityLabel ===
|
|
99
|
-
AccessibilityLabel.HEADER_UNIT_BUTTON_MORE &&
|
|
100
|
-
el.type === TouchableOpacity
|
|
101
|
-
);
|
|
102
|
-
await act(async () => {
|
|
103
|
-
button.props.onPress();
|
|
104
|
-
});
|
|
105
|
-
expect(mockOnMore).toHaveBeenCalledTimes(1);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('transparent', async () => {
|
|
109
|
-
data.transparent = true;
|
|
110
|
-
await act(async () => {
|
|
111
|
-
tree = await create(<HeaderUnit {...data} />);
|
|
112
|
-
});
|
|
113
|
-
const instance = tree.root;
|
|
114
|
-
const iconPlus = instance.findByProps({ name: 'plus' });
|
|
115
|
-
expect(iconPlus.props.color).toEqual(Colors.White);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { act, create } from 'react-test-renderer';
|
|
4
|
-
import MyAllUnit from '../index';
|
|
5
|
-
import { SCProvider } from '../../../../../context';
|
|
6
|
-
import { mockSCStore } from '../../../../../context/mockStore';
|
|
7
|
-
|
|
8
|
-
const wrapComponent = (route) => (
|
|
9
|
-
<SCProvider initState={mockSCStore({})}>
|
|
10
|
-
<MyAllUnit route={route} />
|
|
11
|
-
</SCProvider>
|
|
12
|
-
);
|
|
13
|
-
describe('Test MyAllUnit', () => {
|
|
14
|
-
let tree;
|
|
15
|
-
it('render MyAllUnit', async () => {
|
|
16
|
-
const route = {
|
|
17
|
-
params: {
|
|
18
|
-
myUnits: [
|
|
19
|
-
{
|
|
20
|
-
background: '',
|
|
21
|
-
name: '',
|
|
22
|
-
stations: [
|
|
23
|
-
{ id: 1, name: 'station', sensors: [{ id: 1, name: 'sensor' }] },
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
await act(async () => {
|
|
30
|
-
tree = await create(wrapComponent(route));
|
|
31
|
-
});
|
|
32
|
-
const instance = tree.root;
|
|
33
|
-
const views = instance.findAllByType(View);
|
|
34
|
-
expect(views).toHaveLength(37);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { act, create } from 'react-test-renderer';
|
|
3
|
-
import MyAllUnit from '../index';
|
|
4
|
-
import Header from '../../Header';
|
|
5
|
-
import { SCProvider } from '../../../../../context';
|
|
6
|
-
import { mockSCStore } from '../../../../../context/mockStore';
|
|
7
|
-
|
|
8
|
-
const wrapComponent = (props) => (
|
|
9
|
-
<SCProvider initState={mockSCStore({})}>
|
|
10
|
-
<MyAllUnit {...props} />
|
|
11
|
-
</SCProvider>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
it('test MyAllUnit', async () => {
|
|
15
|
-
let tree, props;
|
|
16
|
-
let mockGoBack = jest.fn();
|
|
17
|
-
|
|
18
|
-
props = {
|
|
19
|
-
route: {
|
|
20
|
-
params: {
|
|
21
|
-
myUnits: [
|
|
22
|
-
{
|
|
23
|
-
background: '',
|
|
24
|
-
name: 'name',
|
|
25
|
-
stations: [
|
|
26
|
-
{
|
|
27
|
-
name: 'station',
|
|
28
|
-
sensors: [
|
|
29
|
-
{
|
|
30
|
-
name: 'sensor',
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
navigation: {
|
|
40
|
-
goBack: mockGoBack,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
await act(async () => {
|
|
45
|
-
tree = await create(wrapComponent(props));
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const instance = tree.root;
|
|
49
|
-
const header = instance.findByType(Header);
|
|
50
|
-
await act(async () => {
|
|
51
|
-
header.props.goBack();
|
|
52
|
-
});
|
|
53
|
-
expect(mockGoBack).toBeCalled();
|
|
54
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import { StyleSheet, View, Animated, ScrollView } from 'react-native';
|
|
3
|
-
import { getStatusBarHeight } from 'react-native-iphone-x-helper';
|
|
4
|
-
|
|
5
|
-
import Header from '../Header';
|
|
6
|
-
import ListMyAllUnit from '../ListMyAllUnit';
|
|
7
|
-
import { Colors } from '../../../../configs';
|
|
8
|
-
|
|
9
|
-
const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView);
|
|
10
|
-
|
|
11
|
-
const MyAllUnit = ({ route, navigation }) => {
|
|
12
|
-
const animatedScrollYValue = useRef(new Animated.Value(0)).current;
|
|
13
|
-
const unitItems = route?.params?.myUnits;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<View style={[styles.wrap, styles.backgroundWhite]}>
|
|
17
|
-
<Header dark goBack={() => navigation.goBack()} />
|
|
18
|
-
<AnimatedScrollView
|
|
19
|
-
scrollEventThrottle={1}
|
|
20
|
-
onScroll={Animated.event(
|
|
21
|
-
[{ nativeEvent: { contentOffset: { y: animatedScrollYValue } } }],
|
|
22
|
-
{
|
|
23
|
-
useNativeDriver: true,
|
|
24
|
-
}
|
|
25
|
-
)}
|
|
26
|
-
contentContainerStyle={styles.wrap}
|
|
27
|
-
>
|
|
28
|
-
<ListMyAllUnit unitItems={unitItems} />
|
|
29
|
-
</AnimatedScrollView>
|
|
30
|
-
</View>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const styles = StyleSheet.create({
|
|
35
|
-
wrap: {
|
|
36
|
-
flex: 1,
|
|
37
|
-
paddingTop: getStatusBarHeight() + 10,
|
|
38
|
-
},
|
|
39
|
-
backgroundWhite: {
|
|
40
|
-
backgroundColor: Colors.White,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
export default MyAllUnit;
|