@eohjsc/react-native-smart-city 0.3.90 → 0.3.92
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/package.json +1 -1
- package/src/Images/Common/reorder.svg +3 -0
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/AutoLockStyles.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +3 -1
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +3 -3
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +3 -10
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +1 -0
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/SetupGeneratePasscodeStyles.js +1 -1
- package/src/commons/ActionGroup/OnOffTemplate/SwitchButtonTemplate.js +13 -5
- package/src/commons/ActionGroup/SliderRangeTemplate.js +100 -69
- package/src/commons/ActionGroup/SliderRangeTemplateStyles.js +27 -27
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +4 -1
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +1 -1
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +4 -1
- package/src/commons/ActionGroup/__test__/SliderRangeTemplate.test.js +56 -0
- package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +2 -2
- package/src/commons/ActionGroup/__test__/SwitchButtonTemplate.test.js +45 -8
- package/src/commons/ActionGroup/__test__/index.test.js +0 -19
- package/src/commons/ActionGroup/index.js +0 -3
- package/src/commons/ActionTemplate/CurtainAction.js +5 -5
- package/src/commons/ActionTemplate/CurtainActionStyles.js +1 -1
- package/src/commons/ActionTemplate/OnOffButtonAction.js +4 -4
- package/src/commons/ActionTemplate/OnOffButtonActionStyles.js +1 -1
- package/src/commons/ActionTemplate/OnOffSimpleAction.js +4 -4
- package/src/commons/ActionTemplate/OnOffSimpleActionStyles.js +1 -1
- package/src/commons/ActionTemplate/OnOffSmartLockAction.js +4 -4
- package/src/commons/ActionTemplate/OnOffSmartLockActionStyles.js +1 -1
- package/src/commons/ActionTemplate/OneButtonAction.js +3 -3
- package/src/commons/ActionTemplate/OneButtonActionStyles.js +1 -1
- package/src/commons/ActionTemplate/ThreeButtonAction.js +5 -5
- package/src/commons/ActionTemplate/ThreeButtonActionStyles.js +1 -1
- package/src/commons/ActionTemplate/__test__/CurtainAction.test.js +1 -1
- package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +1 -1
- package/src/commons/ActionTemplate/__test__/OnOffSimpleAction.test.js +1 -1
- package/src/commons/ActionTemplate/__test__/OnOffSmartLockAction.test.js +1 -1
- package/src/commons/ActionTemplate/__test__/OneButtonAction.test.js +1 -1
- package/src/commons/ActionTemplate/__test__/ThreeButtonAction.test.js +1 -1
- package/src/commons/ActionTemplate/__test__/index.test.js +21 -70
- package/src/commons/ActionTemplate/index.js +19 -55
- package/src/commons/Alert/__test__/Alert.test.js +1 -1
- package/src/commons/Auth/AccountList.js +1 -1
- package/src/commons/Auth/__test__/OtpInputList.test.js +17 -19
- package/src/commons/Automate/ItemAutomate.js +10 -4
- package/src/commons/Automate/__test__/ItemAutomate.test.js +11 -11
- package/src/commons/BackDefault/__test__/BackDefault.test.js +1 -1
- package/src/commons/Button/__test__/Button.test.js +1 -1
- package/src/commons/ButtonPopup/__test__/ButtonPopup.test.js +1 -1
- package/src/commons/Calendar/__test__/Calendar.test.js +1 -1
- package/src/commons/ChartLoading/__test__/ChartLoading.test.js +1 -1
- package/src/commons/CircleButton/__test__/CircleButton.test.js +1 -1
- package/src/commons/CircleView/__test__/CircleView.test.js +1 -1
- package/src/commons/DateTimeRangeChange/__test__/DateTimeButton.test.js +4 -2
- package/src/commons/DateTimeRangeChange/index.js +31 -48
- package/src/commons/Device/DeviceAlertStatus.js +2 -1
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +2 -2
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +1 -1
- package/src/commons/Device/FlatListItems.js +1 -1
- package/src/commons/Device/Hanet/ItemHanetDevice.test.js +2 -2
- package/src/commons/Device/HistoryChart.js +6 -49
- package/src/commons/Device/LinearChart/LinearChart.test.js +1 -1
- package/src/commons/Device/ProgressBar/__test__/ProgressBar.test.js +1 -1
- package/src/commons/Device/ProgressBar/index.js +5 -11
- package/src/commons/Device/ProgressBar/styles.js +11 -3
- package/src/commons/Device/RainningSensor/__test__/CurrentRainSensor.test.js +5 -5
- package/src/commons/Device/SonosSpeaker/__test__/SonosSpeaker.test.js +3 -3
- package/src/commons/Device/WindDirection/Compass/Compass.test.js +2 -2
- package/src/commons/Device/WindSpeed/Anemometer/index.js +2 -0
- package/src/commons/Device/WindSpeed/LinearChart/__test__/LinearChart.test.js +14 -1
- package/src/commons/Device/WindSpeed/LinearChart/index.js +5 -3
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +3 -3
- package/src/commons/Device/__test__/DisconnectedView.test.js +2 -2
- package/src/commons/Device/__test__/FlatListItems.test.js +1 -1
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +1 -1
- package/src/commons/DisplayChecking/__test__/DisplayChecking.test.js +1 -1
- package/src/commons/FlatListDnD/__test__/index.test.js +49 -0
- package/src/commons/FlatListDnD/index.js +37 -0
- package/src/commons/FlatListDnD/styles.js +12 -0
- package/src/commons/Form/__test__/CurrencyInput.test.js +2 -2
- package/src/commons/Form/__test__/TextInput.test.js +3 -3
- package/src/commons/Form/__test__/TextInputPassword.test.js +2 -2
- package/src/commons/FullLoading/__test__/index.test.js +2 -2
- package/src/commons/Header/HeaderCustom.js +2 -1
- package/src/commons/HorizontalPicker/index.js +65 -38
- package/src/commons/IconComponent/index.js +3 -2
- package/src/commons/ImageButton/__test__/ImageButton.test.js +1 -1
- package/src/commons/MediaPlayer/__test__/index.test.js +8 -3
- package/src/commons/MediaPlayer/index.js +11 -7
- package/src/commons/MenuActionMore/index.js +6 -4
- package/src/commons/Modal/ModalBottom.js +2 -3
- package/src/commons/Modal/ModalCustom.js +2 -3
- package/src/commons/NavBar/index.js +48 -50
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplateStyles.js +1 -1
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +5 -5
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplateStyles.js +1 -1
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +5 -5
- package/src/commons/OneTapTemplate/StatesGridActionTemplateStyles.js +1 -1
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +2 -2
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +1 -1
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +2 -2
- package/src/commons/PreventAccess/index.js +1 -1
- package/src/commons/RowItem/__test__/RowItem.test.js +1 -1
- package/src/commons/RowUser/__test__/RowUser.test.js +1 -1
- package/src/commons/Section/Section.test.js +2 -2
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +1 -1
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +3 -3
- package/src/commons/Sharing/StationDevicePermissions.js +4 -4
- package/src/commons/Sharing/WrapHeaderScrollable.js +5 -5
- package/src/commons/Sharing/__test__/ButtonRemoveMember.test.js +1 -1
- package/src/commons/Sharing/__test__/DevicePermissionsCheckbox.test.js +3 -3
- package/src/commons/Sharing/__test__/MemberList.test.js +6 -4
- package/src/commons/Sharing/__test__/RowMember.test.js +2 -2
- package/src/commons/Sharing/__test__/WrapHeaderScrollable.test.js +4 -2
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +7 -11
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +13 -16
- package/src/commons/SubUnit/OneTap/index.js +22 -7
- package/src/commons/TextButton/__test__/TextButton.test.js +2 -2
- package/src/commons/Today/__test__/Today.test.js +1 -1
- package/src/commons/TouchableScale/__test__/TouchableScale.test.js +1 -1
- package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +4 -0
- package/src/commons/UnitSummary/AirQuality/index.js +2 -2
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +1 -1
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +0 -6
- package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +1 -1
- package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +1 -1
- package/src/commons/ViewButtonBottom/__test__/ViewButtonBottom.test.js +1 -1
- package/src/configs/API.js +14 -31
- package/src/configs/AccessibilityLabel.js +1 -0
- package/src/configs/Colors.js +1 -1
- package/src/configs/Constants.js +14 -48
- package/src/context/reducer.ts +3 -1
- package/src/hoc/__test__/withRemoteControl.test.js +1 -1
- package/src/hooks/Common/__test__/useStatusbar.test.js +5 -5
- package/src/hooks/Common/index.js +0 -2
- package/src/hooks/Common/useKeyboardShow.js +4 -4
- package/src/hooks/Common/useStatusBar.js +2 -2
- package/src/hooks/Common/useTitleHeader.js +5 -7
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +11 -0
- package/src/hooks/IoT/useBluetoothConnection.js +6 -3
- package/src/hooks/index.js +1 -2
- package/src/navigations/UnitStack.js +51 -17
- package/src/screens/ActivityLog/FilterPopup.js +4 -4
- package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
- package/src/screens/ActivityLog/__test__/index.test.js +2 -2
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +3 -3
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +5 -5
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +9 -33
- package/src/screens/AddNewAutoSmart/index.js +33 -89
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectRouterGuide.test.js +1 -1
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +1 -1
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ZigbeeDeviceConnectGuide.test.js +1 -1
- package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +1 -2
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +5 -17
- package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +1 -1
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +3 -3
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +2 -2
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +8 -16
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +10 -12
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +6 -14
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +6 -14
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +1 -1
- package/src/screens/AddNewGateway/hooks/__Tests__/useWifiManage.test.js +3 -2
- package/src/screens/AddNewGateway/index.js +1 -1
- package/src/screens/AllCamera/__test__/index.test.js +18 -57
- package/src/screens/AllCamera/index.js +100 -33
- package/src/screens/AllGateway/DetailConfigActionZigbee/__test__/index.test.js +0 -18
- package/src/screens/AllGateway/DetailConfigActionZigbee/index.js +1 -1
- package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +5 -2
- package/src/screens/AllGateway/hooks/__test__/index.test.js +1 -1
- package/src/screens/Automate/AddNewAction/ChooseAction.js +139 -0
- package/src/screens/Automate/AddNewAction/ChooseConfig.js +179 -0
- package/src/screens/{AddNewAction → Automate/AddNewAction}/Components/LoadingSelectAction.js +1 -1
- package/src/screens/Automate/AddNewAction/Components/SelectDevices.js +75 -0
- package/src/screens/{AddNewAction → Automate/AddNewAction}/Device/DeviceStyles.js +5 -1
- package/src/screens/{AddNewAction → Automate/AddNewAction}/Device/__test__/index.test.js +4 -4
- package/src/screens/{AddNewAction → Automate/AddNewAction}/Device/index.js +5 -4
- package/src/screens/Automate/AddNewAction/NewActionWrapper.js +56 -0
- package/src/screens/Automate/AddNewAction/SelectControlDevices.js +69 -0
- package/src/screens/Automate/AddNewAction/SelectMonitorDevices.js +110 -0
- package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +196 -0
- package/src/screens/{AddNewAction → Automate/AddNewAction}/Styles/SelectActionStyles.js +1 -1
- package/src/screens/{AddNewAction → Automate/AddNewAction}/Styles/SelectSensorDevicesStyles.js +1 -1
- package/src/screens/{AddNewAction → Automate/AddNewAction}/Styles/SetupSensorStyles.js +5 -3
- package/src/screens/{AddNewAction/__test__/SelectAction.test.js → Automate/AddNewAction/__test__/ChooseAction.test.js} +101 -122
- package/src/screens/Automate/AddNewAction/__test__/ChooseConfig.test.js +210 -0
- package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +130 -0
- package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +92 -0
- package/src/screens/Automate/AddNewAction/__test__/SetupSensor.test.js +131 -0
- package/src/screens/Automate/Components/InputName.js +64 -0
- package/src/screens/{AddNewOneTap/AddNewOneTapStyles.js → Automate/Components/InputNameStyles.js} +2 -2
- package/src/screens/{EditActionsList → Automate/EditActionsList}/Styles/indexStyles.js +5 -1
- package/src/screens/{EditActionsList → Automate/EditActionsList}/__tests__/index.test.js +20 -12
- package/src/screens/{EditActionsList → Automate/EditActionsList}/index.js +18 -19
- package/src/screens/Automate/MultiUnits.js +70 -68
- package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +134 -0
- package/src/screens/Automate/OneTap/index.js +16 -0
- package/src/screens/Automate/Scenario/ScenarioName.js +15 -0
- package/src/screens/{AddNewOneTap → Automate/Scenario}/__test__/AddNewOneTap.test.js +27 -45
- package/src/screens/Automate/ScriptDetail/Components/DeleteScript.js +45 -0
- package/src/screens/Automate/ScriptDetail/Components/RenameScript.js +58 -0
- package/src/screens/{ScriptDetail → Automate/ScriptDetail}/Styles/indexStyles.js +1 -1
- package/src/screens/{ScriptDetail → Automate/ScriptDetail}/__test__/index.test.js +67 -76
- package/src/screens/{ScriptDetail → Automate/ScriptDetail}/__test__/useStarredScript.test.js +7 -6
- package/src/screens/{ScriptDetail → Automate/ScriptDetail}/hooks/useStarredScript.js +4 -4
- package/src/screens/Automate/ScriptDetail/index.js +346 -0
- package/src/screens/Automate/ScriptDetail/utils.js +113 -0
- package/src/screens/{SetSchedule → Automate/SetSchedule}/__test__/SelectWeekday.test.js +2 -2
- package/src/screens/{SetSchedule → Automate/SetSchedule}/__test__/index.test.js +21 -46
- package/src/screens/{SetSchedule → Automate/SetSchedule}/components/RepeatOptionsPopup.js +4 -4
- package/src/screens/{SetSchedule → Automate/SetSchedule}/components/RowItem.js +2 -2
- package/src/screens/{SetSchedule → Automate/SetSchedule}/components/SelectWeekday.js +3 -3
- package/src/screens/Automate/SetSchedule/index.js +140 -0
- package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/RepeatOptionsPopupStyles.js +1 -1
- package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/RowItemStyles.js +1 -1
- package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/SelectWeekdayStyles.js +1 -1
- package/src/screens/{SetSchedule → Automate/SetSchedule}/styles/indexStyles.js +1 -1
- package/src/screens/Automate/ValueChange/ValueChangeName.js +16 -0
- package/src/screens/Automate/__test__/MultiUnits.test.js +78 -122
- package/src/screens/Automate/__test__/index.test.js +21 -47
- package/src/screens/Automate/constants.js +0 -0
- package/src/screens/Automate/index.js +18 -24
- package/src/screens/ChangePosition/__test__/index.test.js +75 -0
- package/src/screens/ChangePosition/index.js +112 -0
- package/src/screens/ChangePosition/styles.js +87 -0
- package/src/screens/Device/__test__/DetailHistoryChart.test.js +2 -2
- package/src/screens/Device/__test__/EmergencyCountdown.test.js +4 -2
- package/src/screens/Device/__test__/detail.test.js +202 -257
- package/src/screens/Device/__test__/sensorDisplayItem.test.js +14 -10
- package/src/screens/Device/components/ChartWrapper.js +3 -3
- package/src/screens/Device/components/SensorDisplayItem.js +2 -1
- package/src/screens/Device/components/VisualChart.js +56 -9
- package/src/screens/Device/components/__test__/VisualChart.test.js +1 -1
- package/src/screens/Device/detail.js +14 -0
- package/src/screens/Device/hooks/__test__/useEmergencyButton.test.js +35 -13
- package/src/screens/Device/hooks/useEvaluateValue.js +28 -2
- package/src/screens/Device/styles.js +7 -0
- package/src/screens/DeviceInfo/__test__/index.test.js +16 -18
- package/src/screens/DeviceInfo/index.js +6 -5
- package/src/screens/GuestInfo/components/__test__/AccessScheduleSheet.test.js +52 -0
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +18 -13
- package/src/screens/Notification/__test__/Notification.test.js +64 -73
- package/src/screens/Notification/index.js +14 -14
- package/src/screens/PlayBackCamera/index.js +2 -3
- package/src/screens/SelectUnit/__test__/index.test.js +0 -5
- package/src/screens/SelectUnit/index.js +1 -2
- package/src/screens/SharedUnit/index.js +5 -4
- package/src/screens/Sharing/Components/TitleCheckBox.js +2 -2
- package/src/screens/Sharing/SelectUser.js +2 -2
- package/src/screens/Sharing/__test__/MemberList.test.js +9 -15
- package/src/screens/Sharing/__test__/MemberList2.test.js +10 -16
- package/src/screens/Sharing/__test__/SelectUser.test.js +8 -4
- package/src/screens/SideMenuDetail/SideMenuDetailStyles.js +1 -1
- package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +3 -3
- package/src/screens/SmartAccount/__test__/Connecting.test.js +1 -1
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +3 -3
- package/src/screens/SmartAccount/index.js +1 -0
- package/src/screens/SmartIr/__test__/ButtonsBottom.test.js +1 -1
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +5 -5
- package/src/screens/SmartIr/__test__/SelectBrand.test.js +2 -2
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +2 -2
- package/src/screens/SmartIr/__test__/SmartIr.test.js +2 -2
- package/src/screens/SubUnit/ManageSubUnit.js +4 -4
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +9 -28
- package/src/screens/TDSGuide/index.js +1 -1
- package/src/screens/Template/GatewayList.js +4 -1
- package/src/screens/Template/__test__/detail.test.js +24 -22
- package/src/screens/Template/detail.js +1 -0
- package/src/screens/UVIndexGuide/index.js +2 -2
- package/src/screens/Unit/Detail.js +6 -5
- package/src/screens/Unit/SelectAddToFavorites.js +1 -1
- package/src/screens/Unit/__test__/ChooseLocation.test.js +8 -13
- package/src/screens/Unit/__test__/Detail.test.js +10 -14
- package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +1 -1
- package/src/screens/Unit/__test__/SmartAccount.test.js +8 -14
- package/src/screens/Unit/components/__test__/Header.test.js +4 -4
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +1 -1
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +14 -6
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +1 -1
- package/src/screens/UnitSummary/components/Temperature/index.js +2 -2
- package/src/screens/UnitSummary/components/UvIndex/__test__/index.test.js +4 -0
- package/src/screens/UnitSummary/components/UvIndex/index.js +2 -2
- package/src/screens/UnitSummary/components/WaterQuality/__test__/index.test.js +6 -11
- package/src/screens/UnitSummary/components/WaterQuality/index.js +2 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +1 -1
- package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +1 -1
- package/src/screens/UnitSummary/components/__test__/index.test.js +2 -2
- package/src/screens/WaterQualityGuide/index.js +10 -5
- package/src/utils/Apis/axios.js +3 -0
- package/src/utils/I18n/translations/en.json +24 -18
- package/src/utils/I18n/translations/vi.json +22 -18
- package/src/utils/Route/index.js +9 -3
- package/src/utils/Utils.js +29 -0
- package/src/utils/__test__/Utils.test.js +6 -0
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +0 -130
- package/src/commons/ActionGroup/__test__/CurtainButtonTemplate.test.js +0 -109
- package/src/commons/Auth/SocialButton.js +0 -54
- package/src/commons/Auth/__test__/SocialButton.test.js +0 -44
- package/src/commons/Sharing/__test__/StationDevicePermission.test.js +0 -85
- package/src/hooks/__test__/useInitDeepLink.test.js +0 -28
- package/src/hooks/useInitDeepLink.js +0 -25
- package/src/screens/AddNewAction/SelectAction.js +0 -570
- package/src/screens/AddNewAction/SelectSensorDevices.js +0 -236
- package/src/screens/AddNewAction/SetupSensor.js +0 -263
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +0 -181
- package/src/screens/AddNewAction/__test__/SetupSensor.test.js +0 -114
- package/src/screens/AddNewOneTap/index.js +0 -147
- package/src/screens/ScriptDetail/hooks/index.js +0 -136
- package/src/screens/ScriptDetail/index.js +0 -525
- package/src/screens/SetSchedule/index.js +0 -200
- /package/src/screens/{AddNewAction → Automate/AddNewAction}/Components/index.js +0 -0
- /package/src/screens/{AddNewAction → Automate/AddNewAction}/__test__/LoadingSelectAction.test.js +0 -0
|
@@ -1,525 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useCallback,
|
|
3
|
-
useMemo,
|
|
4
|
-
useState,
|
|
5
|
-
useRef,
|
|
6
|
-
useEffect,
|
|
7
|
-
memo,
|
|
8
|
-
} from 'react';
|
|
9
|
-
import { View, TouchableOpacity, Image } from 'react-native';
|
|
10
|
-
import { IconFill, IconOutline } from '@ant-design/icons-react-native';
|
|
11
|
-
import { Icon } from '@ant-design/react-native';
|
|
12
|
-
|
|
13
|
-
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
14
|
-
import styles from './Styles/indexStyles';
|
|
15
|
-
import Text from '../../commons/Text';
|
|
16
|
-
import AlertAction from '../../commons/AlertAction';
|
|
17
|
-
import _TextInput from '../../commons/Form/TextInput';
|
|
18
|
-
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
19
|
-
import { API, Colors, Images } from '../../configs';
|
|
20
|
-
import { usePopover } from '../../hooks/Common';
|
|
21
|
-
import { useStateAlertAction } from './hooks';
|
|
22
|
-
import { useStarredScript } from './hooks/useStarredScript';
|
|
23
|
-
import MenuActionMore from '../../commons/MenuActionMore';
|
|
24
|
-
import Add from '../../../assets/images/Add.svg';
|
|
25
|
-
import { useNavigation } from '@react-navigation/native';
|
|
26
|
-
import {
|
|
27
|
-
axiosGet,
|
|
28
|
-
axiosPost,
|
|
29
|
-
axiosDelete,
|
|
30
|
-
axiosPatch,
|
|
31
|
-
} from '../../utils/Apis/axios';
|
|
32
|
-
import FImage from '../../commons/FImage';
|
|
33
|
-
import Routes from '../../utils/Route';
|
|
34
|
-
import { ToastBottomHelper } from '../../utils/Utils';
|
|
35
|
-
import ItemAutomate from '../../commons/Automate/ItemAutomate';
|
|
36
|
-
import withPreventDoubleClick from '../../commons/WithPreventDoubleClick';
|
|
37
|
-
import {
|
|
38
|
-
AUTOMATE_SELECT,
|
|
39
|
-
AUTOMATE_TYPE,
|
|
40
|
-
STATE_VALUE_SENSOR_TYPES,
|
|
41
|
-
} from '../../configs/Constants';
|
|
42
|
-
import { popAction } from '../../navigations/utils';
|
|
43
|
-
import { AccessibilityLabel } from '../../configs/Constants';
|
|
44
|
-
import useKeyboardAnimated from '../../hooks/Explore/useKeyboardAnimated';
|
|
45
|
-
import { REPEAT_OPTIONS } from '../SetSchedule/components/RepeatOptionsPopup';
|
|
46
|
-
import { useSCContextSelector } from '../../context';
|
|
47
|
-
|
|
48
|
-
const PreventDoubleTouch = withPreventDoubleClick(TouchableOpacity);
|
|
49
|
-
|
|
50
|
-
const ScriptDetail = ({ route }) => {
|
|
51
|
-
const { navigate, goBack, dispatch } = useNavigation();
|
|
52
|
-
const { params = {} } = route;
|
|
53
|
-
const refMenuAction = useRef();
|
|
54
|
-
const { childRef, showingPopover, showPopoverWithRef, hidePopover } =
|
|
55
|
-
usePopover();
|
|
56
|
-
const t = useTranslations();
|
|
57
|
-
const {
|
|
58
|
-
id,
|
|
59
|
-
automate = {},
|
|
60
|
-
name = '',
|
|
61
|
-
type,
|
|
62
|
-
havePermission,
|
|
63
|
-
unit,
|
|
64
|
-
saveAt,
|
|
65
|
-
isCreateScriptSuccess,
|
|
66
|
-
isAutomateTab,
|
|
67
|
-
isCreateNewAction,
|
|
68
|
-
isMultiUnits,
|
|
69
|
-
} = params;
|
|
70
|
-
const [scriptName, setScriptName] = useState(name);
|
|
71
|
-
const [inputName, setInputName] = useState(name);
|
|
72
|
-
const [
|
|
73
|
-
stateAlertAction,
|
|
74
|
-
hideAlertAction,
|
|
75
|
-
onShowRename,
|
|
76
|
-
onShowActivityLog,
|
|
77
|
-
onShowDelete,
|
|
78
|
-
] = useStateAlertAction();
|
|
79
|
-
const [data, setData] = useState([]);
|
|
80
|
-
|
|
81
|
-
const { isStarred, starScript, unstarScript } = useStarredScript(automate);
|
|
82
|
-
const popoverAnimating = useSCContextSelector(
|
|
83
|
-
(state) => state.app.popoverAnimating
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const transY = useKeyboardAnimated();
|
|
87
|
-
|
|
88
|
-
const renameScript = useCallback(async () => {
|
|
89
|
-
const { success, data: script } = await axiosPatch(
|
|
90
|
-
API.AUTOMATE.SCRIPT(id),
|
|
91
|
-
{
|
|
92
|
-
name: inputName,
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
if (success) {
|
|
96
|
-
setScriptName(script.name);
|
|
97
|
-
ToastBottomHelper.success(t('rename_successfully'));
|
|
98
|
-
} else {
|
|
99
|
-
ToastBottomHelper.error(t('rename_failed'));
|
|
100
|
-
}
|
|
101
|
-
hideAlertAction();
|
|
102
|
-
}, [id, inputName, hideAlertAction, t]);
|
|
103
|
-
|
|
104
|
-
const deleteScript = useCallback(async () => {
|
|
105
|
-
hideAlertAction();
|
|
106
|
-
const { success } = await axiosDelete(API.AUTOMATE.SCRIPT(id));
|
|
107
|
-
if (success) {
|
|
108
|
-
if (isCreateScriptSuccess || isCreateNewAction) {
|
|
109
|
-
dispatch(popAction(5));
|
|
110
|
-
isAutomateTab && goBack();
|
|
111
|
-
} else {
|
|
112
|
-
goBack();
|
|
113
|
-
}
|
|
114
|
-
ToastBottomHelper.success(t('removed_successfully'));
|
|
115
|
-
} else {
|
|
116
|
-
ToastBottomHelper.error(t('remove_failed'));
|
|
117
|
-
}
|
|
118
|
-
}, [
|
|
119
|
-
hideAlertAction,
|
|
120
|
-
id,
|
|
121
|
-
isCreateScriptSuccess,
|
|
122
|
-
isCreateNewAction,
|
|
123
|
-
t,
|
|
124
|
-
dispatch,
|
|
125
|
-
isAutomateTab,
|
|
126
|
-
goBack,
|
|
127
|
-
]);
|
|
128
|
-
|
|
129
|
-
const handleRenameOrDelete = useCallback(async () => {
|
|
130
|
-
if (stateAlertAction.isDelete) {
|
|
131
|
-
deleteScript();
|
|
132
|
-
} else {
|
|
133
|
-
renameScript();
|
|
134
|
-
}
|
|
135
|
-
}, [stateAlertAction.isDelete, deleteScript, renameScript]);
|
|
136
|
-
|
|
137
|
-
const onPressStar = useCallback(() => {
|
|
138
|
-
if (isStarred) {
|
|
139
|
-
unstarScript();
|
|
140
|
-
} else {
|
|
141
|
-
starScript();
|
|
142
|
-
}
|
|
143
|
-
}, [isStarred, starScript, unstarScript]);
|
|
144
|
-
|
|
145
|
-
const listMenuItem = useMemo(
|
|
146
|
-
() => [
|
|
147
|
-
{ text: t('rename'), doAction: onShowRename(havePermission) },
|
|
148
|
-
{
|
|
149
|
-
text: isStarred ? t('remove_favorite') : t('add_favorite'),
|
|
150
|
-
doAction: isStarred ? unstarScript : starScript,
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
text: t('activity_log'),
|
|
154
|
-
doAction: onShowActivityLog(havePermission, id, type, unit),
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
text: t('delete_script'),
|
|
158
|
-
doAction: onShowDelete(scriptName, havePermission),
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
[
|
|
162
|
-
t,
|
|
163
|
-
onShowRename,
|
|
164
|
-
havePermission,
|
|
165
|
-
onShowActivityLog,
|
|
166
|
-
id,
|
|
167
|
-
type,
|
|
168
|
-
unit,
|
|
169
|
-
onShowDelete,
|
|
170
|
-
scriptName,
|
|
171
|
-
isStarred,
|
|
172
|
-
starScript,
|
|
173
|
-
unstarScript,
|
|
174
|
-
]
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
const handleShowMenuAction = useCallback(
|
|
178
|
-
() => showPopoverWithRef(refMenuAction),
|
|
179
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
180
|
-
[]
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
const onItemClick = useCallback((item) => {
|
|
184
|
-
item.doAction();
|
|
185
|
-
}, []);
|
|
186
|
-
|
|
187
|
-
const getScriptDetail = useCallback(async () => {
|
|
188
|
-
const { success, data: automateData } = await axiosGet(
|
|
189
|
-
API.AUTOMATE.SCRIPT(id)
|
|
190
|
-
);
|
|
191
|
-
success && setData(automateData?.script_actions || []);
|
|
192
|
-
}, [id]);
|
|
193
|
-
|
|
194
|
-
const onPressEdit = useCallback(() => {
|
|
195
|
-
navigate(Routes.EditActionsList, { data, id, setData, unit });
|
|
196
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
197
|
-
}, [data]);
|
|
198
|
-
|
|
199
|
-
const onPressAddAction = useCallback(() => {
|
|
200
|
-
const navParams = {
|
|
201
|
-
unit,
|
|
202
|
-
scriptName,
|
|
203
|
-
automateId: id,
|
|
204
|
-
type,
|
|
205
|
-
oldType: type,
|
|
206
|
-
isCreateNewAction: true,
|
|
207
|
-
title: AUTOMATE_SELECT.SELECT_DEVICE,
|
|
208
|
-
automate,
|
|
209
|
-
};
|
|
210
|
-
navigate(
|
|
211
|
-
isMultiUnits ? Routes.SelectUnit : Routes.SelectSensorDevices,
|
|
212
|
-
navParams
|
|
213
|
-
);
|
|
214
|
-
}, [unit, scriptName, id, type, navigate, isMultiUnits, automate]);
|
|
215
|
-
|
|
216
|
-
const handleScriptAction = useCallback(async () => {
|
|
217
|
-
const { success } = await axiosPost(API.AUTOMATE.ACTION_ONE_TAP(id));
|
|
218
|
-
if (success) {
|
|
219
|
-
ToastBottomHelper.success(t('Activated successfully.'));
|
|
220
|
-
} else {
|
|
221
|
-
ToastBottomHelper.error(t('Activation failed.'));
|
|
222
|
-
}
|
|
223
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
224
|
-
}, [id]);
|
|
225
|
-
|
|
226
|
-
const handleUpdateAutomate = useCallback(async () => {
|
|
227
|
-
navigate(Routes.AddNewAutoSmart, {
|
|
228
|
-
type,
|
|
229
|
-
automate,
|
|
230
|
-
unit,
|
|
231
|
-
isAutomateTab,
|
|
232
|
-
isMultiUnits,
|
|
233
|
-
scriptName: name,
|
|
234
|
-
});
|
|
235
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
236
|
-
}, [name, automate]);
|
|
237
|
-
|
|
238
|
-
const onGoBack = useCallback(() => {
|
|
239
|
-
goBack();
|
|
240
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
241
|
-
}, [isCreateScriptSuccess]);
|
|
242
|
-
|
|
243
|
-
const Item = useCallback(({ item, index }) => {
|
|
244
|
-
return (
|
|
245
|
-
<View style={styles.wrapItem}>
|
|
246
|
-
<View style={styles.leftItem}>
|
|
247
|
-
<Text color={Colors.Gray9} type="H4" semibold>
|
|
248
|
-
{index + 1 < 10 ? '0' + (index + 1) : index + 1}
|
|
249
|
-
</Text>
|
|
250
|
-
</View>
|
|
251
|
-
<View style={styles.rightItem}>
|
|
252
|
-
<FImage
|
|
253
|
-
source={{ uri: item?.sensor_icon_kit }}
|
|
254
|
-
style={styles.iconItem}
|
|
255
|
-
/>
|
|
256
|
-
<View style={styles.contentItem}>
|
|
257
|
-
<View style={styles.titleItem}>
|
|
258
|
-
<Text
|
|
259
|
-
numberOfLines={1}
|
|
260
|
-
semibold
|
|
261
|
-
type="Label"
|
|
262
|
-
color={Colors.Gray7}
|
|
263
|
-
style={styles.paddingRight4}
|
|
264
|
-
>
|
|
265
|
-
{item?.unit_name}
|
|
266
|
-
</Text>
|
|
267
|
-
<Text
|
|
268
|
-
numberOfLines={1}
|
|
269
|
-
type="Label"
|
|
270
|
-
color={Colors.Gray7}
|
|
271
|
-
style={styles.flex1}
|
|
272
|
-
>
|
|
273
|
-
{item?.station_name}
|
|
274
|
-
</Text>
|
|
275
|
-
</View>
|
|
276
|
-
<Text numberOfLines={1} type="H4" color={Colors.Gray9} semibold>
|
|
277
|
-
{item?.sensor_name}
|
|
278
|
-
</Text>
|
|
279
|
-
<Text numberOfLines={1} type="H4" color={Colors.Gray9}>
|
|
280
|
-
{item?.action_name}
|
|
281
|
-
</Text>
|
|
282
|
-
</View>
|
|
283
|
-
</View>
|
|
284
|
-
</View>
|
|
285
|
-
);
|
|
286
|
-
}, []);
|
|
287
|
-
|
|
288
|
-
const ItemAdd = useCallback(
|
|
289
|
-
({ item, index }) => {
|
|
290
|
-
return (
|
|
291
|
-
<View style={styles.wrapItem}>
|
|
292
|
-
<View style={styles.leftItemAdd}>
|
|
293
|
-
<Text style={styles.number} type="H4" semibold color={Colors.Gray7}>
|
|
294
|
-
{index + 1 < 10 ? '0' + (index + 1) : index + 1}
|
|
295
|
-
</Text>
|
|
296
|
-
</View>
|
|
297
|
-
<TouchableOpacity
|
|
298
|
-
onPress={onPressAddAction}
|
|
299
|
-
style={[styles.rightItemAdd]}
|
|
300
|
-
accessibilityLabel={AccessibilityLabel.BUTTON_ADD_SCRIPT_ACTION}
|
|
301
|
-
>
|
|
302
|
-
<Add />
|
|
303
|
-
<Text type="H4" color={Colors.Gray8} style={styles.addAction}>
|
|
304
|
-
{t('add_action')}
|
|
305
|
-
</Text>
|
|
306
|
-
</TouchableOpacity>
|
|
307
|
-
</View>
|
|
308
|
-
);
|
|
309
|
-
},
|
|
310
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
311
|
-
[scriptName]
|
|
312
|
-
);
|
|
313
|
-
|
|
314
|
-
const renderButtonStar = useMemo(() => {
|
|
315
|
-
return (
|
|
316
|
-
<PreventDoubleTouch
|
|
317
|
-
style={[styles.buttonStar, styles.headerButton]}
|
|
318
|
-
onPress={onPressStar}
|
|
319
|
-
accessibilityLabel={AccessibilityLabel.HEADER_SCRIPT_DETAIL_BUTTON_STAR}
|
|
320
|
-
>
|
|
321
|
-
{isStarred ? (
|
|
322
|
-
<IconFill name="star" size={25} color={Colors.Yellow6} />
|
|
323
|
-
) : (
|
|
324
|
-
<IconOutline name="star" size={25} />
|
|
325
|
-
)}
|
|
326
|
-
</PreventDoubleTouch>
|
|
327
|
-
);
|
|
328
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
329
|
-
}, [isStarred]);
|
|
330
|
-
|
|
331
|
-
const rightComponent = useMemo(
|
|
332
|
-
() => (
|
|
333
|
-
<View style={styles.rightComponent}>
|
|
334
|
-
{renderButtonStar}
|
|
335
|
-
<TouchableOpacity
|
|
336
|
-
onPress={handleShowMenuAction}
|
|
337
|
-
ref={refMenuAction}
|
|
338
|
-
style={[styles.headerButton, styles.moreButton]}
|
|
339
|
-
>
|
|
340
|
-
<Icon name={'more'} size={27} color={Colors.Black} />
|
|
341
|
-
</TouchableOpacity>
|
|
342
|
-
</View>
|
|
343
|
-
),
|
|
344
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
345
|
-
[isStarred]
|
|
346
|
-
);
|
|
347
|
-
|
|
348
|
-
useEffect(() => {
|
|
349
|
-
setScriptName(name);
|
|
350
|
-
}, [name]);
|
|
351
|
-
|
|
352
|
-
useEffect(() => {
|
|
353
|
-
getScriptDetail();
|
|
354
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
355
|
-
}, [id, saveAt]);
|
|
356
|
-
|
|
357
|
-
const isHaveScriptActions = data?.length > 0;
|
|
358
|
-
|
|
359
|
-
const textCondition = useMemo(() => {
|
|
360
|
-
if (
|
|
361
|
-
[AUTOMATE_TYPE.VALUE_CHANGE, AUTOMATE_TYPE.EVENT_SENSOR].includes(type)
|
|
362
|
-
) {
|
|
363
|
-
const { condition, config_name, value, sensor_type } =
|
|
364
|
-
automate?.value_change || automate?.event_sensor;
|
|
365
|
-
const stateConditionData = STATE_VALUE_SENSOR_TYPES.find(
|
|
366
|
-
(i) => i.type === sensor_type
|
|
367
|
-
);
|
|
368
|
-
const isNumberValue = !stateConditionData;
|
|
369
|
-
|
|
370
|
-
let text;
|
|
371
|
-
if (condition === '>') {
|
|
372
|
-
text = 'higher_than';
|
|
373
|
-
} else if (condition === '<') {
|
|
374
|
-
text = 'lower_than';
|
|
375
|
-
} else if (condition === '=') {
|
|
376
|
-
text = isNumberValue ? 'equal' : stateConditionData?.stateValue[value];
|
|
377
|
-
}
|
|
378
|
-
return `${config_name} ${t(text)} ${isNumberValue ? value : ''}`;
|
|
379
|
-
} else if (type === AUTOMATE_TYPE.SCHEDULE) {
|
|
380
|
-
const { repeat, time_repeat, date_repeat, weekday_repeat } =
|
|
381
|
-
automate?.schedule;
|
|
382
|
-
const time =
|
|
383
|
-
time_repeat?.length >= 8
|
|
384
|
-
? time_repeat.substring(0, time_repeat?.length - 3)
|
|
385
|
-
: time_repeat;
|
|
386
|
-
const date = date_repeat?.split('-').reverse().join('/');
|
|
387
|
-
const weekday = {
|
|
388
|
-
1: t('mon'),
|
|
389
|
-
2: t('tue'),
|
|
390
|
-
3: t('wed'),
|
|
391
|
-
4: t('thu'),
|
|
392
|
-
5: t('fri'),
|
|
393
|
-
6: t('sat'),
|
|
394
|
-
0: t('sun'),
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
if (repeat === REPEAT_OPTIONS.ONCE) {
|
|
398
|
-
return `${time} ${date}`;
|
|
399
|
-
} else if (repeat === REPEAT_OPTIONS.EVERYDAY) {
|
|
400
|
-
return `${t('every_day_at', { time })}`;
|
|
401
|
-
} else if (repeat === REPEAT_OPTIONS.EVERYWEEK) {
|
|
402
|
-
//sort 0 is last number, exp: [1,3,5,0]
|
|
403
|
-
const newWeekdayRepeat = weekday_repeat.map((item) =>
|
|
404
|
-
parseInt(item, 10)
|
|
405
|
-
);
|
|
406
|
-
const sortWeekday = newWeekdayRepeat.sort((a, b) => {
|
|
407
|
-
if (a !== 0 && b === 0) {
|
|
408
|
-
return -1;
|
|
409
|
-
}
|
|
410
|
-
if (a === 0 && b !== 0) {
|
|
411
|
-
return 1;
|
|
412
|
-
}
|
|
413
|
-
return a - b;
|
|
414
|
-
});
|
|
415
|
-
const textWeekday = sortWeekday.map((item) => weekday[item]).join(', ');
|
|
416
|
-
return `${textWeekday} ${t('at')} ${time}`;
|
|
417
|
-
}
|
|
418
|
-
} else if (
|
|
419
|
-
[AUTOMATE_TYPE.EVENT, AUTOMATE_TYPE.EVENT_ACTION].includes(type)
|
|
420
|
-
) {
|
|
421
|
-
const { action, end_device_name, config_name, sensor_type, value } =
|
|
422
|
-
automate?.event || automate?.event_action || automate?.event_sensor;
|
|
423
|
-
let textEvent = '';
|
|
424
|
-
if (config_name) {
|
|
425
|
-
const stateConditionData = STATE_VALUE_SENSOR_TYPES.find(
|
|
426
|
-
(i) => i.type === sensor_type
|
|
427
|
-
);
|
|
428
|
-
textEvent = `${config_name} - ${t(
|
|
429
|
-
stateConditionData.stateValue[value]
|
|
430
|
-
)}`;
|
|
431
|
-
} else {
|
|
432
|
-
textEvent = `${end_device_name} - ${action}`;
|
|
433
|
-
}
|
|
434
|
-
return textEvent;
|
|
435
|
-
}
|
|
436
|
-
return null;
|
|
437
|
-
}, [t, automate, type]);
|
|
438
|
-
|
|
439
|
-
return (
|
|
440
|
-
<View style={styles.wrap}>
|
|
441
|
-
<WrapHeaderScrollable
|
|
442
|
-
title={scriptName}
|
|
443
|
-
headerAniStyle={styles.headerAniStyle}
|
|
444
|
-
rightComponent={rightComponent}
|
|
445
|
-
onGoBack={onGoBack}
|
|
446
|
-
>
|
|
447
|
-
<View style={styles.wrapContent}>
|
|
448
|
-
<Text type="H3" semibold>
|
|
449
|
-
{t('how_to_start')}
|
|
450
|
-
</Text>
|
|
451
|
-
<ItemAutomate
|
|
452
|
-
type={type}
|
|
453
|
-
onPress={handleUpdateAutomate}
|
|
454
|
-
disabledOnPress={!havePermission}
|
|
455
|
-
textCondition={textCondition}
|
|
456
|
-
/>
|
|
457
|
-
{type === AUTOMATE_TYPE.ONE_TAP && (
|
|
458
|
-
<TouchableOpacity
|
|
459
|
-
onPress={handleScriptAction}
|
|
460
|
-
style={styles.activeButton}
|
|
461
|
-
accessibilityLabel={AccessibilityLabel.BUTTON_ACTIVATE_ONE_TAP}
|
|
462
|
-
>
|
|
463
|
-
<Image source={Images.activeButton} />
|
|
464
|
-
</TouchableOpacity>
|
|
465
|
-
)}
|
|
466
|
-
|
|
467
|
-
<View style={styles.row}>
|
|
468
|
-
<Text type="H3" color={Colors.Gray9} semibold>
|
|
469
|
-
{t('active_list')}
|
|
470
|
-
</Text>
|
|
471
|
-
{havePermission && isHaveScriptActions && (
|
|
472
|
-
<TouchableOpacity
|
|
473
|
-
onPress={onPressEdit}
|
|
474
|
-
style={styles.editButton}
|
|
475
|
-
accessibilityLabel={
|
|
476
|
-
AccessibilityLabel.BUTTON_EDIT_SCRIPT_ACTION
|
|
477
|
-
}
|
|
478
|
-
>
|
|
479
|
-
<Text type="Label" hilight>
|
|
480
|
-
{t('edit')}
|
|
481
|
-
</Text>
|
|
482
|
-
</TouchableOpacity>
|
|
483
|
-
)}
|
|
484
|
-
</View>
|
|
485
|
-
{data.map((item, index) => (
|
|
486
|
-
<Item key={item?.id} item={item} index={index} />
|
|
487
|
-
))}
|
|
488
|
-
{havePermission && <ItemAdd index={data.length} />}
|
|
489
|
-
</View>
|
|
490
|
-
</WrapHeaderScrollable>
|
|
491
|
-
<MenuActionMore
|
|
492
|
-
isVisible={showingPopover}
|
|
493
|
-
hideMore={hidePopover}
|
|
494
|
-
listMenuItem={listMenuItem}
|
|
495
|
-
childRef={childRef}
|
|
496
|
-
onItemClick={onItemClick}
|
|
497
|
-
isTextCenter={false}
|
|
498
|
-
wrapStyle={styles.wrapStyle}
|
|
499
|
-
/>
|
|
500
|
-
<AlertAction
|
|
501
|
-
visible={stateAlertAction.visible && !popoverAnimating}
|
|
502
|
-
hideModal={hideAlertAction}
|
|
503
|
-
title={stateAlertAction.title}
|
|
504
|
-
message={stateAlertAction.message}
|
|
505
|
-
leftButtonTitle={stateAlertAction.leftButton}
|
|
506
|
-
leftButtonClick={hideAlertAction}
|
|
507
|
-
rightButtonTitle={stateAlertAction.rightButton}
|
|
508
|
-
rightButtonClick={handleRenameOrDelete}
|
|
509
|
-
rightButtonStyle={{ color: stateAlertAction.rightColor }}
|
|
510
|
-
transY={transY}
|
|
511
|
-
>
|
|
512
|
-
{!stateAlertAction.isDelete && havePermission && (
|
|
513
|
-
<_TextInput
|
|
514
|
-
onChange={(text) => setInputName(text)}
|
|
515
|
-
defaultValue={scriptName}
|
|
516
|
-
textInputStyle={styles.textInput}
|
|
517
|
-
maxLength={64}
|
|
518
|
-
/>
|
|
519
|
-
)}
|
|
520
|
-
</AlertAction>
|
|
521
|
-
</View>
|
|
522
|
-
);
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
export default memo(ScriptDetail);
|