@eohjsc/react-native-smart-city 0.2.19 → 0.2.23
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/Add.svg +5 -0
- package/assets/images/AddLocationMaps/Point.svg +3 -0
- package/assets/images/CheckCircle.svg +4 -0
- package/assets/images/Close.svg +3 -0
- package/assets/images/Event.svg +9 -0
- package/assets/images/HowToStart.svg +14 -0
- package/assets/images/OneTap.svg +14 -0
- package/assets/images/Rearrange.svg +3 -0
- package/assets/images/Schedule.svg +39 -0
- package/assets/images/WeatherChange.svg +49 -0
- package/index.js +2 -0
- package/package.json +7 -4
- package/src/Images/Common/ActiveButton.png +0 -0
- package/src/Images/Common/ActiveButton@2x.png +0 -0
- package/src/Images/Common/ActiveButton@3x.png +0 -0
- package/src/Images/Common/file@2x.png +0 -0
- package/src/Images/Common/file@3x.png +0 -0
- package/src/Images/Common/fullscreen@2x.png +0 -0
- package/src/Images/Common/fullscreen@3x.png +0 -0
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +6 -3
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +10 -1
- package/src/commons/ActionGroup/ThreeButtonTemplate.js +13 -6
- package/src/commons/ActionGroup/ThreeButtonTemplateStyle.js +1 -1
- package/src/commons/ActionGroup/TimerActionTemplate.js +158 -33
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +2 -1
- package/src/commons/ActionGroup/hooks/useDropdownAction.js +2 -1
- package/src/commons/Automate/ItemAddNewScriptAction.js +30 -0
- package/src/commons/Automate/ItemAddNewScriptActionStyles.js +38 -0
- package/src/commons/Automate/ItemAutomate.js +63 -0
- package/src/commons/Automate/ItemAutomateStyles.js +30 -0
- package/src/commons/Automate/ItemScriptAction.js +41 -0
- package/src/commons/Automate/ItemScriptActionStyles.js +38 -0
- package/src/commons/BottomScrollPicker/index.js +58 -0
- package/src/commons/BottomScrollPicker/styles.js +13 -0
- package/src/commons/BottomSheet/index.js +36 -0
- package/src/commons/BottomSheet/styles.js +37 -0
- package/src/commons/Button/index.js +6 -1
- package/src/commons/CameraDevice/index.js +22 -10
- package/src/commons/ChartLoading/index.js +2 -1
- package/src/commons/DateTimeRangeChange/index.js +2 -1
- package/src/commons/Device/ConnectedViewHeader.js +3 -1
- package/src/commons/Device/DeviceAlertStatus.js +2 -1
- package/src/commons/Device/DisconnectedView.js +34 -26
- package/src/commons/Device/Emergency/EmergencyButton.js +2 -1
- package/src/commons/Device/Emergency/EmergencyDetail.js +2 -1
- package/src/commons/Device/FlatListItems.js +2 -1
- package/src/commons/Device/FooterInfo.js +2 -1
- package/src/commons/Device/HistoryChart.js +2 -1
- package/src/commons/Device/HorizontalBarChart.js +3 -3
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +7 -2
- package/src/commons/Device/PMSensor/PMSensorIndicatorStyles.js +3 -1
- package/src/commons/Device/RainningSensor/CurrentRainSensor.js +3 -1
- package/src/commons/Device/SensorConnectedStatus.js +2 -1
- package/src/commons/Device/WindDirection/Compass/index.js +1 -1
- package/src/commons/Device/WindSpeed/LinearChart/index.js +2 -1
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +2 -1
- package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -1
- package/src/commons/EmergencyButton/AlertSent.js +3 -2
- package/src/commons/Explore/CityItem/index.js +2 -1
- package/src/commons/Explore/HeaderExplore/index.js +2 -1
- package/src/commons/Explore/HeaderLabel/index.js +2 -1
- package/src/commons/Explore/SearchBox/index.js +2 -1
- package/src/commons/Header/HeaderCustom.js +36 -10
- package/src/commons/Header/Styles/HeaderCustomStyles.js +8 -3
- package/src/commons/HeaderAni/index.js +6 -3
- package/src/commons/IconComponent/index.js +18 -3
- package/src/commons/ImagePicker/index.js +3 -1
- package/src/commons/MediaPlayer/index.js +118 -62
- package/src/commons/MediaPlayer/styles.js +56 -0
- package/src/commons/MediaPlayerDetail/MediaPlayerDetailStyles.js +15 -0
- package/src/commons/MediaPlayerDetail/index.js +149 -64
- package/src/commons/MenuActionAddnew/index.js +2 -1
- package/src/commons/Modal/ModalCustom.js +22 -0
- package/src/commons/Modal/ModalFullVideo.js +48 -0
- package/src/commons/Modal/Styles/ModalFullVideoStyles.js +26 -0
- package/src/commons/Modal/index.js +4 -0
- package/src/commons/NavBar/index.js +2 -2
- package/src/commons/Sharing/DevicePermissionsCheckbox.js +2 -1
- package/src/commons/Sharing/MemberList.js +3 -1
- package/src/commons/Sharing/RowMember.js +3 -2
- package/src/commons/Sharing/StationDevicePermissions.js +2 -1
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +86 -0
- package/src/commons/SubUnit/OneTap/ItemOneTapStyles.js +41 -0
- package/src/commons/SubUnit/OneTap/OneTapStyles.js +36 -0
- package/src/commons/SubUnit/OneTap/index.js +29 -0
- package/src/commons/SubUnit/ShortDetail.js +3 -1
- package/src/commons/Today/index.js +2 -1
- package/src/commons/Unit/SharedUnit.js +2 -1
- package/src/commons/UnitSummary/AirQuality/SegmentedRoundDisplay/index.js +1 -2
- package/src/commons/UnitSummary/AirQuality/index.js +5 -120
- package/src/commons/UnitSummary/AirQuality/styles.js +112 -0
- package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -1
- package/src/commons/WheelDateTimePicker/Picker.js +57 -0
- package/src/commons/WheelDateTimePicker/index.js +160 -0
- package/src/commons/WheelDateTimePicker/styles.js +21 -0
- package/src/configs/API.js +25 -3
- package/src/configs/Colors.js +1 -0
- package/src/configs/Constants.js +4 -0
- package/src/configs/Images.js +4 -0
- package/src/configs/SCConfig.js +94 -0
- package/src/context/SCContext.tsx +5 -11
- package/src/context/reducer.ts +2 -0
- package/src/hooks/Common/useStatusBar.js +3 -0
- package/src/hooks/Common/useTranslations.ts +34 -0
- package/src/iot/Monitor.js +2 -1
- package/src/iot/RemoteControl/Bluetooth.js +2 -6
- package/src/iot/RemoteControl/GoogleHome.js +1 -1
- package/src/iot/RemoteControl/Internet.js +1 -1
- package/src/iot/RemoteControl/LG.js +57 -15
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +2 -1
- package/src/iot/RemoteControl/__test__/GoogleHome.test.js +2 -1
- package/src/iot/RemoteControl/__test__/Internet.test.js +2 -1
- package/src/iot/RemoteControl/__test__/index.test.js +2 -1
- package/src/iot/RemoteControl/index.js +1 -1
- package/src/iot/states.js +1 -0
- package/src/navigations/AddGatewayStack.js +5 -0
- package/src/navigations/AddNewActionStack.js +23 -0
- package/src/navigations/SharedStack.js +2 -1
- package/src/navigations/UnitStack.js +72 -1
- package/src/screens/AQIGuide/index.js +2 -2
- package/src/screens/ActivityLog/hooks/index.js +1 -1
- package/src/screens/ActivityLog/index.js +2 -1
- package/src/screens/AddCommon/SelectSubUnit.js +143 -0
- package/src/screens/AddCommon/SelectSubUnitStyles.js +55 -0
- package/src/screens/AddCommon/SelectUnit.js +3 -2
- package/src/screens/AddLocationMaps/index.js +2 -1
- package/src/screens/AddNewAction/Device/DeviceStyles.js +43 -0
- package/src/screens/AddNewAction/Device/index.js +33 -0
- package/src/screens/AddNewAction/SelectDevice.js +106 -0
- package/src/screens/AddNewAction/Styles/SelectDeviceStyles.js +36 -0
- package/src/screens/AddNewDevice/ConnectDevices.js +2 -1
- package/src/screens/AddNewDevice/ConnectingDevices.js +2 -1
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +2 -1
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +2 -1
- package/src/screens/AddNewDevice/__test__/ConnectingDevices.test.js +2 -1
- package/src/screens/AddNewDevice/hooks/useStateAlertRename.js +2 -1
- package/src/screens/AddNewDevice/index.js +23 -4
- package/src/screens/AddNewGateway/AddNewGatewayStyles.js +29 -0
- package/src/screens/AddNewGateway/ConnectedGateway.js +2 -1
- package/src/screens/AddNewGateway/ConnectingGateway.js +100 -25
- package/src/screens/AddNewGateway/ConnectingGatewayStyles.js +92 -0
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +25 -3
- package/src/screens/AddNewGateway/SetupGatewayWifiStyles.js +6 -1
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +2 -1
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +2 -1
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +2 -1
- package/src/screens/AddNewGateway/hooks/useStateAlertRename.js +2 -1
- package/src/screens/AddNewGateway/index.js +28 -110
- package/src/screens/AddNewOneTap/AddNewOneTapStyles.js +43 -0
- package/src/screens/AddNewOneTap/index.js +67 -0
- package/src/screens/AddNewScriptAction/AddNewScriptActionStyles.js +27 -0
- package/src/screens/AddNewScriptAction/index.js +92 -0
- package/src/screens/AllCamera/Styles/index.js +101 -0
- package/src/screens/AllCamera/index.js +208 -0
- package/src/screens/Device/HeaderDevice/styles.js +2 -2
- package/src/screens/Device/__test__/detail.test.js +2 -1
- package/src/screens/Device/detail.js +66 -23
- package/src/screens/Device/hooks/useEmergencyButton.js +7 -6
- package/src/screens/Device/styles.js +3 -0
- package/src/screens/DeviceInfo/index.js +3 -2
- package/src/screens/EditActionsList/Styles/indexStyles.js +73 -0
- package/src/screens/EditActionsList/index.js +122 -0
- package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +3 -2
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +9 -2
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +2 -1
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +2 -1
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +2 -1
- package/src/screens/EmergencyContacts/hook.js +3 -2
- package/src/screens/Explore/index.js +3 -2
- package/src/screens/GuestInfo/components/AccessScheduleItem.js +27 -0
- package/src/screens/GuestInfo/components/AccessScheduleSheet.js +193 -0
- package/src/screens/GuestInfo/components/HeaderGuestInfo.js +31 -0
- package/src/screens/GuestInfo/components/RecurringDetail.js +99 -0
- package/src/screens/GuestInfo/components/RowGuestInfo.js +31 -0
- package/src/screens/GuestInfo/components/TemporaryDetail.js +46 -0
- package/src/screens/GuestInfo/constant.js +59 -0
- package/src/screens/GuestInfo/index.js +151 -0
- package/src/screens/GuestInfo/styles/AccessScheduleDetailStyles.js +31 -0
- package/src/screens/GuestInfo/styles/AccessScheduleItemStyles.js +22 -0
- package/src/screens/GuestInfo/styles/HeaderGuestInfoStyles.js +31 -0
- package/src/screens/GuestInfo/styles/indexStyles.js +38 -0
- package/src/screens/ManageAccess/__test__/ManageAccess.test.js +82 -0
- package/src/screens/ManageAccess/hooks/index.js +32 -0
- package/src/screens/ManageAccess/index.js +126 -0
- package/src/screens/ManageAccess/styles/ManageAccessStyles.js +72 -0
- package/src/screens/PlayBackCamera/Styles/TimerStyles.js +22 -0
- package/src/screens/PlayBackCamera/Styles/index.js +81 -0
- package/src/screens/PlayBackCamera/Timer.js +127 -0
- package/src/screens/PlayBackCamera/index.js +233 -0
- package/src/screens/ScanChipQR/components/QRScan/index.js +2 -1
- package/src/screens/ScanChipQR/hooks/index.js +4 -11
- package/src/screens/ScriptDetail/Styles/indexStyles.js +140 -0
- package/src/screens/ScriptDetail/index.js +241 -0
- package/src/screens/SharedUnit/TabHeader.js +2 -1
- package/src/screens/SharedUnit/index.js +3 -2
- package/src/screens/Sharing/MemberList.js +2 -1
- package/src/screens/Sharing/SelectPermission.js +2 -1
- package/src/screens/Sharing/SelectUser.js +3 -2
- package/src/screens/Sharing/__test__/MemberList.test.js +2 -1
- package/src/screens/Sharing/__test__/SelectUser.test.js +2 -1
- package/src/screens/Sharing/hooks/index.js +22 -17
- package/src/screens/SubUnit/AddSubUnit.js +14 -72
- package/src/screens/SubUnit/AddSubUnitStyles.js +66 -0
- package/src/screens/SubUnit/Detail.js +5 -63
- package/src/screens/SubUnit/DetailStyles.js +46 -0
- package/src/screens/SubUnit/ManageSubUnit.js +5 -4
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +2 -1
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +2 -1
- package/src/screens/SyncLGDevice/AddLGDevice.js +3 -2
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +2 -1
- package/src/screens/TDSGuide/index.js +2 -1
- package/src/screens/UVIndexGuide/index.js +2 -1
- package/src/screens/Unit/AddMenu.js +3 -2
- package/src/screens/Unit/Detail.js +75 -20
- package/src/screens/Unit/ManageUnit/index.js +4 -3
- package/src/screens/Unit/ManageUnit.js +4 -3
- package/src/screens/Unit/MoreMenu.js +3 -2
- package/src/screens/Unit/SelectLocation.js +10 -2
- package/src/screens/Unit/SelectLocationStyles.js +11 -0
- package/src/screens/Unit/components/Header/index.js +2 -1
- package/src/screens/Unit/components/ListMyAllUnit/index.js +2 -1
- package/src/screens/Unit/components/MyUnit/index.js +2 -1
- package/src/screens/Unit/components/SearchLocation/index.js +2 -1
- package/src/screens/Unit/components/SharedUnit/index.js +2 -1
- package/src/screens/Unit/styles.js +4 -0
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -1
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -1
- package/src/screens/UnitSummary/components/Temperature/index.js +2 -1
- package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -1
- package/src/screens/UnitSummary/components/UvIndex/index.js +2 -1
- package/src/screens/UnitSummary/components/WaterQuality/index.js +2 -1
- package/src/screens/UnitSummary/index.js +2 -1
- package/src/screens/WaterQualityGuide/index.js +2 -1
- package/src/utils/Converter/__test__/time.test.js +3 -1
- package/src/utils/Converter/array.js +4 -0
- package/src/utils/Converter/time.js +29 -4
- package/src/utils/I18n/index.ts +6 -0
- package/src/utils/I18n/translations/en.json +51 -2
- package/src/utils/I18n/translations/vi.json +48 -1
- package/src/utils/I18n/translations.ts +45 -0
- package/src/utils/Route/index.js +11 -0
- package/src/utils/I18n/index.js +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
4
4
|
import { Colors } from '../../configs';
|
|
5
5
|
import Text from '../../commons/Text';
|
|
6
6
|
|
|
@@ -12,6 +12,8 @@ const MemberList = ({
|
|
|
12
12
|
currentUserId, //user is using app
|
|
13
13
|
onPressRemove,
|
|
14
14
|
}) => {
|
|
15
|
+
const t = useTranslations();
|
|
16
|
+
|
|
15
17
|
return (
|
|
16
18
|
<View style={styles.box}>
|
|
17
19
|
{!!dataMember.length &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../configs';
|
|
7
7
|
import Text from '../../commons/Text';
|
|
@@ -19,6 +19,7 @@ const arrColor = [
|
|
|
19
19
|
];
|
|
20
20
|
const RowMember = memo(
|
|
21
21
|
({ member, index, ownerId, currentUserId, onPressRemove }) => {
|
|
22
|
+
const t = useTranslations();
|
|
22
23
|
const canRemoveMember = useMemo(
|
|
23
24
|
() => ownerId === currentUserId && member.id !== ownerId,
|
|
24
25
|
[currentUserId, member.id, ownerId]
|
|
@@ -30,7 +31,7 @@ const RowMember = memo(
|
|
|
30
31
|
: member.id === currentUserId
|
|
31
32
|
? [t('me'), Colors.Gray6]
|
|
32
33
|
: ['', ''],
|
|
33
|
-
[currentUserId, member.id, ownerId]
|
|
34
|
+
[currentUserId, member.id, ownerId, t]
|
|
34
35
|
);
|
|
35
36
|
const paddingBottom = role ? 16 : 23;
|
|
36
37
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useState, useCallback } from 'react';
|
|
2
2
|
import { View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
6
|
import Text from '../../commons/Text';
|
|
7
7
|
import SensorIcon from '../../../assets/images/Device/sensor.svg';
|
|
@@ -14,6 +14,7 @@ import DoorInactive from '../../../assets/images/Device/door-inactive.svg';
|
|
|
14
14
|
import DevicePermissionsCheckbox from './DevicePermissionsCheckbox';
|
|
15
15
|
|
|
16
16
|
const StationDevicePermissions = memo(({ dataStation, onselectSensor }) => {
|
|
17
|
+
const t = useTranslations();
|
|
17
18
|
const [listChosen, setListChosen] = useState({}); // { sensorId : indexConfigChoosen , ...}
|
|
18
19
|
const [expandedIndex, setExpandedIndex] = useState(-1);
|
|
19
20
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { memo, useCallback } from 'react';
|
|
2
|
+
import { TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native';
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import Text from '../../Text';
|
|
6
|
+
import { API, Colors } from '../../../configs';
|
|
7
|
+
import OneTap from '../../../../assets/images/OneTap.svg';
|
|
8
|
+
import CheckCircle from '../../../../assets/images/CheckCircle.svg';
|
|
9
|
+
import FImage from '../../FImage';
|
|
10
|
+
import { timeDifference } from '../../../utils/Converter/time';
|
|
11
|
+
import styles from './ItemOneTapStyles.js';
|
|
12
|
+
import { ToastBottomHelper } from '../../../utils/Utils';
|
|
13
|
+
import { axiosPost } from '../../../utils/Apis/axios';
|
|
14
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
15
|
+
import { useNavigation } from '@react-navigation/core';
|
|
16
|
+
import Routes from '../../../utils/Route';
|
|
17
|
+
|
|
18
|
+
const ItemOneTap = memo(({ automate }) => {
|
|
19
|
+
const { navigate } = useNavigation();
|
|
20
|
+
const { id, script, activate_at } = automate;
|
|
21
|
+
|
|
22
|
+
const t = useTranslations();
|
|
23
|
+
const goToDetail = useCallback(() => {
|
|
24
|
+
navigate(Routes.ScriptDetail, { id, name: script?.name });
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
28
|
+
const handleScriptAction = useCallback(async () => {
|
|
29
|
+
const { success } = await axiosPost(API.AUTOMATE.ACTION_ONE_TAP(id));
|
|
30
|
+
if (success) {
|
|
31
|
+
ToastBottomHelper.success(t('Activated successfully.'));
|
|
32
|
+
} else {
|
|
33
|
+
ToastBottomHelper.error(t('Activation failed.'));
|
|
34
|
+
}
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
}, [id]);
|
|
37
|
+
|
|
38
|
+
const displayIcon = () => {
|
|
39
|
+
const iconKit = script?.icon_kit;
|
|
40
|
+
return iconKit ? (
|
|
41
|
+
<FImage source={{ uri: iconKit }} style={styles.iconSensor} />
|
|
42
|
+
) : (
|
|
43
|
+
<OneTap />
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
const activateAt = activate_at
|
|
47
|
+
? timeDifference(new Date(), moment(activate_at), true)
|
|
48
|
+
: null;
|
|
49
|
+
return (
|
|
50
|
+
<TouchableWithoutFeedback onPress={goToDetail}>
|
|
51
|
+
<View style={styles.container}>
|
|
52
|
+
<View style={styles.boxIcon}>
|
|
53
|
+
{displayIcon()}
|
|
54
|
+
<TouchableOpacity onPress={handleScriptAction}>
|
|
55
|
+
<CheckCircle />
|
|
56
|
+
</TouchableOpacity>
|
|
57
|
+
</View>
|
|
58
|
+
<TouchableOpacity onPress={goToDetail}>
|
|
59
|
+
<Text
|
|
60
|
+
numberOfLines={1}
|
|
61
|
+
semibold
|
|
62
|
+
size={14}
|
|
63
|
+
color={Colors.Gray9}
|
|
64
|
+
type="Body"
|
|
65
|
+
>
|
|
66
|
+
{script?.name}
|
|
67
|
+
</Text>
|
|
68
|
+
<View style={styles.descriptionContainer}>
|
|
69
|
+
<Text
|
|
70
|
+
numberOfLines={1}
|
|
71
|
+
semibold
|
|
72
|
+
size={12}
|
|
73
|
+
color={Colors.Gray8}
|
|
74
|
+
type="Label"
|
|
75
|
+
>
|
|
76
|
+
{activateAt && t('activated_time', { time: activateAt })}
|
|
77
|
+
</Text>
|
|
78
|
+
<IconOutline name="right" size={12} />
|
|
79
|
+
</View>
|
|
80
|
+
</TouchableOpacity>
|
|
81
|
+
</View>
|
|
82
|
+
</TouchableWithoutFeedback>
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export default ItemOneTap;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors, Constants } from '../../../configs';
|
|
3
|
+
|
|
4
|
+
const marginItem = 12;
|
|
5
|
+
const marginHorizontal = 16;
|
|
6
|
+
const widthItem = (Constants.width - marginHorizontal * 2 - marginItem) / 2;
|
|
7
|
+
const heightItem = (widthItem / 166) * 106;
|
|
8
|
+
|
|
9
|
+
export default StyleSheet.create({
|
|
10
|
+
container: {
|
|
11
|
+
padding: 12,
|
|
12
|
+
borderRadius: 10,
|
|
13
|
+
shadowColor: Colors.Shadow,
|
|
14
|
+
shadowOffset: {
|
|
15
|
+
width: 0,
|
|
16
|
+
height: 2,
|
|
17
|
+
},
|
|
18
|
+
shadowOpacity: 0.1,
|
|
19
|
+
shadowRadius: 3,
|
|
20
|
+
elevation: 4,
|
|
21
|
+
width: widthItem,
|
|
22
|
+
height: heightItem,
|
|
23
|
+
backgroundColor: Colors.White,
|
|
24
|
+
justifyContent: 'space-between',
|
|
25
|
+
marginBottom: 8,
|
|
26
|
+
},
|
|
27
|
+
boxIcon: {
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
},
|
|
31
|
+
descriptionContainer: {
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
justifyContent: 'space-between',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
},
|
|
36
|
+
iconSensor: {
|
|
37
|
+
width: 40,
|
|
38
|
+
height: 40,
|
|
39
|
+
resizeMode: 'contain',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors, Device } from '../../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
boxImage: {
|
|
6
|
+
flexDirection: 'row',
|
|
7
|
+
marginTop: 8,
|
|
8
|
+
marginBottom: 8,
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
width: Device.screenWidth - 32,
|
|
11
|
+
alignSelf: 'center',
|
|
12
|
+
},
|
|
13
|
+
image: {
|
|
14
|
+
width: '100%',
|
|
15
|
+
height: 160,
|
|
16
|
+
},
|
|
17
|
+
boxDevices: {
|
|
18
|
+
flexWrap: 'wrap',
|
|
19
|
+
flexDirection: 'row',
|
|
20
|
+
marginTop: 16,
|
|
21
|
+
justifyContent: 'space-between',
|
|
22
|
+
},
|
|
23
|
+
noShadow: {
|
|
24
|
+
shadowOpacity: 0,
|
|
25
|
+
elevation: 0,
|
|
26
|
+
},
|
|
27
|
+
viewAll: {
|
|
28
|
+
color: Colors.Orange,
|
|
29
|
+
},
|
|
30
|
+
UnitsHeading: {
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
justifyContent: 'space-between',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
paddingBottom: 3,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import styles from './OneTapStyles.js';
|
|
4
|
+
import { Section } from '../..';
|
|
5
|
+
|
|
6
|
+
import ItemAddNew from '../../Device/ItemAddNew';
|
|
7
|
+
import ItemOneTap from './ItemOneTap';
|
|
8
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
9
|
+
import { useNavigation } from '@react-navigation/native';
|
|
10
|
+
import Routes from '../../../utils/Route/index.js';
|
|
11
|
+
|
|
12
|
+
const SubUnitOneTap = ({ automates }) => {
|
|
13
|
+
const t = useTranslations();
|
|
14
|
+
const navigation = useNavigation();
|
|
15
|
+
const handleOnAddNew = () => {
|
|
16
|
+
navigation.navigate(Routes.AddNewOneTap);
|
|
17
|
+
};
|
|
18
|
+
return (
|
|
19
|
+
<Section style={styles.noShadow}>
|
|
20
|
+
<View style={styles.boxDevices}>
|
|
21
|
+
<ItemAddNew title={t('add_new')} onAddNew={handleOnAddNew} />
|
|
22
|
+
{!!automates.length &&
|
|
23
|
+
automates.map((item) => <ItemOneTap automate={item} />)}
|
|
24
|
+
</View>
|
|
25
|
+
</Section>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default SubUnitOneTap;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Images, Device } from '../../configs';
|
|
7
7
|
import { TESTID } from '../../configs/Constants';
|
|
@@ -19,6 +19,7 @@ const { standardizeWidth, standardizeHeight } = standardizeCameraScreenSize(
|
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
const ShortDetailSubUnit = ({ unit, station, isGGHomeConnected }) => {
|
|
22
|
+
const t = useTranslations();
|
|
22
23
|
const { navigate } = useNavigation();
|
|
23
24
|
const renderCamera = () => {
|
|
24
25
|
if (station?.camera) {
|
|
@@ -32,6 +33,7 @@ const ShortDetailSubUnit = ({ unit, station, isGGHomeConnected }) => {
|
|
|
32
33
|
>
|
|
33
34
|
<MediaPlayer
|
|
34
35
|
uri={station.camera.uri}
|
|
36
|
+
previewUri={station.camera.preview_uri}
|
|
35
37
|
thumbnail={{
|
|
36
38
|
uri: station.background,
|
|
37
39
|
}}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import moment from 'moment';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
import i18n from 'i18n-js';
|
|
6
6
|
|
|
7
7
|
import { Colors } from '../../configs';
|
|
8
8
|
import Text from '../../commons/Text';
|
|
9
9
|
|
|
10
10
|
const TodayComponent = ({ style }) => {
|
|
11
|
+
const t = useTranslations();
|
|
11
12
|
const getCurrentDate = () => {
|
|
12
13
|
const currentLanguage = i18n.currentLocale();
|
|
13
14
|
moment.locale(currentLanguage);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, useCallback } from 'react';
|
|
2
2
|
import { View, Image, TouchableOpacity } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
4
4
|
import { IconOutline, IconFill } from '@ant-design/icons-react-native';
|
|
5
5
|
|
|
6
6
|
import { API, Colors, Images } from '../../configs';
|
|
@@ -18,6 +18,7 @@ const SharedUnit = ({
|
|
|
18
18
|
index,
|
|
19
19
|
isOptions = true,
|
|
20
20
|
}) => {
|
|
21
|
+
const t = useTranslations();
|
|
21
22
|
const { unit } = item;
|
|
22
23
|
const goToDetail = useCallback(() => {
|
|
23
24
|
navigation.navigate(Routes.UnitStack, {
|
|
@@ -2,7 +2,6 @@ import React, { useState, useEffect, useCallback } from 'react';
|
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import Svg, { G, Text, Path } from 'react-native-svg';
|
|
5
|
-
import { t } from 'i18n-js';
|
|
6
5
|
|
|
7
6
|
import { Colors } from '../../../../configs';
|
|
8
7
|
import TextCustom from '../../../../commons/Text';
|
|
@@ -255,7 +254,7 @@ SegmentedRoundDisplay.defaultProps = {
|
|
|
255
254
|
radius: 90,
|
|
256
255
|
pos: [0, 100, 200, 300, 400, 500],
|
|
257
256
|
boxTitle: false,
|
|
258
|
-
textHeader:
|
|
257
|
+
textHeader: '',
|
|
259
258
|
initIndex: 0,
|
|
260
259
|
};
|
|
261
260
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../../configs';
|
|
7
7
|
import { Section } from '../../../commons/index';
|
|
@@ -10,8 +10,10 @@ import ConfigHistoryChart from '../ConfigHistoryChart';
|
|
|
10
10
|
|
|
11
11
|
import SegmentedRoundDisplay from './SegmentedRoundDisplay';
|
|
12
12
|
import { TESTID } from '../../../configs/Constants';
|
|
13
|
+
import styles from './styles';
|
|
13
14
|
|
|
14
15
|
const AirQuality = memo(({ summaryDetail }) => {
|
|
16
|
+
const t = useTranslations();
|
|
15
17
|
const {
|
|
16
18
|
outdoor_pm10_id,
|
|
17
19
|
outdoor_pm2_5_id,
|
|
@@ -121,15 +123,8 @@ const AirQuality = memo(({ summaryDetail }) => {
|
|
|
121
123
|
totalValue={500}
|
|
122
124
|
title={outdoorValues[indexOutdoor].title}
|
|
123
125
|
style={styles.segment}
|
|
126
|
+
textHeader={t('text_air_quality_index')}
|
|
124
127
|
/>
|
|
125
|
-
|
|
126
|
-
<TouchableOpacity
|
|
127
|
-
style={[styles.touchStatus, { backgroundColor: outdoorColor }]}
|
|
128
|
-
>
|
|
129
|
-
<Text size={14} color={Colors.White}>
|
|
130
|
-
{outdoorStatus}
|
|
131
|
-
</Text>
|
|
132
|
-
</TouchableOpacity>
|
|
133
128
|
{!!advices && !!advices.length && (
|
|
134
129
|
<View style={styles.boxHealth}>
|
|
135
130
|
<IconOutline name="alert" size={20} style={styles.iconMargin} />
|
|
@@ -173,113 +168,3 @@ const AirQuality = memo(({ summaryDetail }) => {
|
|
|
173
168
|
});
|
|
174
169
|
|
|
175
170
|
export default AirQuality;
|
|
176
|
-
|
|
177
|
-
const styles = StyleSheet.create({
|
|
178
|
-
textIndoor: {
|
|
179
|
-
color: Colors.Gray9,
|
|
180
|
-
fontSize: 20,
|
|
181
|
-
marginBottom: 4,
|
|
182
|
-
},
|
|
183
|
-
textDesIndoor: {
|
|
184
|
-
color: Colors.Gray8,
|
|
185
|
-
fontSize: 12,
|
|
186
|
-
marginBottom: 16,
|
|
187
|
-
},
|
|
188
|
-
textNotAvailable: {
|
|
189
|
-
textAlign: 'center',
|
|
190
|
-
},
|
|
191
|
-
boxStatus: {
|
|
192
|
-
borderRadius: 10,
|
|
193
|
-
height: 80,
|
|
194
|
-
overflow: 'hidden',
|
|
195
|
-
flexDirection: 'row',
|
|
196
|
-
marginBottom: 16,
|
|
197
|
-
},
|
|
198
|
-
boxEmotion: {
|
|
199
|
-
height: 80,
|
|
200
|
-
width: 80,
|
|
201
|
-
backgroundColor: Colors.Yellow6,
|
|
202
|
-
justifyContent: 'center',
|
|
203
|
-
alignItems: 'center',
|
|
204
|
-
},
|
|
205
|
-
textStatus: {
|
|
206
|
-
fontSize: 16,
|
|
207
|
-
color: Colors.Gray9,
|
|
208
|
-
marginRight: 24,
|
|
209
|
-
textAlign: 'right',
|
|
210
|
-
maxWidth: 120,
|
|
211
|
-
},
|
|
212
|
-
boxTextStatus: {
|
|
213
|
-
backgroundColor: Colors.Yellow4,
|
|
214
|
-
flex: 1,
|
|
215
|
-
alignItems: 'flex-end',
|
|
216
|
-
justifyContent: 'center',
|
|
217
|
-
},
|
|
218
|
-
boxNumber: {
|
|
219
|
-
flexDirection: 'row',
|
|
220
|
-
justifyContent: 'space-between',
|
|
221
|
-
marginBottom: 16,
|
|
222
|
-
},
|
|
223
|
-
boxHealth: {
|
|
224
|
-
flexDirection: 'row',
|
|
225
|
-
marginBottom: 12,
|
|
226
|
-
alignItems: 'center',
|
|
227
|
-
marginTop: 10,
|
|
228
|
-
},
|
|
229
|
-
boxContentHealth: {
|
|
230
|
-
flexDirection: 'row',
|
|
231
|
-
alignItems: 'center',
|
|
232
|
-
marginBottom: 8,
|
|
233
|
-
},
|
|
234
|
-
boxDot: {
|
|
235
|
-
width: 8,
|
|
236
|
-
height: 8,
|
|
237
|
-
borderRadius: 4,
|
|
238
|
-
backgroundColor: Colors.Yellow6,
|
|
239
|
-
marginRight: 8,
|
|
240
|
-
},
|
|
241
|
-
textOutdoor: {
|
|
242
|
-
color: Colors.Gray9,
|
|
243
|
-
fontSize: 20,
|
|
244
|
-
marginBottom: 24,
|
|
245
|
-
marginTop: 16,
|
|
246
|
-
},
|
|
247
|
-
touchOption: {
|
|
248
|
-
borderWidth: 1,
|
|
249
|
-
borderColor: Colors.Gray5,
|
|
250
|
-
paddingHorizontal: 16,
|
|
251
|
-
paddingVertical: 5,
|
|
252
|
-
marginHorizontal: 4,
|
|
253
|
-
borderRadius: 2,
|
|
254
|
-
},
|
|
255
|
-
textOption: {
|
|
256
|
-
alignSelf: 'center',
|
|
257
|
-
marginBottom: 8,
|
|
258
|
-
},
|
|
259
|
-
touchStatus: {
|
|
260
|
-
borderRadius: 100,
|
|
261
|
-
paddingHorizontal: 24,
|
|
262
|
-
alignSelf: 'center',
|
|
263
|
-
paddingVertical: 3,
|
|
264
|
-
marginTop: 12,
|
|
265
|
-
},
|
|
266
|
-
segment: {
|
|
267
|
-
marginTop: 36,
|
|
268
|
-
alignSelf: 'center',
|
|
269
|
-
},
|
|
270
|
-
boxOutdoorValues: {
|
|
271
|
-
flexDirection: 'row',
|
|
272
|
-
justifyContent: 'center',
|
|
273
|
-
},
|
|
274
|
-
iconMargin: {
|
|
275
|
-
marginRight: 8,
|
|
276
|
-
},
|
|
277
|
-
historyChart: {
|
|
278
|
-
paddingHorizontal: 16,
|
|
279
|
-
backgroundColor: Colors.White,
|
|
280
|
-
borderRadius: 20,
|
|
281
|
-
borderWidth: 1,
|
|
282
|
-
borderColor: Colors.Gray4,
|
|
283
|
-
marginTop: 16,
|
|
284
|
-
},
|
|
285
|
-
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { Colors } from '../../../configs';
|
|
4
|
+
|
|
5
|
+
export default StyleSheet.create({
|
|
6
|
+
textIndoor: {
|
|
7
|
+
color: Colors.Gray9,
|
|
8
|
+
fontSize: 20,
|
|
9
|
+
marginBottom: 4,
|
|
10
|
+
},
|
|
11
|
+
textDesIndoor: {
|
|
12
|
+
color: Colors.Gray8,
|
|
13
|
+
fontSize: 12,
|
|
14
|
+
marginBottom: 16,
|
|
15
|
+
},
|
|
16
|
+
textNotAvailable: {
|
|
17
|
+
textAlign: 'center',
|
|
18
|
+
},
|
|
19
|
+
boxStatus: {
|
|
20
|
+
borderRadius: 10,
|
|
21
|
+
height: 80,
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
flexDirection: 'row',
|
|
24
|
+
marginBottom: 16,
|
|
25
|
+
},
|
|
26
|
+
boxEmotion: {
|
|
27
|
+
height: 80,
|
|
28
|
+
width: 80,
|
|
29
|
+
backgroundColor: Colors.Yellow6,
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
},
|
|
33
|
+
textStatus: {
|
|
34
|
+
fontSize: 16,
|
|
35
|
+
color: Colors.Gray9,
|
|
36
|
+
marginRight: 24,
|
|
37
|
+
textAlign: 'right',
|
|
38
|
+
maxWidth: 120,
|
|
39
|
+
},
|
|
40
|
+
boxTextStatus: {
|
|
41
|
+
backgroundColor: Colors.Yellow4,
|
|
42
|
+
flex: 1,
|
|
43
|
+
alignItems: 'flex-end',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
},
|
|
46
|
+
boxNumber: {
|
|
47
|
+
flexDirection: 'row',
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
marginBottom: 16,
|
|
50
|
+
},
|
|
51
|
+
boxHealth: {
|
|
52
|
+
flexDirection: 'row',
|
|
53
|
+
marginBottom: 12,
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
marginTop: 36,
|
|
56
|
+
},
|
|
57
|
+
boxContentHealth: {
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
marginBottom: 8,
|
|
61
|
+
},
|
|
62
|
+
boxDot: {
|
|
63
|
+
width: 8,
|
|
64
|
+
height: 8,
|
|
65
|
+
borderRadius: 4,
|
|
66
|
+
backgroundColor: Colors.Yellow6,
|
|
67
|
+
marginRight: 8,
|
|
68
|
+
},
|
|
69
|
+
textOutdoor: {
|
|
70
|
+
color: Colors.Gray9,
|
|
71
|
+
fontSize: 20,
|
|
72
|
+
marginBottom: 24,
|
|
73
|
+
marginTop: 16,
|
|
74
|
+
},
|
|
75
|
+
touchOption: {
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
borderColor: Colors.Gray5,
|
|
78
|
+
paddingHorizontal: 16,
|
|
79
|
+
paddingVertical: 5,
|
|
80
|
+
marginHorizontal: 4,
|
|
81
|
+
borderRadius: 2,
|
|
82
|
+
},
|
|
83
|
+
textOption: {
|
|
84
|
+
paddingTop: 4,
|
|
85
|
+
},
|
|
86
|
+
touchStatus: {
|
|
87
|
+
borderRadius: 100,
|
|
88
|
+
paddingHorizontal: 24,
|
|
89
|
+
alignSelf: 'center',
|
|
90
|
+
paddingVertical: 3,
|
|
91
|
+
marginTop: 12,
|
|
92
|
+
},
|
|
93
|
+
segment: {
|
|
94
|
+
marginTop: 36,
|
|
95
|
+
alignSelf: 'center',
|
|
96
|
+
},
|
|
97
|
+
boxOutdoorValues: {
|
|
98
|
+
flexDirection: 'row',
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
},
|
|
101
|
+
iconMargin: {
|
|
102
|
+
marginRight: 8,
|
|
103
|
+
},
|
|
104
|
+
historyChart: {
|
|
105
|
+
paddingHorizontal: 16,
|
|
106
|
+
backgroundColor: Colors.White,
|
|
107
|
+
borderRadius: 20,
|
|
108
|
+
borderWidth: 1,
|
|
109
|
+
borderColor: Colors.Gray4,
|
|
110
|
+
marginTop: 16,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
4
4
|
|
|
5
5
|
import { Colors } from '../../../configs';
|
|
6
6
|
import TotalPowerBox from '../TotalPowerBox';
|
|
@@ -8,6 +8,7 @@ import Text from '../../Text';
|
|
|
8
8
|
import { TESTID } from '../../../configs/Constants';
|
|
9
9
|
|
|
10
10
|
const TotalPowerConsumption = memo(({ time, total }) => {
|
|
11
|
+
const t = useTranslations();
|
|
11
12
|
return (
|
|
12
13
|
<View style={styles.container}>
|
|
13
14
|
<Text color={Colors.Gray9} size={16} style={styles.txtCurrent}>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import ScrollPicker from 'react-native-wheel-scrollview-picker';
|
|
5
|
+
import Text from '../Text';
|
|
6
|
+
|
|
7
|
+
import { Colors } from '../../configs';
|
|
8
|
+
import styles from './styles';
|
|
9
|
+
|
|
10
|
+
const PickerItem = ({ data, isSelected, align }) => {
|
|
11
|
+
return (
|
|
12
|
+
<View style={styles.wrapText}>
|
|
13
|
+
<Text
|
|
14
|
+
type={isSelected ? 'H2' : 'H3'}
|
|
15
|
+
color={isSelected ? Colors.Gray9 : Colors.Gray6}
|
|
16
|
+
bold={isSelected}
|
|
17
|
+
style={{ textAlign: align }}
|
|
18
|
+
>
|
|
19
|
+
{data.text}
|
|
20
|
+
</Text>
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const Picker = ({
|
|
26
|
+
dataSource,
|
|
27
|
+
selectedIndex,
|
|
28
|
+
onValueChange,
|
|
29
|
+
keyPrefix,
|
|
30
|
+
style,
|
|
31
|
+
align = 'center',
|
|
32
|
+
}) => {
|
|
33
|
+
return (
|
|
34
|
+
<View style={style}>
|
|
35
|
+
<ScrollPicker
|
|
36
|
+
dataSource={dataSource}
|
|
37
|
+
selectedIndex={selectedIndex}
|
|
38
|
+
renderItem={(data, index, isSelected) => (
|
|
39
|
+
<PickerItem
|
|
40
|
+
key={`${keyPrefix}-${index}`}
|
|
41
|
+
data={data}
|
|
42
|
+
isSelected={isSelected}
|
|
43
|
+
align={align}
|
|
44
|
+
/>
|
|
45
|
+
)}
|
|
46
|
+
onValueChange={onValueChange}
|
|
47
|
+
wrapperHeight={180}
|
|
48
|
+
wrapperColor={Colors.Transparent}
|
|
49
|
+
itemHeight={60}
|
|
50
|
+
highlightColor={Colors.Transparent}
|
|
51
|
+
highlightBorderWidth={0}
|
|
52
|
+
/>
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default Picker;
|