@ledvance/group-ui-biz-bundle 1.0.73 → 1.0.76

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 (33) hide show
  1. package/package.json +1 -1
  2. package/src/modules/biorhythm/BiorhythmDetailPage.tsx +1 -1
  3. package/src/modules/biorhythm/circular/Progress.tsx +2 -2
  4. package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +22 -30
  5. package/src/modules/energyConsumption/EnergyConsumptionDetail.tsx +2 -2
  6. package/src/modules/energyConsumption/EnergyConsumptionPage.tsx +1 -1
  7. package/src/modules/energyConsumption/component/Overview.tsx +1 -1
  8. package/src/modules/fixedTimeForPlug/FixedTimeForPlugDetailPage.tsx +68 -87
  9. package/src/modules/fixedTimeForPlug/FixedTimeForPlugPage.tsx +44 -58
  10. package/src/modules/fixedTimeForPlug/ItemCard.tsx +29 -26
  11. package/src/modules/fixedTimeForPlug/Summary.tsx +62 -58
  12. package/src/modules/fixedTimingForLight/FixedTimingForLightDetailPage.tsx +2 -2
  13. package/src/modules/lightMode/LightModePage.tsx +2 -2
  14. package/src/modules/mood_new/MoodInfo.ts +170 -18
  15. package/src/modules/mood_new/StaticMoodEditorPage.tsx +8 -0
  16. package/src/modules/overchargeSwitch/OverchargeSwitchPage.tsx +5 -2
  17. package/src/modules/randomTimeForPlug/ItemCard.tsx +29 -26
  18. package/src/modules/randomTimeForPlug/RandomTimeForPlugDetailPage.tsx +47 -82
  19. package/src/modules/randomTimeForPlug/RandomTimeForPlugPage.tsx +58 -67
  20. package/src/modules/randomTimeForPlug/Summary.tsx +62 -58
  21. package/src/modules/randomTimingForLight/RandomTimingForLightDetailPage.tsx +2 -2
  22. package/src/modules/sleepWakeUp/SleepWakeUpDetailPage.tsx +35 -28
  23. package/src/modules/sleepWakeUp/SleepWakeUpPage.tsx +1 -1
  24. package/src/modules/swithInching/SwithInching.tsx +3 -2
  25. package/src/modules/timeSchedule/Interface.ts +3 -1
  26. package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +175 -190
  27. package/src/modules/timeSchedule/TimeSchedulePage.tsx +55 -54
  28. package/src/modules/timeSchedule/components/ManuaSettings.tsx +11 -10
  29. package/src/modules/timeSchedule/components/ScheduleCard.tsx +47 -63
  30. package/src/modules/timeSchedule/components/Summary.tsx +63 -59
  31. package/src/modules/timer/TimerAction.ts +22 -3
  32. package/src/modules/timer/TimerPage.tsx +120 -117
  33. package/src/modules/swithInching/pickerView.tsx +0 -91
@@ -37,7 +37,7 @@ import DeleteButton from '@ledvance/base/src/components/DeleteButton';
37
37
  import SegmentControl from '@ledvance/base/src/components/segmentControl';
38
38
  import { useParams } from '@ledvance/base/src/hooks/Hooks';
39
39
  import ManualSettings from './components/ManuaSettings';
40
- import { defCeilingLihtDeviceData, defDeviceData, defMixDeviceData, defStripDeviceData, defFanLightDeviceData } from './TimeScheduleActions';
40
+ import { defDeviceData, defMixDeviceData, defStripDeviceData, defFanLightDeviceData } from './TimeScheduleActions';
41
41
  import MoodItem from '../mood_new/MoodItem';
42
42
  import Summary from './components/Summary'
43
43
  import { getRemoteMoodList } from '../mood_new/MoodActions'
@@ -45,6 +45,7 @@ import { MoodUIInfo } from '../mood_new/Interface';
45
45
  import InfoText from '@ledvance/base/src/components/InfoText';
46
46
 
47
47
  const { convertX: cx } = Utils.RatioUtils;
48
+ const { withTheme } = Utils.ThemeUtils
48
49
  const { toFixedString } = Utils.NumberUtils;
49
50
  interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
50
51
  mode: 'add' | 'edit';
@@ -53,15 +54,15 @@ interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
53
54
  refreshFn: () => void;
54
55
  }
