@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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
|
+
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import DraggableFlatList from 'react-native-draggable-flatlist';
|
|
4
|
+
import { useRoute } from '@react-navigation/core';
|
|
5
|
+
|
|
6
|
+
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
7
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
8
|
+
import Text from '../../commons/Text';
|
|
9
|
+
import styles from './Styles/indexStyles';
|
|
10
|
+
import { Colors } from '../../configs';
|
|
11
|
+
import FImage from '../../commons/FImage';
|
|
12
|
+
import Rearrange from '../../../assets/images/Rearrange.svg';
|
|
13
|
+
import Close from '../../../assets/images/Close.svg';
|
|
14
|
+
|
|
15
|
+
const EditActionsList = () => {
|
|
16
|
+
const t = useTranslations();
|
|
17
|
+
const { params = {} } = useRoute();
|
|
18
|
+
const { data = [] } = params;
|
|
19
|
+
const [actionsList, setActionList] = useState(
|
|
20
|
+
[...data].map((item) => {
|
|
21
|
+
return {
|
|
22
|
+
...item,
|
|
23
|
+
key: `item-${item?.id}`,
|
|
24
|
+
};
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const onPressCancel = useCallback(() => {
|
|
29
|
+
setActionList(
|
|
30
|
+
[...data].map((item) => {
|
|
31
|
+
return {
|
|
32
|
+
...item,
|
|
33
|
+
key: `item-${item?.id}`,
|
|
34
|
+
};
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
const onPressSave = useCallback(() => {
|
|
41
|
+
// eslint-disable-next-line no-alert
|
|
42
|
+
alert(t('feature_under_development'));
|
|
43
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
const onPressRemove = useCallback(() => {
|
|
47
|
+
// eslint-disable-next-line no-alert
|
|
48
|
+
alert(t('feature_under_development'));
|
|
49
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const renderItem = useCallback(({ item, index, drag }) => {
|
|
53
|
+
return (
|
|
54
|
+
<TouchableOpacity style={styles.wrapItem} onLongPress={drag}>
|
|
55
|
+
<View style={styles.leftItem}>
|
|
56
|
+
<Text color={Colors.Gray9} type="H4" semibold>
|
|
57
|
+
{index + 1 < 10 ? '0' + (index + 1) : index + 1}
|
|
58
|
+
</Text>
|
|
59
|
+
<Rearrange />
|
|
60
|
+
</View>
|
|
61
|
+
<View style={styles.rightItem}>
|
|
62
|
+
<FImage
|
|
63
|
+
source={{ uri: item?.sensor_icon_kit }}
|
|
64
|
+
style={styles.iconItem}
|
|
65
|
+
/>
|
|
66
|
+
<View style={styles.contentItem}>
|
|
67
|
+
<Text numberOfLines={1} type="Label" color={Colors.Gray7}>
|
|
68
|
+
{item?.station_name}
|
|
69
|
+
</Text>
|
|
70
|
+
<Text numberOfLines={1} type="H4" color={Colors.Gray9} semibold>
|
|
71
|
+
{item?.sensor_name}
|
|
72
|
+
</Text>
|
|
73
|
+
<Text numberOfLines={1} type="H4" color={Colors.Gray9}>
|
|
74
|
+
{item?.action_name}
|
|
75
|
+
</Text>
|
|
76
|
+
</View>
|
|
77
|
+
<TouchableOpacity onPress={onPressRemove} style={styles.closeButton}>
|
|
78
|
+
<Close />
|
|
79
|
+
</TouchableOpacity>
|
|
80
|
+
</View>
|
|
81
|
+
</TouchableOpacity>
|
|
82
|
+
);
|
|
83
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
84
|
+
}, []);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<View style={styles.wrap}>
|
|
88
|
+
<WrapHeaderScrollable
|
|
89
|
+
title={t('edit_actions_list')}
|
|
90
|
+
headerAniStyle={styles.headerAniStyle}
|
|
91
|
+
>
|
|
92
|
+
<View style={styles.wrapContent}>
|
|
93
|
+
<Text type="Body" color={Colors.Gray8}>
|
|
94
|
+
{t('des_edit_actions_list')}
|
|
95
|
+
</Text>
|
|
96
|
+
<DraggableFlatList
|
|
97
|
+
data={actionsList}
|
|
98
|
+
renderItem={renderItem}
|
|
99
|
+
keyExtractor={(item) => `draggable-item-${item.key}`}
|
|
100
|
+
onDragEnd={({ data }) => setActionList(data)}
|
|
101
|
+
extraData={actionsList}
|
|
102
|
+
containerStyle={styles.containerStyle}
|
|
103
|
+
/>
|
|
104
|
+
</View>
|
|
105
|
+
</WrapHeaderScrollable>
|
|
106
|
+
<View style={styles.wrapBottom}>
|
|
107
|
+
<TouchableOpacity onPress={onPressCancel}>
|
|
108
|
+
<Text type="H4" hilight semibold>
|
|
109
|
+
{t('cancel')}
|
|
110
|
+
</Text>
|
|
111
|
+
</TouchableOpacity>
|
|
112
|
+
<TouchableOpacity onPress={onPressSave}>
|
|
113
|
+
<Text type="H4" hilight semibold>
|
|
114
|
+
{t('save')}
|
|
115
|
+
</Text>
|
|
116
|
+
</TouchableOpacity>
|
|
117
|
+
</View>
|
|
118
|
+
</View>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default EditActionsList;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
2
|
import { SafeAreaView, StyleSheet, TextInput } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
5
|
import { Section, ViewButtonBottom } from '../../commons';
|
|
6
6
|
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
7
7
|
import { API, Colors } from '../../configs';
|
|
@@ -11,6 +11,7 @@ import { axiosPost } from '../../utils/Apis/axios';
|
|
|
11
11
|
import { ToastBottomHelper } from '../../utils/Utils';
|
|
12
12
|
|
|
13
13
|
export const EmergencyContactsAddNew = ({ route }) => {
|
|
14
|
+
const t = useTranslations();
|
|
14
15
|
const { group } = route.params;
|
|
15
16
|
const { goBack } = useNavigation();
|
|
16
17
|
const { keyboardBottomPadding } = useKeyboardShow();
|
|
@@ -42,7 +43,7 @@ export const EmergencyContactsAddNew = ({ route }) => {
|
|
|
42
43
|
} else {
|
|
43
44
|
ToastBottomHelper.error(t('create_contact_failed'));
|
|
44
45
|
}
|
|
45
|
-
}, [goBack, group.id, textName, textPhone]);
|
|
46
|
+
}, [goBack, group.id, t, textName, textPhone]);
|
|
46
47
|
|
|
47
48
|
return (
|
|
48
49
|
<SafeAreaView
|
|
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect } from 'react';
|
|
|
2
2
|
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { useIsFocused, useNavigation } from '@react-navigation/native';
|
|
5
|
-
import {
|
|
5
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
6
6
|
import { AlertAction, MenuActionList, Section } from '../../commons';
|
|
7
7
|
import { RowUser } from '../../commons/RowUser';
|
|
8
8
|
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
@@ -17,6 +17,7 @@ import { ToastBottomHelper } from '../../utils/Utils';
|
|
|
17
17
|
const MAX_EMERGENCY_CONTACTS = 5;
|
|
18
18
|
|
|
19
19
|
export const EmergencyContactsList = ({ route }) => {
|
|
20
|
+
const t = useTranslations();
|
|
20
21
|
const { unitId, group } = route.params;
|
|
21
22
|
const { navigate } = useNavigation();
|
|
22
23
|
const isFocused = useIsFocused();
|
|
@@ -48,7 +49,13 @@ export const EmergencyContactsList = ({ route }) => {
|
|
|
48
49
|
ToastBottomHelper.error(message);
|
|
49
50
|
}
|
|
50
51
|
hideAlertRemoveContact();
|
|
51
|
-
}, [
|
|
52
|
+
}, [
|
|
53
|
+
stateAlertRemoveContact.member.id,
|
|
54
|
+
hideAlertRemoveContact,
|
|
55
|
+
t,
|
|
56
|
+
getListContacts,
|
|
57
|
+
group.id,
|
|
58
|
+
]);
|
|
52
59
|
|
|
53
60
|
const onAddNew = useCallback(() => {
|
|
54
61
|
setShowAddnewModal();
|
|
@@ -2,7 +2,7 @@ import React, { useCallback, useState } from 'react';
|
|
|
2
2
|
import { SafeAreaView, StyleSheet, View } from 'react-native';
|
|
3
3
|
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
|
-
import {
|
|
5
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
6
6
|
import { Section, ViewButtonBottom } from '../../commons';
|
|
7
7
|
import { RowUser } from '../../commons/RowUser';
|
|
8
8
|
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
@@ -29,6 +29,7 @@ const dataContact = [
|
|
|
29
29
|
];
|
|
30
30
|
|
|
31
31
|
export const EmergencyContactsSelectContacts = ({ route }) => {
|
|
32
|
+
const t = useTranslations();
|
|
32
33
|
const { goBack } = useNavigation();
|
|
33
34
|
// const { unitId } = route.params;
|
|
34
35
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
3
|
import { act, create } from 'react-test-renderer';
|
|
4
4
|
import { EmergencyContactsAddNew } from '../EmergencyContactsAddNew';
|
|
5
|
-
import {
|
|
5
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
import Toast from 'react-native-toast-message';
|
|
8
8
|
import { ViewButtonBottom } from '../../../commons';
|
|
@@ -24,6 +24,7 @@ jest.mock('@react-navigation/native', () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
describe('test EmergencyContactAddNew', () => {
|
|
27
|
+
const t = useTranslations();
|
|
27
28
|
let route;
|
|
28
29
|
beforeEach(() => {
|
|
29
30
|
route = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import { act, create } from 'react-test-renderer';
|
|
4
|
-
import {
|
|
4
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
5
5
|
import Routes from '../../../utils/Route';
|
|
6
6
|
import { AlertAction } from '../../../commons';
|
|
7
7
|
import { EmergencyContactsList } from '../EmergencyContactsList';
|
|
@@ -20,6 +20,7 @@ jest.mock('@react-navigation/native', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
describe('test EmergencyContactList', () => {
|
|
23
|
+
const t = useTranslations();
|
|
23
24
|
let route;
|
|
24
25
|
|
|
25
26
|
beforeEach(() => {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
2
2
|
import { useCallback, useState } from 'react';
|
|
3
3
|
import { API } from '../../configs';
|
|
4
4
|
import { axiosGet } from '../../utils/Apis/axios';
|
|
5
5
|
|
|
6
6
|
export const useAlertRemoveEmergencyContact = () => {
|
|
7
|
+
const t = useTranslations();
|
|
7
8
|
const [stateAlertRemoveContact, setStateAlertRemoveContact] = useState({
|
|
8
9
|
visible: false,
|
|
9
10
|
title: '',
|
|
@@ -25,7 +26,7 @@ export const useAlertRemoveEmergencyContact = () => {
|
|
|
25
26
|
};
|
|
26
27
|
});
|
|
27
28
|
},
|
|
28
|
-
[]
|
|
29
|
+
[t]
|
|
29
30
|
);
|
|
30
31
|
|
|
31
32
|
const hideAlertRemoveContact = useCallback(() => {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
FlatList,
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import Animated from 'react-native-reanimated';
|
|
10
|
-
import {
|
|
10
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
11
11
|
|
|
12
12
|
import { API, Colors } from '../../configs';
|
|
13
13
|
import { axiosGet } from '../../utils/Apis/axios';
|
|
@@ -25,6 +25,7 @@ navigator.geolocation = require('@react-native-community/geolocation');
|
|
|
25
25
|
let page = 1;
|
|
26
26
|
|
|
27
27
|
const Explore = ({ navigation }) => {
|
|
28
|
+
const t = useTranslations();
|
|
28
29
|
useBlockBackAndroid();
|
|
29
30
|
const [transY] = useKeyboard(80);
|
|
30
31
|
|
|
@@ -104,7 +105,7 @@ const Explore = ({ navigation }) => {
|
|
|
104
105
|
</View>
|
|
105
106
|
</>
|
|
106
107
|
);
|
|
107
|
-
}, [unitsNearMe,
|
|
108
|
+
}, [t, unitsNearMe, navigation, coords]);
|
|
108
109
|
|
|
109
110
|
const itemCity = useCallback(({ item }) => {
|
|
110
111
|
return <CityItem item={item} />;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { RadioCircle } from '../../../commons';
|
|
4
|
+
import Text from '../../../commons/Text';
|
|
5
|
+
import styles from '../styles/AccessScheduleItemStyles';
|
|
6
|
+
|
|
7
|
+
const AccessScheduleItem = ({ item, isSelected, onSelect }) => {
|
|
8
|
+
const DetailComponent = item.detail;
|
|
9
|
+
const handleOnSelect = useCallback(() => {
|
|
10
|
+
onSelect(item.value);
|
|
11
|
+
}, [item.value, onSelect]);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<View style={styles.rowWrap}>
|
|
15
|
+
<View style={styles.rowContent}>
|
|
16
|
+
<TouchableOpacity style={styles.row} onPress={handleOnSelect}>
|
|
17
|
+
<RadioCircle active={isSelected} />
|
|
18
|
+
<Text style={styles.textAccessSchedule}>{item.text}</Text>
|
|
19
|
+
</TouchableOpacity>
|
|
20
|
+
{isSelected && <DetailComponent />}
|
|
21
|
+
</View>
|
|
22
|
+
<View style={styles.separator} />
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default AccessScheduleItem;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
|
|
6
|
+
import BottomSheet from '../../../commons/BottomSheet';
|
|
7
|
+
import ViewButtonBottom from '../../../commons/ViewButtonBottom';
|
|
8
|
+
import AccessScheduleItem from './AccessScheduleItem';
|
|
9
|
+
import RecurringDetail from './RecurringDetail';
|
|
10
|
+
import TemporaryDetail from './TemporaryDetail';
|
|
11
|
+
import WheelDateTimePicker from '../../../commons/WheelDateTimePicker';
|
|
12
|
+
|
|
13
|
+
import { ACCESS_SCHEDULE } from '../constant';
|
|
14
|
+
|
|
15
|
+
const AccessScheduleSheet = ({
|
|
16
|
+
isVisible,
|
|
17
|
+
onShow,
|
|
18
|
+
onHide,
|
|
19
|
+
data,
|
|
20
|
+
onSetData,
|
|
21
|
+
}) => {
|
|
22
|
+
const t = useTranslations();
|
|
23
|
+
const [dateTimePickerState, setDateTimePickerState] = useState({
|
|
24
|
+
isVisible: false,
|
|
25
|
+
mode: 'time',
|
|
26
|
+
defaultValue: moment().valueOf(),
|
|
27
|
+
setter: null,
|
|
28
|
+
});
|
|
29
|
+
const [accessSchedule, setAccessSchedule] = useState(data.access_schedule);
|
|
30
|
+
const [recurringTimeStart, setRecurringTimeStart] = useState(
|
|
31
|
+
data.recurring_time_start
|
|
32
|
+
);
|
|
33
|
+
const [recurringTimeEnd, setRecurringTimeEnd] = useState(
|
|
34
|
+
data.recurring_time_end
|
|
35
|
+
);
|
|
36
|
+
const [recurringTimeRepeat, setRecurringTimeRepeat] = useState(
|
|
37
|
+
data.recurring_time_repeat
|
|
38
|
+
);
|
|
39
|
+
const [temporaryTimeStart, setTemporaryTimeStart] = useState(
|
|
40
|
+
data.temporary_time_start
|
|
41
|
+
);
|
|
42
|
+
const [temporaryTimeEnd, setTemporaryTimeEnd] = useState(
|
|
43
|
+
data.temporary_time_end
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const onShowSetDateTime = useCallback(
|
|
47
|
+
(currentValue, setter, mode) => {
|
|
48
|
+
onHide();
|
|
49
|
+
setDateTimePickerState((prevState) => ({
|
|
50
|
+
...prevState,
|
|
51
|
+
isVisible: true,
|
|
52
|
+
mode: mode,
|
|
53
|
+
defaultValue: currentValue,
|
|
54
|
+
setter: setter,
|
|
55
|
+
}));
|
|
56
|
+
},
|
|
57
|
+
[setDateTimePickerState, onHide]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const onHideSetDateTime = useCallback(() => {
|
|
61
|
+
onShow();
|
|
62
|
+
setDateTimePickerState((prevState) => ({
|
|
63
|
+
...prevState,
|
|
64
|
+
isVisible: false,
|
|
65
|
+
}));
|
|
66
|
+
}, [setDateTimePickerState, onShow]);
|
|
67
|
+
|
|
68
|
+
const onDateTimePicked = useCallback(
|
|
69
|
+
(timeData) => {
|
|
70
|
+
const setter = dateTimePickerState.setter;
|
|
71
|
+
setter && setter(moment(timeData));
|
|
72
|
+
},
|
|
73
|
+
[dateTimePickerState]
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const listAccessSchedule = useMemo(
|
|
77
|
+
() => [
|
|
78
|
+
{
|
|
79
|
+
text: t(`${ACCESS_SCHEDULE.ALWAYS}`),
|
|
80
|
+
value: ACCESS_SCHEDULE.ALWAYS,
|
|
81
|
+
detail: () => <></>,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
text: t(`${ACCESS_SCHEDULE.RECURRING}`),
|
|
85
|
+
value: ACCESS_SCHEDULE.RECURRING,
|
|
86
|
+
detail: () => (
|
|
87
|
+
<RecurringDetail
|
|
88
|
+
onShowSetDateTime={onShowSetDateTime}
|
|
89
|
+
recurringTimeStart={recurringTimeStart}
|
|
90
|
+
recurringTimeEnd={recurringTimeEnd}
|
|
91
|
+
recurringTimeRepeat={recurringTimeRepeat}
|
|
92
|
+
setRecurringTimeStart={setRecurringTimeStart}
|
|
93
|
+
setRecurringTimeEnd={setRecurringTimeEnd}
|
|
94
|
+
setRecurringTimeRepeat={setRecurringTimeRepeat}
|
|
95
|
+
/>
|
|
96
|
+
),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
text: t(`${ACCESS_SCHEDULE.TEMPORARY}`),
|
|
100
|
+
value: ACCESS_SCHEDULE.TEMPORARY,
|
|
101
|
+
detail: () => (
|
|
102
|
+
<TemporaryDetail
|
|
103
|
+
onShowSetDateTime={onShowSetDateTime}
|
|
104
|
+
temporaryTimeStart={temporaryTimeStart}
|
|
105
|
+
temporaryTimeEnd={temporaryTimeEnd}
|
|
106
|
+
setTemporaryTimeStart={setTemporaryTimeStart}
|
|
107
|
+
setTemporaryTimeEnd={setTemporaryTimeEnd}
|
|
108
|
+
/>
|
|
109
|
+
),
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
t,
|
|
114
|
+
onShowSetDateTime,
|
|
115
|
+
recurringTimeStart,
|
|
116
|
+
recurringTimeEnd,
|
|
117
|
+
recurringTimeRepeat,
|
|
118
|
+
temporaryTimeStart,
|
|
119
|
+
temporaryTimeEnd,
|
|
120
|
+
]
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
const resetData = useCallback(() => {
|
|
124
|
+
setAccessSchedule(data.access_schedule);
|
|
125
|
+
setRecurringTimeStart(data.recurring_time_start);
|
|
126
|
+
setRecurringTimeEnd(data.recurring_time_end);
|
|
127
|
+
setRecurringTimeRepeat(data.recurring_time_repeat);
|
|
128
|
+
setTemporaryTimeStart(data.temporary_time_start);
|
|
129
|
+
setTemporaryTimeEnd(data.temporary_time_end);
|
|
130
|
+
}, [data]);
|
|
131
|
+
|
|
132
|
+
const onCancel = useCallback(() => {
|
|
133
|
+
onHide();
|
|
134
|
+
resetData();
|
|
135
|
+
}, [onHide, resetData]);
|
|
136
|
+
|
|
137
|
+
const onDone = useCallback(() => {
|
|
138
|
+
onSetData({
|
|
139
|
+
access_schedule: accessSchedule,
|
|
140
|
+
recurring_time_start: recurringTimeStart,
|
|
141
|
+
recurring_time_end: recurringTimeEnd,
|
|
142
|
+
recurring_time_repeat: recurringTimeRepeat,
|
|
143
|
+
temporary_time_start: temporaryTimeStart,
|
|
144
|
+
temporary_time_end: temporaryTimeEnd,
|
|
145
|
+
});
|
|
146
|
+
onHide();
|
|
147
|
+
}, [
|
|
148
|
+
accessSchedule,
|
|
149
|
+
recurringTimeStart,
|
|
150
|
+
recurringTimeEnd,
|
|
151
|
+
recurringTimeRepeat,
|
|
152
|
+
temporaryTimeStart,
|
|
153
|
+
temporaryTimeEnd,
|
|
154
|
+
onHide,
|
|
155
|
+
onSetData,
|
|
156
|
+
]);
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<>
|
|
160
|
+
<BottomSheet
|
|
161
|
+
isVisible={isVisible}
|
|
162
|
+
onHide={onCancel}
|
|
163
|
+
title={t('access_schedule')}
|
|
164
|
+
>
|
|
165
|
+
<View>
|
|
166
|
+
{listAccessSchedule.map((item, index) => (
|
|
167
|
+
<AccessScheduleItem
|
|
168
|
+
key={index}
|
|
169
|
+
item={item}
|
|
170
|
+
isSelected={item.value === accessSchedule}
|
|
171
|
+
onSelect={setAccessSchedule}
|
|
172
|
+
/>
|
|
173
|
+
))}
|
|
174
|
+
</View>
|
|
175
|
+
<ViewButtonBottom
|
|
176
|
+
leftTitle={t('cancel')}
|
|
177
|
+
onLeftClick={onCancel}
|
|
178
|
+
rightTitle={t('done')}
|
|
179
|
+
onRightClick={onDone}
|
|
180
|
+
/>
|
|
181
|
+
</BottomSheet>
|
|
182
|
+
<WheelDateTimePicker
|
|
183
|
+
mode={dateTimePickerState.mode}
|
|
184
|
+
isVisible={dateTimePickerState.isVisible}
|
|
185
|
+
defaultValue={dateTimePickerState.defaultValue}
|
|
186
|
+
onPicked={onDateTimePicked}
|
|
187
|
+
onHide={onHideSetDateTime}
|
|
188
|
+
/>
|
|
189
|
+
</>
|
|
190
|
+
);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export default AccessScheduleSheet;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, TouchableOpacity, Image } from 'react-native';
|
|
3
|
+
import { useNavigation } from '@react-navigation/native';
|
|
4
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
5
|
+
import Text from '../../../commons/Text';
|
|
6
|
+
import { Images, Colors } from '../../../configs';
|
|
7
|
+
import styles from '../styles/HeaderGuestInfoStyles';
|
|
8
|
+
|
|
9
|
+
const HeaderGuestInfo = ({ onSave }) => {
|
|
10
|
+
const t = useTranslations();
|
|
11
|
+
const { goBack } = useNavigation();
|
|
12
|
+
return (
|
|
13
|
+
<View style={styles.wrap}>
|
|
14
|
+
<TouchableOpacity style={styles.button} onPress={goBack}>
|
|
15
|
+
<Image source={Images.arrowBack} style={styles.icon} />
|
|
16
|
+
</TouchableOpacity>
|
|
17
|
+
<View style={styles.wrapTitle}>
|
|
18
|
+
<Text type="H4" bold>
|
|
19
|
+
{t('guest_info')}
|
|
20
|
+
</Text>
|
|
21
|
+
</View>
|
|
22
|
+
<TouchableOpacity style={styles.button} onPress={onSave}>
|
|
23
|
+
<Text type="H4" color={Colors.Primary}>
|
|
24
|
+
{t('save')}
|
|
25
|
+
</Text>
|
|
26
|
+
</TouchableOpacity>
|
|
27
|
+
</View>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default HeaderGuestInfo;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
4
|
+
|
|
5
|
+
import Text from '../../../commons/Text';
|
|
6
|
+
import { Colors } from '../../../configs';
|
|
7
|
+
import { REPEAT_ITEMS } from '../constant';
|
|
8
|
+
import styles from '../styles/AccessScheduleDetailStyles';
|
|
9
|
+
|
|
10
|
+
const RecurringDetail = ({
|
|
11
|
+
onShowSetDateTime,
|
|
12
|
+
recurringTimeStart,
|
|
13
|
+
recurringTimeEnd,
|
|
14
|
+
recurringTimeRepeat,
|
|
15
|
+
setRecurringTimeStart,
|
|
16
|
+
setRecurringTimeEnd,
|
|
17
|
+
setRecurringTimeRepeat,
|
|
18
|
+
}) => {
|
|
19
|
+
const t = useTranslations();
|
|
20
|
+
const onSetTimeStart = useCallback(() => {
|
|
21
|
+
onShowSetDateTime(recurringTimeStart, setRecurringTimeStart, 'time');
|
|
22
|
+
}, [onShowSetDateTime, recurringTimeStart, setRecurringTimeStart]);
|
|
23
|
+
|
|
24
|
+
const onSetTimeEnd = useCallback(() => {
|
|
25
|
+
onShowSetDateTime(recurringTimeEnd, setRecurringTimeEnd, 'time');
|
|
26
|
+
}, [onShowSetDateTime, recurringTimeEnd, setRecurringTimeEnd]);
|
|
27
|
+
|
|
28
|
+
const onSetRepeat = useCallback(
|
|
29
|
+
(item) => {
|
|
30
|
+
const index = recurringTimeRepeat.indexOf(item.value);
|
|
31
|
+
if (index !== -1) {
|
|
32
|
+
setRecurringTimeRepeat([
|
|
33
|
+
...recurringTimeRepeat.slice(0, index),
|
|
34
|
+
...recurringTimeRepeat.slice(index + 1),
|
|
35
|
+
]);
|
|
36
|
+
} else {
|
|
37
|
+
setRecurringTimeRepeat([...recurringTimeRepeat, item.value]);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[recurringTimeRepeat, setRecurringTimeRepeat]
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const renderRepeatItem = useCallback(
|
|
44
|
+
(item, index, isSelected) => {
|
|
45
|
+
return (
|
|
46
|
+
<TouchableOpacity
|
|
47
|
+
key={index}
|
|
48
|
+
style={[styles.repeatItem, isSelected && styles.repeatItemSelected]}
|
|
49
|
+
onPress={() => onSetRepeat(item)}
|
|
50
|
+
>
|
|
51
|
+
<Text
|
|
52
|
+
type="Body"
|
|
53
|
+
lineHeight={16}
|
|
54
|
+
color={isSelected ? Colors.Orange : item.color}
|
|
55
|
+
style={styles.repeatText}
|
|
56
|
+
>
|
|
57
|
+
{item.text}
|
|
58
|
+
</Text>
|
|
59
|
+
</TouchableOpacity>
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
[onSetRepeat]
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<View>
|
|
67
|
+
<Text type="Body" color={Colors.Gray8} style={styles.title}>
|
|
68
|
+
{t('start')}
|
|
69
|
+
</Text>
|
|
70
|
+
<TouchableOpacity onPress={onSetTimeStart}>
|
|
71
|
+
<Text type="Body" color={Colors.Orange} style={styles.value}>
|
|
72
|
+
{recurringTimeStart.format('HH:mm')}
|
|
73
|
+
</Text>
|
|
74
|
+
</TouchableOpacity>
|
|
75
|
+
<Text type="Body" color={Colors.Gray8} style={styles.title}>
|
|
76
|
+
{t('end')}
|
|
77
|
+
</Text>
|
|
78
|
+
<TouchableOpacity onPress={onSetTimeEnd}>
|
|
79
|
+
<Text type="Body" color={Colors.Orange} style={styles.value}>
|
|
80
|
+
{recurringTimeEnd.format('HH:mm')}
|
|
81
|
+
</Text>
|
|
82
|
+
</TouchableOpacity>
|
|
83
|
+
<Text type="Body" color={Colors.Gray8} style={styles.title}>
|
|
84
|
+
{t('repeat')}
|
|
85
|
+
</Text>
|
|
86
|
+
<View style={styles.repeatWrap}>
|
|
87
|
+
{REPEAT_ITEMS.map((item, index) =>
|
|
88
|
+
renderRepeatItem(
|
|
89
|
+
item,
|
|
90
|
+
index,
|
|
91
|
+
recurringTimeRepeat.includes(item.value)
|
|
92
|
+
)
|
|
93
|
+
)}
|
|
94
|
+
</View>
|
|
95
|
+
</View>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default RecurringDetail;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { IconOutline } from '@ant-design/icons-react-native';
|
|
4
|
+
import Text from '../../../commons/Text';
|
|
5
|
+
import styles from '../styles/indexStyles';
|
|
6
|
+
|
|
7
|
+
const RowGuestInfo = ({
|
|
8
|
+
textLeft,
|
|
9
|
+
textRight,
|
|
10
|
+
rightArrow = false,
|
|
11
|
+
onPress = () => {},
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
<TouchableOpacity onPress={onPress}>
|
|
15
|
+
<View style={styles.row}>
|
|
16
|
+
<Text type="H4" bold>
|
|
17
|
+
{textLeft}
|
|
18
|
+
</Text>
|
|
19
|
+
<View style={styles.rowRight}>
|
|
20
|
+
<Text type="Body">{textRight}</Text>
|
|
21
|
+
{rightArrow && (
|
|
22
|
+
<IconOutline name="right" size={20} style={styles.icon} />
|
|
23
|
+
)}
|
|
24
|
+
</View>
|
|
25
|
+
</View>
|
|
26
|
+
<View style={styles.separator} />
|
|
27
|
+
</TouchableOpacity>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default RowGuestInfo;
|