@ledvance/ui-biz-bundle 1.1.90 → 1.1.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.
Files changed (38) hide show
  1. package/package.json +1 -1
  2. package/src/modules/flags/FlagEditPage.tsx +180 -179
  3. package/src/modules/flags/FlagItem.tsx +26 -42
  4. package/src/modules/flags/FlagPage.tsx +27 -26
  5. package/src/modules/history/HistoryPage.tsx +111 -103
  6. package/src/modules/music/MusicPage.tsx +90 -88
  7. package/src/modules/timer/TimerPage.tsx +13 -9
  8. package/src/newModules/biorhythm/BiorhythmEditPage.tsx +54 -54
  9. package/src/newModules/biorhythm/BiorhythmPage.tsx +163 -162
  10. package/src/newModules/biorhythm/IconSelect.tsx +5 -4
  11. package/src/newModules/childLock/ChildLockPage.tsx +49 -47
  12. package/src/newModules/energyConsumption/component/EnergyModal.tsx +2 -2
  13. package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +127 -124
  14. package/src/newModules/fixedTime/FixedTimePage.tsx +108 -104
  15. package/src/newModules/lightMode/LightModePage.tsx +74 -67
  16. package/src/newModules/mood/AddMoodPage.tsx +18 -15
  17. package/src/newModules/mood/DynamicMoodEditorPage.tsx +103 -100
  18. package/src/newModules/mood/MixDynamicMoodEditor.tsx +107 -104
  19. package/src/newModules/mood/MoodItem.tsx +59 -55
  20. package/src/newModules/mood/MoodPage.tsx +58 -57
  21. package/src/newModules/mood/RecommendMoodItem.tsx +27 -24
  22. package/src/newModules/mood/StaticMoodEditorPage.tsx +77 -85
  23. package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +36 -48
  24. package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +137 -135
  25. package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +67 -61
  26. package/src/newModules/randomTime/RandomTimeDetailPage.tsx +114 -151
  27. package/src/newModules/randomTime/RandomTimePage.tsx +110 -105
  28. package/src/newModules/randomTime/Summary.tsx +61 -57
  29. package/src/newModules/remoteControl/RemoteControlPage.tsx +4 -3
  30. package/src/newModules/select/SelectPage.tsx +65 -62
  31. package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +16 -8
  32. package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +131 -123
  33. package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +144 -140
  34. package/src/newModules/switchGradient/SwitchGradientPage.tsx +24 -25
  35. package/src/newModules/swithInching/SwithInching.tsx +154 -152
  36. package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +83 -83
  37. package/src/newModules/timeSchedule/components/ManuaSettings.tsx +3 -2
  38. package/src/newModules/swithInching/pickerView.tsx +0 -91
@@ -21,6 +21,7 @@ import Spacer from '@ledvance/base/src/components/Spacer'
21
21
  import { showDialog } from '@ledvance/base/src/utils/common'
22
22
 
23
23
  const cx = Utils.RatioUtils.convertX
24
+ const { withTheme } = Utils.ThemeUtils
24
25
 