55
56
 
56
- const TimeScheduleDetailPage = () => {
57
- const props = useParams<TimeScheduleDetailPageParams>();
57
+ const TimeScheduleDetailPage = (props: { theme?: any }) => {
58
+ const params = useParams<TimeScheduleDetailPageParams>();
58
59
  const navigation = useNavigation();
59
60
  const uaGroupInfo = useUAGroupInfo()
60
61
  const is24HourClock = useSystemTimeFormate();
61
62
  const [moods, setMoods] = useMoods();
62
63
  const state = useReactive<TimeScheduleDetailState>({
63
- timeSchedule: props.mode === 'add' ? newTimeSchedule() : cloneDeep(props.timeSchedule),
64
- dps: props.mode === 'add' ? {} : props.timeSchedule.dps,
64
+ timeSchedule: params.mode === 'add' ? newTimeSchedule() : cloneDeep(params.timeSchedule),
65
+ dps: params.mode === 'add' ? {} : params.timeSchedule.dps,
65
66
  isManual: true, // manual ,mood
66
67
  initSelectedSkill: [] as ApplyForItem[],
67
68
  selectedSkill: [] as ApplyForItem[],
@@ -69,23 +70,23 @@ const TimeScheduleDetailPage = () => {
69
70
  loading: false,
70
71
  moodLoading: false,
71
72
  manualData:
72
- props.mode === 'add'
73
- ? getDefaultManual(props)
74
- : props.manualDataDp2Obj(props.timeSchedule.dps)?.deviceData,
75
- mood: props.mode === 'add' ? undefined : props.manualDataDp2Obj(props.timeSchedule.dps)?.mood,
73
+ params.mode === 'add'
74
+ ? getDefaultManual(params)
75
+ : params.manualDataDp2Obj(params.timeSchedule.dps)?.deviceData,
76
+ mood: params.mode === 'add' ? undefined : params.manualDataDp2Obj(params.timeSchedule.dps)?.mood,
76
77
  moods: cloneDeep(moods),
77
78
  timerId: undefined,
78
79
  moodName: '',
79
80
  });
80
81
 
81
82
  useEffect(() => {
82
- const { applyForDisabled, timeSchedule, applyForList, mode } = props;
83
+ const { applyForDisabled, timeSchedule, applyForList, mode } = params;
83
84
  const cannotChoose = applyForDisabled || applyForList.length === 1;
84
85
  const cloneApplyList =
85
86
  mode === 'add'
86
87
  ? cloneDeep(applyForList)
87
88
  : cloneDeep(applyForList).map(item => {
88
- if (props.isMixLight && state.manualData.type === DeviceType.MixLight) {
89
+ if (params.isMixLight && state.manualData.type === DeviceType.MixLight) {
89
90
  return {
90
91
  ...item,
91
92
  enable:
@@ -116,15 +117,15 @@ const TimeScheduleDetailPage = () => {
116
117
  state.selectedSkill = mode === 'add' ? [] : selectedList;
117
118
  state.unSelectedSkill = mode === 'add' ? cloneApplyList : unSelectedList;
118
119
  }
119
- if (props.mode === 'edit' && props.manualDataDp2Obj) {
120
- const { isManual, mood } = props.manualDataDp2Obj(props.timeSchedule.dps);
120
+ if (params.mode === 'edit' && params.manualDataDp2Obj) {
121
+ const { isManual, mood } = params.manualDataDp2Obj(params.timeSchedule.dps);
121
122
  state.isManual = isManual;
122
123
  state.mood = mood;
123
124
  }
124
125
  state.initSelectedSkill = cloneDeep(state.selectedSkill)
125
126
  if (!(Array.isArray(moods) && moods.length)) {
126
127
  state.timerId = setTimeout(() => {
127
- getRemoteMoodList(uaGroupInfo.tyGroupId.toString(), props).then(res => {
128
+ getRemoteMoodList(uaGroupInfo.tyGroupId.toString(), params).then(res => {
128
129
  if (res.success && Array.isArray(res.data)) {
129
130
  state.moods = cloneDeep(res.data);
130
131
  setMoods(cloneDeep(res.data));
@@ -144,7 +145,7 @@ const TimeScheduleDetailPage = () => {
144
145
  if (state.moods?.length) {
145
146
  state.moodName =
146
147
  state.moods.find(m =>
147
- props.isCeilingLight
148
+ params.isCeilingLight
148
149
  ? m.mainLamp.id === state.mood?.mainLamp.id &&
149
150
  m.secondaryLamp.id === state.mood?.secondaryLamp.id
150
151
  : m.id === state.mood?.id
@@ -164,21 +165,21 @@ const TimeScheduleDetailPage = () => {
164
165
  }, []);
165
166
 
166
167
  const isModify = useMemo(() => {
167
- const schedule = props.mode === 'add' ? newTimeSchedule() : props.timeSchedule;
168
+ const schedule = params.mode === 'add' ? newTimeSchedule() : params.timeSchedule;
168
169
  const manual =
169
- props.mode === 'add'
170
- ? getDefaultManual(props)
171
- : props.manualDataDp2Obj(props.timeSchedule.dps).deviceData;
170
+ params.mode === 'add'
171
+ ? getDefaultManual(params)
172
+ : params.manualDataDp2Obj(params.timeSchedule.dps).deviceData;
172
173
  const before = {
173
174
  ...schedule,
174
175
  selectedSkill: state.initSelectedSkill,
175
176
  dps: manual,
176
177
  isManual:
177
- props.mode === 'add' ? true : props.manualDataDp2Obj(props.timeSchedule.dps).isManual,
178
- mood: props.mode === 'add' ? undefined : props.manualDataDp2Obj(props.timeSchedule.dps)?.mood,
178
+ params.mode === 'add' ? true : params.manualDataDp2Obj(params.timeSchedule.dps).isManual,
179
+ mood: params.mode === 'add' ? undefined : params.manualDataDp2Obj(params.timeSchedule.dps)?.mood,
179
180
  id: 1,
180
181
  };
181
- before.mood = (before.isManual || props.mode === 'add') ? undefined : props.manualDataDp2Obj(props.timeSchedule.dps)?.mood
182
+ before.mood = (before.isManual || params.mode === 'add') ? undefined : params.manualDataDp2Obj(params.timeSchedule.dps)?.mood
182
183
  const now = {
183
184
  ...state.timeSchedule,
184
185
  selectedSkill: state.selectedSkill,
@@ -191,8 +192,8 @@ const TimeScheduleDetailPage = () => {
191
192
  }, [JSON.stringify(state.timeSchedule), JSON.stringify(state.initSelectedSkill), JSON.stringify(state.selectedSkill), state.manualData, state.isManual, state.mood]);
192
193
 
193
194
  const showMoodFanSelectText = useMemo(() =>{
194
- return (props.isUVCFan || props.isFanLight) && !state.isManual && state.selectedSkill.length < 2
195
- }, [props.isUVCFan, props.isFanLight, state.selectedSkill.length, state.isManual])
195
+ return (params.isUVCFan || params.isFanLight) && !state.isManual && state.selectedSkill.length < 2
196
+ }, [params.isUVCFan, params.isFanLight, state.selectedSkill.length, state.isManual])
196
197
 
197
198
  const allowSubmit = useMemo(() => {
198
199
  return (
@@ -205,18 +206,70 @@ const TimeScheduleDetailPage = () => {
205
206
  }, [state.timeSchedule.aliasName, state.selectedSkill, isModify, state.isManual, state.mood, showMoodFanSelectText]);
206
207
 
207
208
  const showSelectedIcon = useMemo(() => {
208
- return props.applyForList.length !== 1 && !props.applyForDisabled;
209
- }, [props.applyForList.length, props.applyForDisabled]);
209
+ return params.applyForList.length !== 1 && !params.applyForDisabled;
210
+ }, [params.applyForList.length, params.applyForDisabled]);
210
211
 
211
212
  const getMoodItemEnable = useCallback((item: MoodUIInfo ) =>{
212
- return props.isCeilingLight ? ((item.mainLamp.id === state.mood?.mainLamp?.id) && (item.secondaryLamp.id === state.mood?.secondaryLamp?.id)) : item.id === state.mood?.id
213
- }, [state.mood, props.isCeilingLight])
213
+ return params.isCeilingLight ? ((item.mainLamp.id === state.mood?.mainLamp?.id) && (item.secondaryLamp.id === state.mood?.secondaryLamp?.id)) : item.id === state.mood?.id
214
+ }, [state.mood, params.isCeilingLight])
215
+
216
+ const styles = StyleSheet.create({
217
+ cardContainer: {
218
+ marginHorizontal: cx(24),
219
+ },
220
+ itemTitle: {
221
+ color: props.theme.global.fontColor,
222
+ fontSize: cx(16),
223
+ fontWeight: 'bold',
224
+ fontFamily: 'helvetica_neue_lt_std_bd',
225
+ },
226
+ applyContent: {
227
+ backgroundColor: props.theme.container.background,
228
+ borderRadius: 4,
229
+ minHeight: cx(55),
230
+ flex: 1,
231
+ justifyContent: 'center',
232
+ paddingHorizontal: cx(10),
233
+ },
234
+ applyItem: {
235
+ paddingLeft: cx(5),
236
+ flexDirection: 'row',
237
+ justifyContent: 'space-between',
238
+ alignItems: 'center',
239
+ backgroundColor: props.theme.global.background,
240
+ height: cx(35),
241
+ },
242
+ moodScrollView: {
243
+ maxHeight: cx(500),
244
+ },
245
+ summaryRight: {
246
+ flexDirection: 'column',
247
+ backgroundColor: props.theme.tag.background,
248
+ borderRadius: cx(16),
249
+ alignItems: 'center'
250
+ },
251
+ rightItem: {
252
+ paddingHorizontal: cx(12),
253
+ color: props.theme.tag.fontColor,
254
+ fontSize: cx(14)
255
+ },
256
+ switchButton: {
257
+ flexDirection: 'row',
258
+ alignItems: 'center',
259
+ justifyContent: 'space-between',
260
+ marginBottom: cx(10),
261
+ },
262
+ text: {
263
+ color: props.theme.global.fontColor,
264
+ fontSize: cx(14)
265
+ },
266
+ })
214
267
 
215
268
  return (
216
269
  <Page
217
270
  backText={I18n.getLang('motion_detection_add_time_schedule_system_back_text')}
218
271
  headlineText={I18n.getLang(
219
- props.mode === 'add'
272
+ params.mode === 'add'
220
273
  ? 'motion_detection_add_time_schedule_headline_text'
221
274
  : 'edit_timeschedule_headline_text'
222
275
  )}
@@ -224,10 +277,10 @@ const TimeScheduleDetailPage = () => {
224
277
  rightButtonIconClick={async () => {
225
278
  if (!allowSubmit || state.loading) return;
226
279
  state.loading = true;
227
- const res = await props.modDeleteTimeSchedule(props.mode, {
280
+ const res = await params.modDeleteTimeSchedule(params.mode, {
228
281
  ...state.timeSchedule,
229
282
  status: 1,
230
- dps: props.manualDataObj2Dp(
283
+ dps: params.manualDataObj2Dp(
231
284
  {
232
285
  deviceData: state.manualData,
233
286
  isManual: state.isManual,
@@ -238,7 +291,7 @@ const TimeScheduleDetailPage = () => {
238
291
  }, '');
239
292
  state.loading = false;
240
293
  if (res.success) {
241
- props.refreshFn()
294
+ params.refreshFn()
242
295
  navigation.goBack();
243
296
  }
244
297
  }}
@@ -263,7 +316,8 @@ const TimeScheduleDetailPage = () => {
263
316
  {/* pick */}
264
317
  <TimerPicker
265
318
  itemTextColor="#aeadb5"
266
- style={{ paddingVertical: cx(0), marginVertical: cx(0) }}
319
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
320
+ pickerFontColor={props.theme.global.fontColor}
267
321
  is12Hours={!is24HourClock}
268
322
  singlePicker={true}
269
323
  amText={I18n.getLang('manage_user_calendar_label_am')}
@@ -286,7 +340,9 @@ const TimeScheduleDetailPage = () => {
286
340
  }}
287
341
  />
288
342
  <Spacer />
289
- <Text style={styles.cardContainer}>{loopText(state.timeSchedule.loops.split(''))}</Text>
343
+ <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
344
+ {loopText(state.timeSchedule.loops.split(''))}
345
+ </Text>
290
346
  <Spacer height={cx(30)} />
291
347
 
292
348
  {/* Apply for */}
@@ -297,14 +353,16 @@ const TimeScheduleDetailPage = () => {
297
353
  <Spacer height={cx(10)} />
298
354
  <View style={[styles.applyContent, {paddingTop: state.selectedSkill.length ? cx(10) : 0}]}>
299
355
  {state.selectedSkill.length === 0 ? (
300
- <Text>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text>
356
+ <Text style={{color: props.theme.global.fontColor}}>
357
+ {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
358
+ </Text>
301
359
  ) : (
302
360
  state.selectedSkill.map(skill => (
303
361
  <View
304
362
  style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}
305
363
  key={skill.dp}
306
364
  >
307
- <Text style={{ color: '#000' }}>{skill.key}</Text>
365
+ <Text style={{ color: props.theme.global.fontColor }}>{skill.key}</Text>
308
366
  {showSelectedIcon && (
309
367
  <TouchableOpacity
310
368
  onPress={() => {
@@ -314,7 +372,7 @@ const TimeScheduleDetailPage = () => {
314
372
  style={{ paddingHorizontal: cx(5) }}
315
373
  >
316
374
  <Image
317
- style={{ width: cx(16), height: cx(16) }}
375
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }}
318
376
  source={res.ic_arrows_nav_clear}
319
377
  />
320
378
  </TouchableOpacity>
@@ -335,7 +393,7 @@ const TimeScheduleDetailPage = () => {
335
393
  >
336
394
  <Text style={{ color: '#000' }}>{item.key}</Text>
337
395
  <Image
338
- style={{ width: cx(16), height: cx(16) }}
396
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }}
339
397
  source={res.device_panel_timer_add}
340
398
  />
341
399
  </TouchableOpacity>
@@ -349,7 +407,7 @@ const TimeScheduleDetailPage = () => {
349
407
  {I18n.getLang('timeschedule_add_schedule_subheadline2_text')}
350
408
  </Text>
351
409
  <Spacer height={cx(10)} />
352
- {props.isSupportMood && (
410
+ {params.isSupportMood && (
353
411
  <>
354
412
  <SegmentControl
355
413
  title1={I18n.getLang('timeschedule_add_schedule_switch_tab_manual_text')}
@@ -362,26 +420,26 @@ const TimeScheduleDetailPage = () => {
362
420
  )}
363
421
  <Spacer height={cx(10)} />
364
422
  {(!state.selectedSkill.length && !showMoodFanSelectText) && <InfoText
365
- style={{marginHorizontal: cx(24)}}
366
- icon={res.ic_warning_amber}
367
- contentColor="#FF9500"
368
- text={I18n.getLang('timeschedule_add_schedule_no_device_warning_text')}
423
+ style={{marginHorizontal: cx(24)}}
424
+ icon={res.ic_warning_amber}
425
+ contentColor={props.theme.global.warning}
426
+ text={I18n.getLang('timeschedule_add_schedule_no_device_warning_text')}
369
427
  />}
370
428
  {showMoodFanSelectText && <InfoText
371
- style={{marginHorizontal: cx(24)}}
372
- icon={res.ic_warning_amber}
373
- contentColor="#FF9500"
374
- text={I18n.getLang('timeschedule_add_schedule_devicestate_sec_warning_text')}
429
+ style={{marginHorizontal: cx(24)}}
430
+ icon={res.ic_warning_amber}
431
+ contentColor={props.theme.global.warnging}
432
+ text={I18n.getLang('timeschedule_add_schedule_devicestate_sec_warning_text')}
375
433
  />}
376
434
  {state.isManual ? (
377
435
  <ManualSettings
378
436
  dps={state.dps}
379
437
  applyForList={state.selectedSkill}
380
- isSupportColor={props.isSupportColor}
381
- isSupportBrightness={props.isSupportBrightness}
382
- isSupportTemperature={props.isSupportTemperature}
383
- isCeilingLight={props.isCeilingLight}
384
- isUVCFan={props.isUVCFan}
438
+ isSupportColor={params.isSupportColor}
439
+ isSupportBrightness={params.isSupportBrightness}
440
+ isSupportTemperature={params.isSupportTemperature}
441
+ isCeilingLight={params.isCeilingLight}
442
+ isUVCFan={params.isUVCFan}
385
443
  manualData={state.manualData}
386
444
  onManualChange={manual => {
387
445
  // @ts-ignore
@@ -402,7 +460,7 @@ const TimeScheduleDetailPage = () => {
402
460
  <MoodItem
403
461
  enable={getMoodItemEnable(item)}
404
462
  mood={item}
405
- isMix={!!(props.isMixLight || props.isCeilingLight)}
463
+ isMix={!!(params.isMixLight || params.isCeilingLight)}
406
464
  onSwitch={_ => {
407
465
  state.mood = cloneDeep(item);
408
466
  }}
@@ -441,67 +499,67 @@ const TimeScheduleDetailPage = () => {
441
499
  actions={<View style={{ flex: 1 }}>
442
500
  {state.isManual
443
501
  ? !!state.selectedSkill.length && (
444
- <>
445
- {!!state.selectedSkill.filter(skill => skill.enable).length && (
446
- <>
447
- <Text style={{ fontSize: cx(14), color: '#000' }}>
448
- {I18n.getLang('feature_summary_action_txt_1')}
449
- </Text>
450
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
451
- {state.selectedSkill
452
- .filter(skill => skill.enable)
453
- .map(item => (
454
- <View
455
- style={[
456
- styles.summaryRight,
457
- { marginRight: cx(5), marginBottom: cx(5) },
458
- ]}
459
- key={item.dp}
460
- >
461
- <Text style={[styles.rightItem]}>{item.key}</Text>
462
- </View>
463
- ))}
464
- </View>
465
- </>
466
- )}
502
+ <>
503
+ {!!state.selectedSkill.filter(skill => skill.enable).length && (
504
+ <>
505
+ <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>
506
+ {I18n.getLang('feature_summary_action_txt_1')}
507
+ </Text>
508
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
509
+ {state.selectedSkill
510
+ .filter(skill => skill.enable)
511
+ .map(item => (
512
+ <View
513
+ style={[
514
+ styles.summaryRight,
515
+ { marginRight: cx(5), marginBottom: cx(5) },
516
+ ]}
517
+ key={item.dp}
518
+ >
519
+ <Text style={[styles.rightItem]}>{item.key}</Text>
520
+ </View>
521
+ ))}
522
+ </View>
523
+ </>
524
+ )}
467
525
 
468
- {!!state.selectedSkill.filter(skill => !skill.enable).length && (
469
- <>
470
- <Text style={{ fontSize: cx(14) }}>
471
- {I18n.getLang('feature_summary_action_txt_2')}
472
- </Text>
473
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
474
- {state.selectedSkill
475
- .filter(skill => !skill.enable)
476
- .map((item) => (
477
- <View
478
- style={[
479
- styles.summaryRight,
480
- { marginRight: cx(5), marginBottom: cx(5) },
481
- ]}
482
- key={item.dp}
483
- >
484
- <Text style={[styles.rightItem]}>{item.key}</Text>
485
- </View>
486
- ))}
487
- </View>
488
- </>
489
- )}
490
- </>
491
- )
526
+ {!!state.selectedSkill.filter(skill => !skill.enable).length && (
527
+ <>
528
+ <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>
529
+ {I18n.getLang('feature_summary_action_txt_2')}
530
+ </Text>
531
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
532
+ {state.selectedSkill
533
+ .filter(skill => !skill.enable)
534
+ .map((item) => (
535
+ <View
536
+ style={[
537
+ styles.summaryRight,
538
+ { marginRight: cx(5), marginBottom: cx(5) },
539
+ ]}
540
+ key={item.dp}
541
+ >
542
+ <Text style={[styles.rightItem]}>{item.key}</Text>
543
+ </View>
544
+ ))}
545
+ </View>
546
+ </>
547
+ )}
548
+ </>
549
+ )
492
550
  : !!state.moodName && (
493
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
494
- <View style={[styles.summaryRight, { marginLeft: cx(5) }]}>
495
- <Text style={styles.rightItem}>{state.moodName}</Text>
496
- </View>
551
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
552
+ <View style={[styles.summaryRight, { marginLeft: cx(5) }]}>
553
+ <Text style={styles.rightItem}>{state.moodName}</Text>
497
554
  </View>
498
- )}
555
+ </View>
556
+ )}
499
557
  </View>}
500
558
  />
501
559
  <Spacer height={cx(30)} />
502
560
 
503
561
  {/* delete */}
504
- {props.mode === 'edit' && (
562
+ {params.mode === 'edit' && (
505
563
  <View style={{ marginHorizontal: cx(24) }}>
506
564
  <DeleteButton
507
565
  text={I18n.getLang('edit_timeschedule_bttn_text')}
@@ -513,10 +571,10 @@ const TimeScheduleDetailPage = () => {
513
571
  onConfirm: async (_, { close }) => {
514
572
  state.loading = true;
515
573
  close();
516
- const res = await props.modDeleteTimeSchedule('del', {...state.timeSchedule, status: 2}, state.timeSchedule.id.toString());
574
+ const res = await params.modDeleteTimeSchedule('del', {...state.timeSchedule, status: 2}, state.timeSchedule.id.toString());
517
575
  state.loading = false;
518
576
  if (res.success) {
519
- props.refreshFn()
577
+ params.refreshFn()
520
578
  navigation.goBack();
521
579
  }
522
580
  },
@@ -550,20 +608,20 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
550
608
  : props.isMixLight
551
609
  ? DeviceType.MixLight
552
610
  : props.isCeilingLight
553
- ? DeviceType.CeilingLight
554
- : props.isFanLight ?
555
- DeviceType.FanLight
556
- : props.isCeilingLight
557
- ? DeviceType.CeilingLight
558
- : DeviceType.LightSource;
611
+ ? DeviceType.CeilingLight
612
+ : props.isFanLight ?
613
+ DeviceType.FanLight
614
+ : props.isCeilingLight
615
+ ? DeviceType.CeilingLight
616
+ : DeviceType.LightSource;
559
617
  const deviceData =
560
618
  (deviceType === DeviceType.StripLight || deviceType === DeviceType.CeilingLight)
561
619
  ? defStripDeviceData
562
620
  : deviceType === DeviceType.MixLight
563
621
  ? defMixDeviceData
564
622
  : deviceType === DeviceType.FanLight
565
- ? defFanLightDeviceData
566
- : defDeviceData;
623
+ ? defFanLightDeviceData
624
+ : defDeviceData;
567
625
  // @ts-ignore
568
626
  return {
569
627
  type: deviceType,
@@ -574,77 +632,4 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
574
632
  };
575
633
  };
576
634
 
577
- const styles = StyleSheet.create({
578
- cardContainer: {
579
- marginHorizontal: cx(24),
580
- },
581
- itemTitle: {
582
- color: '#000',
583
- fontSize: cx(16),
584
- fontWeight: 'bold',
585
- fontFamily: 'helvetica_neue_lt_std_bd',
586
- },
587
- applyContent: {
588
- backgroundColor: '#f6f6f6',
589
- borderRadius: 4,
590
- minHeight: cx(55),
591
- flex: 1,
592
- justifyContent: 'center',
593
- paddingHorizontal: cx(10),
594
- },
595
- applyItem: {
596
- paddingLeft: cx(5),
597
- flexDirection: 'row',
598
- justifyContent: 'space-between',
599
- alignItems: 'center',
600
- backgroundColor: '#fff',
601
- height: cx(35),
602
- },
603
- moodScrollView: {
604
- maxHeight: cx(500),
605
- },
606
- summaryContainer: {
607
- flexDirection: 'row',
608
- justifyContent: 'flex-start',
609
- marginBottom: cx(10),
610
- marginHorizontal: cx(24),
611
- },
612
- summaryImg: {
613
- height: cx(12),
614
- width: cx(12),
615
- tintColor: '#000',
616
- },
617
- summaryLeft: {
618
- flexDirection: 'row',
619
- alignItems: 'center',
620
- minWidth: cx(90),
621
- },
622
- leftTitle: {
623
- fontSize: cx(14),
624
- color: '#000',
625
- marginTop: 0,
626
- },
627
- summaryRight: {
628
- flexDirection: 'column',
629
- backgroundColor: '#cbcbcb',
630
- borderRadius: cx(16),
631
- alignItems: 'center'
632
- },
633
- rightItem: {
634
- paddingHorizontal: cx(12),
635
- color: '#000',
636
- fontSize: cx(14)
637
- },
638
- switchButton: {
639
- flexDirection: 'row',
640
- alignItems: 'center',
641
- justifyContent: 'space-between',
642
- marginBottom: cx(10),
643
- },
644
- text: {
645
- color: '#000',
646
- fontSize: cx(14)
647
- },
648
- });
649
-
650
- export default TimeScheduleDetailPage;
635
+ export default withTheme(TimeScheduleDetailPage)