@ledvance/group-ui-biz-bundle 1.0.37 → 1.0.39
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/modules/biorhythm/BiorhythmActions.ts +216 -0
- package/src/modules/biorhythm/BiorhythmBean.ts +230 -0
- package/src/modules/biorhythm/BiorhythmDetailPage.tsx +261 -0
- package/src/modules/biorhythm/BiorhythmPage.tsx +706 -0
- package/src/modules/biorhythm/IconSelect.tsx +84 -0
- package/src/modules/biorhythm/circular/ItemIcon.d.ts +22 -0
- package/src/modules/biorhythm/circular/ItemIcon.tsx +173 -0
- package/src/modules/biorhythm/circular/Progress.d.ts +24 -0
- package/src/modules/biorhythm/circular/Progress.tsx +412 -0
- package/src/modules/biorhythm/circular/TimeCircular.d.ts +11 -0
- package/src/modules/biorhythm/circular/TimeCircular.tsx +70 -0
- package/src/modules/biorhythm/circular/biorhythm_plantimer.png +0 -0
- package/src/modules/biorhythm/circular/rhythm_icon.png +0 -0
- package/src/modules/biorhythm/iconListData.ts +30 -0
- package/src/modules/biorhythm/pIdList.ts +36 -0
- package/src/modules/biorhythm/res/BiologicalRes.d.ts +43 -0
- package/src/modules/biorhythm/res/BiologicalRes.ts +42 -0
- package/src/modules/biorhythm/res/Biological_Rhythm.png +0 -0
- package/src/modules/biorhythm/res/Biological_Rhythm_12.png +0 -0
- package/src/modules/biorhythm/res/Biological_Rhythm_new.png +0 -0
- package/src/modules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
- package/src/modules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
- package/src/modules/music/MusicActions.ts +61 -0
- package/src/modules/music/MusicDataBean.ts +292 -0
- package/src/modules/music/MusicManager.ts +206 -0
- package/src/modules/music/MusicPage.tsx +206 -0
- package/src/modules/music/res/app_music_ball@2x.png +0 -0
- package/src/modules/music/res/app_music_ball@3x.png +0 -0
- package/src/modules/music/res/app_music_game@2x.png +0 -0
- package/src/modules/music/res/app_music_game@3x.png +0 -0
- package/src/modules/music/res/app_music_music@2x.png +0 -0
- package/src/modules/music/res/app_music_music@3x.png +0 -0
- package/src/modules/music/res/app_music_romantic@2x.png +0 -0
- package/src/modules/music/res/app_music_romantic@3x.png +0 -0
- package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck.png +0 -0
- package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck@2x.png +0 -0
- package/src/modules/music/res/iconsMaterialOutlinedArrowsNavCheck@3x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic@2x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusic@3x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusicDisabled.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusicDisabled@2x.png +0 -0
- package/src/modules/music/res/illustrationsFeaturesMusicDisabled@3x.png +0 -0
- package/src/modules/music/res/index.d.ts +10 -0
- package/src/modules/music/res/index.ts +9 -0
- package/src/navigation/Routers.ts +46 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import React, { useCallback } from 'react'
|
|
2
|
+
import { Image, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
|
|
3
|
+
import { useNavigation } from '@react-navigation/native'
|
|
4
|
+
import { TimerPicker, Utils } from 'tuya-panel-kit'
|
|
5
|
+
import { useReactive } from 'ahooks'
|
|
6
|
+
import { colorTemperatureValue, Plan } from './BiorhythmBean'
|
|
7
|
+
import iconList from './iconListData'
|
|
8
|
+
import I18n from '@ledvance/base/src/i18n'
|
|
9
|
+
import TextField from '@ledvance/base/src/components/TextField'
|
|
10
|
+
import BiologicalRes from './res/BiologicalRes'
|
|
11
|
+
import { cctToColor } from '@ledvance/base/src/utils/cctUtils'
|
|
12
|
+
import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView'
|
|
13
|
+
import DeleteButton from '@ledvance/base/src/components/DeleteButton'
|
|
14
|
+
import res from '@ledvance/base/src/res'
|
|
15
|
+
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
16
|
+
import { cloneDeep, delay, isEqual } from 'lodash'
|
|
17
|
+
import { showDialog } from '@ledvance/base/src/utils/common'
|
|
18
|
+
import Page from '@ledvance/base/src/components/Page'
|
|
19
|
+
import { useParams } from '@ledvance/base/src/hooks/Hooks'
|
|
20
|
+
import Card from '@ledvance/base/src/components/Card'
|
|
21
|
+
import { useSystemTimeFormate } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
22
|
+
import Spacer from '@ledvance/base/src/components/Spacer'
|
|
23
|
+
|
|
24
|
+
const cx = Utils.RatioUtils.convertX
|
|
25
|
+
|
|
26
|
+
export interface BiorhythmEditPageParams {
|
|
27
|
+
planData: Plan
|
|
28
|
+
isAdd: boolean
|
|
29
|
+
onPlanEdited: (isAdd: boolean, plan: Plan) => void
|
|
30
|
+
onPlanDelete: (id: number) => void
|
|
31
|
+
minimumEnable: (plan: Plan) => boolean
|
|
32
|
+
iconIdList?: any
|
|
33
|
+
isMixLight: boolean
|
|
34
|
+
isSupportTemperature: boolean
|
|
35
|
+
isSupportBrightness: boolean
|
|
36
|
+
showDeleteBtn?: boolean
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const BiorhythmEditPage = () => {
|
|
40
|
+
const navigation = useNavigation()
|
|
41
|
+
const is24Hour = useSystemTimeFormate()
|
|
42
|
+
const params = useParams<BiorhythmEditPageParams>()
|
|
43
|
+
const {
|
|
44
|
+
planData,
|
|
45
|
+
isAdd,
|
|
46
|
+
onPlanEdited,
|
|
47
|
+
onPlanDelete,
|
|
48
|
+
minimumEnable,
|
|
49
|
+
iconIdList,
|
|
50
|
+
isMixLight,
|
|
51
|
+
isSupportTemperature,
|
|
52
|
+
isSupportBrightness,
|
|
53
|
+
showDeleteBtn
|
|
54
|
+
} = params
|
|
55
|
+
const [hour, minute] = planData.startTime.split(':')
|
|
56
|
+
const state = useReactive({
|
|
57
|
+
hour: Number(hour),
|
|
58
|
+
minute: Number(minute),
|
|
59
|
+
iconIdList,
|
|
60
|
+
planData: cloneDeep(planData),
|
|
61
|
+
backStatus: false,
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const onTopBarRightBtnClick = useCallback(() => {
|
|
65
|
+
if (!saveEnable() || minimumTipEnable()) return
|
|
66
|
+
state.backStatus = true
|
|
67
|
+
onPlanEdited(isAdd, {
|
|
68
|
+
...state.planData,
|
|
69
|
+
icon: iconList?.find(val => val?.id === state.planData.iconId)?.icon || '',
|
|
70
|
+
})
|
|
71
|
+
navigation.goBack()
|
|
72
|
+
}, [])
|
|
73
|
+
|
|
74
|
+
const onDeleteBtnClick = useCallback(() => {
|
|
75
|
+
onPlanDelete(state.planData.id)
|
|
76
|
+
delay(() => {
|
|
77
|
+
navigation.goBack()
|
|
78
|
+
}, 300)
|
|
79
|
+
}, [])
|
|
80
|
+
|
|
81
|
+
const saveEnable = () => {
|
|
82
|
+
return state.planData.name.length > 0 && state.planData.name.length < 33 && !isEqual(state.planData, planData)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const minimumTipEnable = () => {
|
|
86
|
+
const enable = minimumEnable(state.planData)
|
|
87
|
+
return enable
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const setImg = () => {
|
|
91
|
+
const imgIcon = iconList?.find(val => val?.id === state.planData.iconId)?.icon || ''
|
|
92
|
+
return imgIcon
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<Page
|
|
97
|
+
backText={I18n.getLang('add_new_trigger_time_system_back_text')}
|
|
98
|
+
headlineText={I18n.getLang(isAdd ? 'add_new_trigger_time_headline_text' : 'edit_trigger_time_headline_text')}
|
|
99
|
+
backDialogTitle={I18n.getLang('manage_user_unsaved_changes_dialog_headline')}
|
|
100
|
+
backDialogContent={I18n.getLang('cancel_dialog_leave_unsaved_bio_rhythm_note')}
|
|
101
|
+
showBackDialog={saveEnable() && !minimumTipEnable()}
|
|
102
|
+
rightButtonIcon={(saveEnable() && !minimumTipEnable()) ? res.ic_check : res.ic_uncheck}
|
|
103
|
+
rightButtonIconClick={onTopBarRightBtnClick}
|
|
104
|
+
>
|
|
105
|
+
<ScrollView>
|
|
106
|
+
<View
|
|
107
|
+
style={{
|
|
108
|
+
marginHorizontal: cx(24),
|
|
109
|
+
backgroundColor: '#fff',
|
|
110
|
+
}}>
|
|
111
|
+
<View style={{ height: cx(20) }} />
|
|
112
|
+
<TextField
|
|
113
|
+
value={state.planData.name}
|
|
114
|
+
showError={state.planData.name?.length > 32}
|
|
115
|
+
maxLength={33}
|
|
116
|
+
errorText={I18n.getLang('add_new_dynamic_mood_alert_text')}
|
|
117
|
+
placeholder={I18n.getLang('add_new_trigger_time_inputfield_value_text')}
|
|
118
|
+
onChangeText={text => {
|
|
119
|
+
state.planData.name = text
|
|
120
|
+
}} />
|
|
121
|
+
|
|
122
|
+
<Spacer />
|
|
123
|
+
<TimerPicker
|
|
124
|
+
itemTextColor='#aeadb5'
|
|
125
|
+
style={{paddingVertical: cx(0), marginVertical: cx(0)}}
|
|
126
|
+
is12Hours={!is24Hour}
|
|
127
|
+
singlePicker={true}
|
|
128
|
+
startTime={state.hour * 60 + state.minute}
|
|
129
|
+
amText={I18n.getLang('manage_user_calendar_label_am')}
|
|
130
|
+
pmText={I18n.getLang('manage_user_calendar_label_pm')}
|
|
131
|
+
symbol=''
|
|
132
|
+
onTimerChange={(startTime) => {
|
|
133
|
+
state.hour = Math.trunc(startTime / 60)
|
|
134
|
+
state.minute = startTime % 60
|
|
135
|
+
state.planData.startTime = `${state.hour.toString().padStart(2, '0')}:${state.minute.toString().padStart(2, '0')}`
|
|
136
|
+
}}/>
|
|
137
|
+
{minimumTipEnable() && <View style={{ flexDirection: 'row', marginVertical: cx(5) }}>
|
|
138
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: '#000' }} source={res.ic_info} />
|
|
139
|
+
<Text
|
|
140
|
+
style={{ color: '#000', fontSize: cx(12) }}>{I18n.getLang('add_new_trigger_time_information_text')}</Text>
|
|
141
|
+
</View>}
|
|
142
|
+
<Spacer />
|
|
143
|
+
<View style={{ flexDirection: 'row' }}>
|
|
144
|
+
<View style={{ flex: 1 }}>
|
|
145
|
+
<Text style={{ fontSize: cx(14) }}>{I18n.getLang(isAdd ? 'add_new_trigger_time_text' : 'edit_trigger_time_headline_text')}</Text>
|
|
146
|
+
</View>
|
|
147
|
+
<TouchableOpacity
|
|
148
|
+
activeOpacity={1}
|
|
149
|
+
onPress={() => {
|
|
150
|
+
navigation.navigate(ui_biz_routerKey.group_ui_biz_biological_icon_select, {
|
|
151
|
+
id: state.planData.iconId,
|
|
152
|
+
setIcon: (id) => {
|
|
153
|
+
state.planData.iconId = id
|
|
154
|
+
},
|
|
155
|
+
iconIdList: state.iconIdList,
|
|
156
|
+
})
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
<View
|
|
160
|
+
style={{ flex: 1, flexDirection: 'row', justifyContent: 'flex-end', alignContent: 'center', alignItems: 'center' }}>
|
|
161
|
+
<Image
|
|
162
|
+
style={{ width: cx(24), height: cx(24), tintColor: '#000' }}
|
|
163
|
+
source={setImg()}
|
|
164
|
+
/>
|
|
165
|
+
<Image style={{ width: cx(16), height: cx(16) }} source={BiologicalRes.biorhythom_select_rightIcon} />
|
|
166
|
+
</View>
|
|
167
|
+
</TouchableOpacity>
|
|
168
|
+
</View>
|
|
169
|
+
<Text
|
|
170
|
+
style={{ fontSize: cx(16), fontFamily: 'helvetica_neue_lt_std_bd', marginTop: cx(33), marginBottom: cx(16) }}>
|
|
171
|
+
{I18n.getLang('add_new_trigger_time_subheadline_text')}
|
|
172
|
+
</Text>
|
|
173
|
+
<Card>
|
|
174
|
+
<View style={styles.titleBGView}>
|
|
175
|
+
<Text
|
|
176
|
+
style={styles.title}>{isMixLight ? I18n.getLang('light_sources_tile_main_lighting_headline') : I18n.getLang('light_sources_tile_tw_lighting_headline')}</Text>
|
|
177
|
+
{isSupportTemperature && <View style={[
|
|
178
|
+
styles.colorBlock,
|
|
179
|
+
{
|
|
180
|
+
backgroundColor: cctToColor(state.planData.colorTemperature.toFixed()) ?
|
|
181
|
+
cctToColor(state.planData.colorTemperature.toFixed()) : '#fff', opacity: 1,
|
|
182
|
+
}]}
|
|
183
|
+
/>}
|
|
184
|
+
</View>
|
|
185
|
+
<View style={{ paddingBottom: cx(16) }}>
|
|
186
|
+
<ColorTempAdjustView
|
|
187
|
+
colorTemp={state.planData.colorTemperature}
|
|
188
|
+
brightness={Number(state.planData.brightness.toFixed())}
|
|
189
|
+
minBrightness={0}
|
|
190
|
+
onCCTChange={newValue => {
|
|
191
|
+
state.planData.colorTemperature = newValue
|
|
192
|
+
state.planData.action[0].startValue = `${colorTemperatureValue(newValue)}`
|
|
193
|
+
}}
|
|
194
|
+
onCCTChangeComplete={newValue => {
|
|
195
|
+
state.planData.colorTemperature = newValue
|
|
196
|
+
state.planData.action[0].startValue = `${colorTemperatureValue(newValue)}`
|
|
197
|
+
}}
|
|
198
|
+
onBrightnessChange={newValue => {
|
|
199
|
+
state.planData.brightness = newValue
|
|
200
|
+
state.planData.action[1].startValue = `${newValue}`
|
|
201
|
+
}}
|
|
202
|
+
onBrightnessChangeComplete={newValue => {
|
|
203
|
+
state.planData.brightness = newValue
|
|
204
|
+
state.planData.action[1].startValue = `${newValue}`
|
|
205
|
+
}}
|
|
206
|
+
isSupportBrightness={isSupportBrightness}
|
|
207
|
+
isSupportTemperature={isSupportTemperature} />
|
|
208
|
+
</View>
|
|
209
|
+
</Card>
|
|
210
|
+
<Spacer />
|
|
211
|
+
</View>
|
|
212
|
+
{!isAdd && showDeleteBtn &&
|
|
213
|
+
<View
|
|
214
|
+
style={{
|
|
215
|
+
marginHorizontal: cx(24),
|
|
216
|
+
marginVertical: cx(20)
|
|
217
|
+
}}>
|
|
218
|
+
<DeleteButton
|
|
219
|
+
text={I18n.getLang('edit_trigger_time_button_delete_text')}
|
|
220
|
+
onPress={() => {
|
|
221
|
+
showDialog({
|
|
222
|
+
method: 'confirm',
|
|
223
|
+
title: I18n.getLang('cancel_dialog_delete_item_bio_rhythm_titel'),
|
|
224
|
+
subTitle: I18n.getLang('cancel_dialog_delete_item_wakeupschedule_description'),
|
|
225
|
+
onConfirm: async (_, { close }) => {
|
|
226
|
+
close()
|
|
227
|
+
onDeleteBtnClick()
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
}}
|
|
231
|
+
/>
|
|
232
|
+
</View>}
|
|
233
|
+
</ScrollView>
|
|
234
|
+
</Page>
|
|
235
|
+
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
const styles = StyleSheet.create({
|
|
241
|
+
titleBGView: {
|
|
242
|
+
flexDirection: 'row',
|
|
243
|
+
alignItems: 'center',
|
|
244
|
+
paddingHorizontal: cx(16),
|
|
245
|
+
},
|
|
246
|
+
colorBlock: {
|
|
247
|
+
width: cx(20),
|
|
248
|
+
height: cx(20),
|
|
249
|
+
marginStart: cx(12),
|
|
250
|
+
borderRadius: cx(4),
|
|
251
|
+
},
|
|
252
|
+
title: {
|
|
253
|
+
color: '#000',
|
|
254
|
+
fontSize: cx(16),
|
|
255
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
256
|
+
paddingVertical: cx(16),
|
|
257
|
+
},
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
export default BiorhythmEditPage
|