25
26
  export interface BiorhythmEditPageParams {
26
27
  planData: Plan
@@ -36,7 +37,7 @@ export interface BiorhythmEditPageParams {
36
37
  showDeleteBtn?: boolean
37
38
  }
38
39
 
39
- const BiorhythmEditPage = () => {
40
+ const BiorhythmEditPage = (props: { theme?: any }) => {
40
41
  const navigation = useNavigation()
41
42
  const route = useRoute<any>()
42
43
  const {
@@ -98,6 +99,26 @@ const BiorhythmEditPage = () => {
98
99
  return state.planData.name.length > 0 && state.planData.name.length < 33 && !nameRepeatFlag && !checkBiorhythmDataChanged && !minimumTipEnable()
99
100
  }, [nameRepeatFlag, state.planData.name, checkBiorhythmDataChanged, minimumTipEnable()])
100
101
 
102
+ const styles = StyleSheet.create({
103
+ titleBGView: {
104
+ flexDirection: 'row',
105
+ alignItems: 'center',
106
+ paddingHorizontal: cx(16),
107
+ },
108
+ colorBlock: {
109
+ width: cx(20),
110
+ height: cx(20),
111
+ marginStart: cx(12),
112
+ borderRadius: cx(4),
113
+ },
114
+ title: {
115
+ color: props.theme.global.fontColor,
116
+ fontSize: cx(16),
117
+ fontFamily: 'helvetica_neue_lt_std_bd',
118
+ paddingVertical: cx(16),
119
+ },
120
+ })
121
+
101
122
  return (
102
123
  <Page
103
124
  backText={I18n.getLang('add_new_trigger_time_system_back_text')}
@@ -113,14 +134,14 @@ const BiorhythmEditPage = () => {
113
134
  <View
114
135
  style={{
115
136
  marginHorizontal: cx(24),
116
- backgroundColor: '#fff',
137
+ backgroundColor: props.theme.global.background,
117
138
  }}>
118
139
  <View style={{ height: cx(20) }} />
119
140
  <TextField
120
141
  value={state.planData.name}
121
142
  showError={state.planData.name?.length > 32 || nameRepeatFlag}
122
143
  maxLength={33}
123
- tipColor={nameRepeatFlag ? '#f00' : undefined}
144
+ tipColor={nameRepeatFlag ? props.theme.global.error : undefined}
124
145
  errorText={I18n.getLang(nameRepeatFlag ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text')}
125
146
  placeholder={I18n.getLang('add_new_trigger_time_inputfield_value_text')}
126
147
  onChangeText={text => {
@@ -130,7 +151,8 @@ const BiorhythmEditPage = () => {
130
151
  <View style={{ height: cx(20) }} />
131
152
  <TimerPicker
132
153
  itemTextColor='#aeadb5'
133
- style={{ paddingVertical: cx(0), marginVertical: cx(0) }}
154
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
155
+ pickerFontColor={props.theme.global.fontColor}
134
156
  is12Hours={!is24Hour}
135
157
  singlePicker={true}
136
158
  amText={I18n.getLang('manage_user_calendar_label_am')}
@@ -142,14 +164,14 @@ const BiorhythmEditPage = () => {
142
164
  }}
143
165
  />
144
166
  {minimumTipEnable() && <View style={{ flexDirection: 'row', marginVertical: cx(5) }}>
145
- <Image style={{ width: cx(16), height: cx(16), tintColor: '#000' }} source={res.ic_info} />
146
- <Text
147
- style={{ color: '#000', fontSize: cx(12) }}>{I18n.getLang('add_new_trigger_time_information_text')}</Text>
167
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }} source={res.ic_info} />
168
+ <Text
169
+ style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>{I18n.getLang('add_new_trigger_time_information_text')}</Text>
148
170
  </View>}
149
171
  <View style={{ height: cx(20) }} />
150
172
  <View style={{ flexDirection: 'row' }}>
151
173
  <View style={{ flex: 1 }}>
152
- <Text style={{ fontSize: cx(14) }}>{I18n.getLang(isAdd ? 'add_new_trigger_time_text' : 'edit_trigger_time_headline_text')}</Text>
174
+ <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>{I18n.getLang('add_new_trigger_time_text')}</Text>
153
175
  </View>
154
176
  <TouchableOpacity
155
177
  activeOpacity={1}
@@ -166,15 +188,15 @@ const BiorhythmEditPage = () => {
166
188
  <View
167
189
  style={{ flex: 1, flexDirection: 'row', justifyContent: 'flex-end', alignContent: 'center', alignItems: 'center' }}>
168
190
  <Image
169
- style={{ width: cx(24), height: cx(24), tintColor: '#000' }}
191
+ style={{ width: cx(24), height: cx(24), tintColor: props.theme.global.fontColor }}
170
192
  source={setImg()}
171
193
  />
172
- <Image style={{ width: cx(16), height: cx(16) }} source={BiologicalRes.biorhythom_select_rightIcon} />
194
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }} source={BiologicalRes.biorhythom_select_rightIcon} />
173
195
  </View>
174
196
  </TouchableOpacity>
175
197
  </View>
176
198
  <Text
177
- style={{ fontSize: cx(16), fontFamily: 'helvetica_neue_lt_std_bd', marginTop: cx(33), marginBottom: cx(16) }}>
199
+ style={{ fontSize: cx(16), color: props.theme.global.fontColor, fontFamily: 'helvetica_neue_lt_std_bd', marginTop: cx(33), marginBottom: cx(16) }}>
178
200
  {I18n.getLang('add_new_trigger_time_subheadline_text')}
179
201
  </Text>
180
202
  <Card>
@@ -217,51 +239,29 @@ const BiorhythmEditPage = () => {
217
239
  <Spacer />
218
240
  </View>
219
241
  {!isAdd && showDeleteBtn &&
220
- <View
221
- style={{
222
- marginHorizontal: cx(24),
223
- marginVertical: cx(20)
224
- }}>
225
- <DeleteButton
226
- text={I18n.getLang('edit_trigger_time_button_delete_text')}
227
- onPress={() =>{
228
- showDialog({
229
- method: 'confirm',
230
- title: I18n.getLang('cancel_dialog_delete_item_bio_rhythm_titel'),
231
- subTitle: I18n.getLang('cancel_dialog_delete_item_wakeupschedule_description'),
232
- onConfirm: async (_, { close }) => {
233
- close()
234
- onDeleteBtnClick()
235
- },
236
- })
237
- }}
238
- />
239
- </View>}
242
+ <View
243
+ style={{
244
+ marginHorizontal: cx(24),
245
+ marginVertical: cx(20)
246
+ }}>
247
+ <DeleteButton
248
+ text={I18n.getLang('edit_trigger_time_button_delete_text')}
249
+ onPress={() =>{
250
+ showDialog({
251
+ method: 'confirm',
252
+ title: I18n.getLang('cancel_dialog_delete_item_bio_rhythm_titel'),
253
+ subTitle: I18n.getLang('cancel_dialog_delete_item_wakeupschedule_description'),
254
+ onConfirm: async (_, { close }) => {
255
+ close()
256
+ onDeleteBtnClick()
257
+ },
258
+ })
259
+ }}
260
+ />
261
+ </View>}
240
262
  </ScrollView>
241
263
  </Page>
242
264
  )
243
265
  }
244
266
 
245
-
246
- const styles = StyleSheet.create({
247
- titleBGView: {
248
- flexDirection: 'row',
249
- alignItems: 'center',
250
- paddingHorizontal: cx(16),
251
- },
252
- colorBlock: {
253
- width: cx(20),
254
- height: cx(20),
255
- marginStart: cx(12),
256
- borderRadius: cx(4),
257
- },
258
- title: {
259
- color: '#000',
260
- fontSize: cx(16),
261
- fontFamily: 'helvetica_neue_lt_std_bd',
262
- paddingVertical: cx(16),
263
- },
264
- })
265
-
266
-
267
- export default BiorhythmEditPage
267
+ export default withTheme(BiorhythmEditPage)
@@ -34,6 +34,7 @@ import DeleteButton from '@ledvance/base/src/components/DeleteButton'
34
34
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
35
35
 
36
36
  const cx = Utils.RatioUtils.convertX
37
+ const { withTheme } = Utils.ThemeUtils
37
38
  const width = Utils.RatioUtils.width
38
39
 
39
40
  interface UIState extends BiorhythmBean {
@@ -48,16 +49,16 @@ export interface BiorhythmPageParams {
48
49
  biorhythmDpCode: string
49
50
  conflictDps: {
50
51
  randomTimeDpCode?: string
51
- fixedTimeDpCode?: string
52
+ fixedTimeDpCode?: string
52
53
  sleepDpCode?: string
53
- wakeUpDpCode?: string
54
+ wakeUpDpCode?: string
54
55
  }
55
56
  isSupportTemperature: boolean
56
57
  isSupportBrightness: boolean
57
58
  isMixLight?: boolean
58
59
  }
59
60
 
60
- const BiorhythmPage = () => {
61
+ const BiorhythmPage = (props: { theme?: any }) => {
61
62
  const params = useParams<BiorhythmPageParams>()
62
63
  const navigation = useNavigation()
63
64
  const [biorhythm, setBiorhythm] = useBiorhythm(params.biorhythmDpCode)
@@ -97,7 +98,7 @@ const BiorhythmPage = () => {
97
98
  }, [])
98
99
 
99
100
  const requestSetBiorhythm = useCallback(async (pushFeature: boolean = true) => {
100
- state.loading = true
101
+ state.loading = true
101
102
  const planList = state.planList?.map(item => { return { ...item, icon: `${item.icon}` } })
102
103
  .sort((a, b) => a.time - b.time);
103
104
  const res = await setBiorhythm(cloneDeep({ ...state, planList }), pushFeature)
@@ -211,7 +212,7 @@ const BiorhythmPage = () => {
211
212
  state.gradient = biorhythm.gradient
212
213
  state.repeatPeriod = biorhythm.repeatPeriod
213
214
  state.planList = planList
214
-
215
+
215
216
  }, [JSON.stringify(biorhythm)])
216
217
 
217
218
 
@@ -227,21 +228,21 @@ const BiorhythmPage = () => {
227
228
 
228
229
  const sunHomeText = string => {
229
230
  const text = string.split('SUN@HOME')
230
- return text?.length === 1 && <Text style={{ fontSize: cx(14) }}>{text[0]}</Text> ||
231
- <Text style={{
232
- fontSize: cx(14),
233
- flexDirection: 'row',
234
- }}>
235
- <Text>{text[0]}</Text>
236
- <Text onPress={openLink}
237
- style={{
238
- fontFamily: 'helvetica_neue_lt_std_roman',
239
- color: '#ff6600',
240
- textDecorationLine: 'underline',
241
- flexWrap: 'wrap',
242
- }}>SUN@HOME</Text>
243
- <Text>{text[1]}</Text>
244
- </Text>
231
+ return text?.length === 1 && <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>{text[0]}</Text> ||
232
+ <Text style={{
233
+ fontSize: cx(14),
234
+ flexDirection: 'row',
235
+ }}>
236
+ <Text style={{color: props.theme.global.fontColor }}>{text[0]}</Text>
237
+ <Text onPress={openLink}
238
+ style={{
239
+ fontFamily: 'helvetica_neue_lt_std_roman',
240
+ color: props.theme.button.primary,
241
+ textDecorationLine: 'underline',
242
+ flexWrap: 'wrap',
243
+ }}>SUN@HOME</Text>
244
+ <Text style={{color: props.theme.global.fontColor }}>{text[1]}</Text>
245
+ </Text>
245
246
  }
246
247
 
247
248
  const randomIcon = () => {
@@ -264,7 +265,7 @@ const BiorhythmPage = () => {
264
265
  headlineText={I18n.getLang('add_new_trigger_time_system_back_text')}
265
266
  headlineIconContent={<Switch
266
267
  value={state.enable}
267
- thumbColor={'#f60'}
268
+ thumbColor={props.theme.icon.primary}
268
269
  trackColor={{ false: '#00000026', true: '#ff660036' }}
269
270
  onValueChange={async enable => {
270
271
  state.loading = true
@@ -292,7 +293,7 @@ const BiorhythmPage = () => {
292
293
  key={period.title}
293
294
  onPress={() => {
294
295
  const periodNum = state.repeatPeriod.filter(p => p.enabled)?.length
295
- if (periodNum === 1 && period.enabled) return
296
+ if (periodNum === 1 && period.enabled) return
296
297
  period.enabled = !period.enabled
297
298
  requestSetBiorhythm(false)
298
299
  }}
@@ -304,14 +305,14 @@ const BiorhythmPage = () => {
304
305
  justifyContent: 'center',
305
306
  alignItems: 'center',
306
307
  borderRadius: cx(20),
307
- backgroundColor: period.enabled ? '#ffe0d4' : '#fff',
308
+ backgroundColor: period.enabled ? props.theme.global.thirdBrand : props.theme.global.background,
308
309
  borderWidth: cx(1),
309
- borderColor: '#f60',
310
+ borderColor: props.theme.global.brand,
310
311
  }}
311
312
  >
312
313
  <Text
313
314
  style={{
314
- color: '#FF6600',
315
+ color: props.theme.global.brand,
315
316
  textAlign: 'center',
316
317
  }}
317
318
  >
@@ -323,10 +324,10 @@ const BiorhythmPage = () => {
323
324
  })}
324
325
  </View>
325
326
  <View style={{ marginHorizontal: cx(24), marginTop: cx(20) }}>
326
- <Text>{state.weekString}</Text>
327
+ <Text style={{color: props.theme.global.fontColor}}>{state.weekString}</Text>
327
328
  </View>
328
329
  <View style={{ marginHorizontal: cx(24), marginTop: cx(16) }}>
329
- <Text>
330
+ <Text style={{color: props.theme.global.fontColor}}>
330
331
  {I18n.getLang('bio_ryhthm_default_selectionfield_topic_text')}
331
332
  </Text>
332
333
  <TouchableOpacity
@@ -338,17 +339,17 @@ const BiorhythmPage = () => {
338
339
  style={{
339
340
  flexDirection: 'row',
340
341
  borderRadius: cx(4),
341
- backgroundColor: '#f6f6f6',
342
+ backgroundColor: props.theme.textInput.background,
342
343
  alignItems: 'center',
343
344
  flex: 1,
344
345
  height: cx(44),
345
346
  borderBottomWidth: cx(1),
346
- borderBottomColor: '#cbcbcb',
347
+ borderBottomColor: props.theme.textInput.line,
347
348
  }}
348
349
  >
349
350
  <Text style={{
350
351
  fontSize: cx(16),
351
- color: '#000',
352
+ color: props.theme.textInput.fontColor,
352
353
  fontFamily: 'helvetica_neue_lt_std_roman',
353
354
  paddingLeft: cx(16),
354
355
  }}>
@@ -389,65 +390,66 @@ const BiorhythmPage = () => {
389
390
  marginTop: cx(26),
390
391
  }}>
391
392
  {state.planList.length === 8 && <View
392
- style={{ marginVertical: cx(10), flexDirection: 'row', alignItems: 'center', width: width - cx(48) }}>
393
- <Image style={{ width: cx(16), height: cx(16), tintColor: '#ff9500' }} source={res.ic_warning_amber} />
394
- <Text
395
- style={{
396
- flexWrap: 'wrap',
397
- fontSize: cx(12),
398
- }}>{I18n.getLang('add_new_trigger_time_warning_max_number_text')}</Text>
393
+ style={{ marginVertical: cx(10), flexDirection: 'row', alignItems: 'center', width: width - cx(48) }}>
394
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }} source={res.ic_warning_amber} />
395
+ <Text
396
+ style={{
397
+ flexWrap: 'wrap',
398
+ fontSize: cx(12),
399
+ color: props.theme.global.fontColor
400
+ }}>{I18n.getLang('add_new_trigger_time_warning_max_number_text')}</Text>
399
401
  </View>}
400
402
  {state.planList.length < 8 &&
401
- <>
402
- <Text
403
- style={{
404
- fontSize: cx(16),
405
- fontWeight: 'bold',
406
- color: 'rgb(0,0,0)',
407
- }}>{I18n.getLang('bio_ryhthm_default_subheadline_text')}</Text>
408
- <TouchableOpacity
409
- onPress={() => {
410
- const ids: number[] = state.planList.map(p => p.index)
411
- const newPlan: Plan = {
412
- index: Math.max(...ids) + 1,
413
- icon: res.rhythm_icon1,
414
- time: 0,
415
- name: '',
416
- colorTemperature: 0,
417
- brightness: 100,
418
- action: [
419
- {
420
- uri: 'model/attribute/set/LightCtrl/ColorTemperature',
421
- startValue: `${colorTemperatureValue(0)}`,
422
- },
423
- {
424
- uri: 'model/attribute/set/LightCtrl/Brightness',
425
- startValue: '100',
426
- },
427
- ],
428
- enable: true,
429
- iconId: randomIcon(),
430
- }
431
- const editPageParams: BiorhythmEditPageParams = {
432
- planData: newPlan,
433
- isAdd: true,
434
- onPlanEdited,
435
- onPlanDelete,
436
- minimumEnable,
437
- nameRepeat,
438
- iconIdList: state.planList?.map(item => {
439
- return item.iconId
440
- }),
441
- isMixRGBWLamp: !!params.isMixLight,
442
- isSupportTemperature: params.isSupportTemperature,
443
- isSupportBrightness: params.isSupportBrightness,
444
- showDeleteBtn
445
- }
446
- navigation.navigate(ui_biz_routerKey.bi_biz_biological_edit, editPageParams)
447
- }}>
448
- <Image source={BiologicalRes.biorhythom_add} style={{ height: cx(24), width: cx(24) }} />
449
- </TouchableOpacity>
450
- </>
403
+ <>
404
+ <Text
405
+ style={{
406
+ fontSize: cx(16),
407
+ fontWeight: 'bold',
408
+ color: props.theme.global.fontColor,
409
+ }}>{I18n.getLang('bio_ryhthm_default_subheadline_text')}</Text>
410
+ <TouchableOpacity
411
+ onPress={() => {
412
+ const ids: number[] = state.planList.map(p => p.index)
413
+ const newPlan: Plan = {
414
+ index: Math.max(...ids) + 1,
415
+ icon: res.rhythm_icon1,
416
+ time: 0,
417
+ name: '',
418
+ colorTemperature: 0,
419
+ brightness: 100,
420
+ action: [
421
+ {
422
+ uri: 'model/attribute/set/LightCtrl/ColorTemperature',
423
+ startValue: `${colorTemperatureValue(0)}`,
424
+ },
425
+ {
426
+ uri: 'model/attribute/set/LightCtrl/Brightness',
427
+ startValue: '100',
428
+ },
429
+ ],
430
+ enable: true,
431
+ iconId: randomIcon(),
432
+ }
433
+ const editPageParams: BiorhythmEditPageParams = {
434
+ planData: newPlan,
435
+ isAdd: true,
436
+ onPlanEdited,
437
+ onPlanDelete,
438
+ minimumEnable,
439
+ nameRepeat,
440
+ iconIdList: state.planList?.map(item => {
441
+ return item.iconId
442
+ }),
443
+ isMixRGBWLamp: !!params.isMixLight,
444
+ isSupportTemperature: params.isSupportTemperature,
445
+ isSupportBrightness: params.isSupportBrightness,
446
+ showDeleteBtn
447
+ }
448
+ navigation.navigate(ui_biz_routerKey.bi_biz_biological_edit, editPageParams)
449
+ }}>
450
+ <Image source={BiologicalRes.biorhythom_add} style={{ height: cx(24), width: cx(24), tintColor: props.theme.icon.primary }} />
451
+ </TouchableOpacity>
452
+ </>
451
453
  }
452
454
  </View>
453
455
  <FlatList
@@ -464,92 +466,92 @@ const BiorhythmPage = () => {
464
466
  const bgColor = item?.brightness === 0 ? '#000' : !params.isSupportTemperature && cctToColor(1) || cctToColor(item.colorTemperature.toFixed(), item?.brightness)
465
467
  return (
466
468
  <Card
467
- style={{ marginHorizontal: cx(24) }}
468
- onPress={() => {
469
- const editPageParams: BiorhythmEditPageParams = {
470
- planData: {
471
- ...item,
472
- name: setTimer(item?.name)
473
- },
474
- isAdd: false,
475
- onPlanEdited,
476
- onPlanDelete,
477
- minimumEnable,
478
- nameRepeat,
479
- iconIdList: state.planList?.map(item => {
480
- return item.iconId
481
- }),
482
- isMixRGBWLamp: !!params.isMixLight,
483
- isSupportTemperature: params.isSupportTemperature,
484
- isSupportBrightness: params.isSupportBrightness,
485
- showDeleteBtn
486
- }
487
- navigation.navigate(ui_biz_routerKey.bi_biz_biological_edit, editPageParams)
469
+ style={{ marginHorizontal: cx(24) }}
470
+ onPress={() => {
471
+ const editPageParams: BiorhythmEditPageParams = {
472
+ planData: {
473
+ ...item,
474
+ name: setTimer(item?.name)
475
+ },
476
+ isAdd: false,
477
+ onPlanEdited,
478
+ onPlanDelete,
479
+ minimumEnable,
480
+ nameRepeat,
481
+ iconIdList: state.planList?.map(item => {
482
+ return item.iconId
483
+ }),
484
+ isMixRGBWLamp: !!params.isMixLight,
485
+ isSupportTemperature: params.isSupportTemperature,
486
+ isSupportBrightness: params.isSupportBrightness,
487
+ showDeleteBtn
488
+ }
489
+ navigation.navigate(ui_biz_routerKey.bi_biz_biological_edit, editPageParams)
490
+ }}
491
+ >
492
+ <View
493
+ style={{
494
+ flex: 1,
495
+ flexDirection: 'column',
488
496
  }}
489
497
  >
490
- <View
491
- style={{
492
- flex: 1,
493
- flexDirection: 'column',
494
- }}
495
- >
496
- <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginTop: cx(16) }}>
497
- <View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
498
- <Image
499
- source={setImg(item?.iconId) || type && { uri: item?.icon } || item?.icon}
500
- style={{
501
- width: cx(24),
502
- height: cx(24),
503
- marginStart: cx(10),
504
- marginRight: cx(6),
505
- tintColor: '#474e5d',
506
- }}
507
- />
508
- <Text
509
- style={{
510
- fontSize: cx(16),
511
- color: '#000',
512
- fontFamily: 'helvetica_neue_lt_std_roman',
513
- }}
514
- >
515
- {convertMinutesTo12HourFormat(item.time, is24Hour)}
516
- </Text>
517
- </View>
518
- <Switch
519
- value={item.enable}
520
- thumbColor={'#f60'}
521
- trackColor={{ false: '#00000026', true: '#ff660036' }}
522
- onValueChange={e => {
523
- item.enable = e
524
- requestSetBiorhythm()
498
+ <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginTop: cx(16) }}>
499
+ <View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
500
+ <Image
501
+ source={setImg(item?.iconId) || type && { uri: item?.icon } || item?.icon}
502
+ style={{
503
+ width: cx(24),
504
+ height: cx(24),
505
+ marginStart: cx(10),
506
+ marginRight: cx(6),
507
+ tintColor: props.theme.icon.normal,
525
508
  }}
526
- style={{ marginRight: cx(10) }}
527
509
  />
528
- </View>
529
- <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
530
510
  <Text
531
511
  style={{
532
- fontSize: cx(12),
533
- color: '#666',
512
+ fontSize: cx(16),
513
+ color: props.theme.global.fontColor,
534
514
  fontFamily: 'helvetica_neue_lt_std_roman',
535
- paddingLeft: cx(20),
536
515
  }}
537
516
  >
538
- {setTimer(item?.name)}
517
+ {convertMinutesTo12HourFormat(item.time, is24Hour)}
539
518
  </Text>
540
519
  </View>
541
- <View
520
+ <Switch
521
+ value={item.enable}
522
+ thumbColor={props.theme.icon.primary}
523
+ trackColor={{ false: '#00000026', true: '#ff660036' }}
524
+ onValueChange={e => {
525
+ item.enable = e
526
+ requestSetBiorhythm()
527
+ }}
528
+ style={{ marginRight: cx(10) }}
529
+ />
530
+ </View>
531
+ <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
532
+ <Text
542
533
  style={{
543
- width: cx(295),
544
- height: cx(24),
545
- backgroundColor: bgColor,
546
- marginLeft: cx(20),
547
- marginTop: cx(5),
548
- marginBottom: cx(24),
549
- borderRadius: cx(8),
550
- }} />
534
+ fontSize: cx(12),
535
+ color: props.theme.global.secondFontColor,
536
+ fontFamily: 'helvetica_neue_lt_std_roman',
537
+ paddingLeft: cx(20),
538
+ }}
539
+ >
540
+ {setTimer(item?.name)}
541
+ </Text>
551
542
  </View>
552
- </Card>
543
+ <View
544
+ style={{
545
+ width: cx(295),
546
+ height: cx(24),
547
+ backgroundColor: bgColor,
548
+ marginLeft: cx(20),
549
+ marginTop: cx(5),
550
+ marginBottom: cx(24),
551
+ borderRadius: cx(8),
552
+ }} />
553
+ </View>
554
+ </Card>
553
555
  )
554
556
  }}
555
557
  keyExtractor={item => `${item.index}`}
@@ -561,7 +563,6 @@ const BiorhythmPage = () => {
561
563
  text={I18n.getLang('bio_ryhthm_default_button_reset_text')}
562
564
  textStyle={{
563
565
  fontSize: cx(16),
564
- color: '#fff',
565
566
  fontFamily: 'helvetica_neue_lt_std_roman',
566
567
  }}
567
568
  onPress={() => {
@@ -634,6 +635,6 @@ const BiorhythmPage = () => {
634
635
  )
635
636
  }
636
637
 
637
- export default BiorhythmPage
638
+ export default withTheme(BiorhythmPage)
638
639
 
639
640