@ledvance/ui-biz-bundle 1.1.93 → 1.1.95

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 (50) hide show
  1. package/package.json +1 -1
  2. package/src/modules/flags/FlagEditPage.tsx +13 -12
  3. package/src/modules/flags/FlagItem.tsx +4 -3
  4. package/src/modules/flags/FlagPage.tsx +60 -41
  5. package/src/modules/history/HistoryPage.tsx +11 -10
  6. package/src/modules/mood/MixMood/AddMixMoodPage.tsx +2 -2
  7. package/src/modules/mood/MixMood/MixMoodEditPage.tsx +4 -4
  8. package/src/modules/mood/MixMood/MixMoodPage.tsx +4 -4
  9. package/src/modules/music/MusicPage.tsx +10 -8
  10. package/src/modules/sleepWakeup/DeviceState.tsx +4 -4
  11. package/src/modules/sleepWakeup/SleepWakeUpPage.tsx +2 -2
  12. package/src/modules/timer/TimerPage.tsx +18 -17
  13. package/src/newModules/biorhythm/BiorhythmEditPage.tsx +13 -12
  14. package/src/newModules/biorhythm/BiorhythmPage.tsx +23 -22
  15. package/src/newModules/biorhythm/IconSelect.tsx +5 -4
  16. package/src/newModules/childLock/ChildLockPage.tsx +7 -6
  17. package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +3 -2
  18. package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +16 -15
  19. package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +16 -15
  20. package/src/newModules/energyConsumption/component/BarChart.tsx +18 -5
  21. package/src/newModules/energyConsumption/component/EnergyModal.tsx +26 -25
  22. package/src/newModules/energyConsumption/component/Overview.tsx +10 -9
  23. package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +23 -22
  24. package/src/newModules/fixedTime/FixedTimePage.tsx +12 -11
  25. package/src/newModules/lightMode/LightModePage.tsx +9 -8
  26. package/src/newModules/mood/AddMoodPage.tsx +3 -2
  27. package/src/newModules/mood/DynamicMoodEditorPage.tsx +13 -12
  28. package/src/newModules/mood/MixDynamicMoodEditor.tsx +19 -18
  29. package/src/newModules/mood/MoodActions.ts +17 -4
  30. package/src/newModules/mood/MoodInfo.ts +0 -7
  31. package/src/newModules/mood/MoodItem.tsx +5 -4
  32. package/src/newModules/mood/MoodPage.tsx +9 -4
  33. package/src/newModules/mood/RecommendMoodItem.tsx +4 -3
  34. package/src/newModules/mood/StaticMoodEditorPage.tsx +5 -4
  35. package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +6 -5
  36. package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +10 -9
  37. package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +8 -7
  38. package/src/newModules/randomTime/RandomTimeDetailPage.tsx +15 -14
  39. package/src/newModules/randomTime/RandomTimePage.tsx +12 -11
  40. package/src/newModules/randomTime/Summary.tsx +7 -6
  41. package/src/newModules/remoteControl/RemoteControlPage.tsx +3 -2
  42. package/src/newModules/select/SelectPage.tsx +10 -9
  43. package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +24 -23
  44. package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +15 -14
  45. package/src/newModules/switchGradient/SwitchGradientPage.tsx +4 -3
  46. package/src/newModules/swithInching/SwithInching.tsx +7 -6
  47. package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +20 -19
  48. package/src/newModules/timeSchedule/TimeSchedulePage.tsx +8 -7
  49. package/src/newModules/timeSchedule/components/ManuaSettings.tsx +9 -9
  50. package/src/newModules/timeSchedule/components/ScheduleCard.tsx +6 -4
@@ -31,6 +31,7 @@ import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustVi
31
31
  import ColorAdjustView from '@ledvance/base/src/components/ColorAdjustView';
32
32
  import Summary from '@ledvance/base/src/components/Summary';
33
33
  import { getEndTime, getStartTime } from './SleepWakeUpActions'
34
+ import ThemeType from '@ledvance/base/src/config/themeType'
34
35
 
35
36
  const { convertX: cx } = Utils.RatioUtils;
36
37
  const { withTheme } = Utils.ThemeUtils
@@ -48,7 +49,7 @@ interface SleepWakeUpDetailPageProps extends SleepWakeUpPageRouteParams {
48
49
  ) => Promise<Result<any>>;
49
50
  }
50
51
 
51
- const SleepWakeUpDetailPage = (props: { theme?: any }) => {
52
+ const SleepWakeUpDetailPage = (props: { theme?: ThemeType }) => {
52
53
  const navigation = useNavigation();
53
54
  const params = useParams<SleepWakeUpDetailPageProps>();
54
55
  const is24HourClock = useSystemTimeFormate();
@@ -139,7 +140,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
139
140
  <Card style={{ marginHorizontal: cx(24) }}>
140
141
  <LdvSwitch
141
142
  title={item.key}
142
- color={props.theme.card.background}
143
+ color={props.theme?.card.background}
143
144
  colorAlpha={1}
144
145
  enable={
145
146
  item.type === 'mainLight'
@@ -202,11 +203,11 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
202
203
  picker: {
203
204
  marginHorizontal: cx(24),
204
205
  marginVertical: cx(15),
205
- color: props.theme.global.backgournd,
206
+ color: props.theme?.global.backgournd,
206
207
  },
207
208
  week: {},
208
209
  itemTitle: {
209
- color: props.theme.global.fontColor,
210
+ color: props.theme?.global.fontColor,
210
211
  fontSize: cx(16),
211
212
  fontWeight: 'bold',
212
213
  fontFamily: 'helvetica_neue_lt_std_bd',
@@ -228,7 +229,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
228
229
  summaryImg: {
229
230
  height: cx(12),
230
231
  width: cx(12),
231
- tintColor: props.theme.global.fontColor,
232
+ tintColor: props.theme?.global.fontColor,
232
233
  },
233
234
  summaryLeft: {
234
235
  flexDirection: 'row',
@@ -237,17 +238,17 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
237
238
  },
238
239
  leftTitle: {
239
240
  fontSize: cx(14),
240
- color: props.theme.global.fontColor,
241
+ color: props.theme?.global.fontColor,
241
242
  },
242
243
  summaryRight: {
243
244
  flexDirection: 'column',
244
245
  marginLeft: cx(21),
245
246
  borderRadius: cx(16),
246
- backgroundColor: props.theme.tag.background,
247
+ backgroundColor: props.theme?.tag.background,
247
248
  },
248
249
  rightItem: {
249
250
  paddingHorizontal: cx(12),
250
- color: props.theme.global.fontColor,
251
+ color: props.theme?.global.fontColor,
251
252
  },
252
253
  rightTitle: {
253
254
  paddingLeft: cx(12),
@@ -255,11 +256,11 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
255
256
  fontSize: cx(10),
256
257
  textAlign: 'center',
257
258
  alignSelf: 'flex-start',
258
- color: props.theme.tag.fontColor,
259
+ color: props.theme?.tag.fontColor,
259
260
  },
260
261
  filletCorner: {
261
262
  flexDirection: 'row',
262
- backgroundColor: props.theme.tag.background,
263
+ backgroundColor: props.theme?.tag.background,
263
264
  borderRadius: cx(16),
264
265
  alignSelf: 'flex-start',
265
266
  },
@@ -328,8 +329,8 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
328
329
  {/* pick */}
329
330
  <TimerPicker
330
331
  itemTextColor="#aeadb5"
331
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
332
- pickerFontColor={props.theme.global.fontColor}
332
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
333
+ pickerFontColor={props.theme?.global.fontColor}
333
334
  is12Hours={!is24HourClock}
334
335
  singlePicker={true}
335
336
  amText={I18n.getLang('manage_user_calendar_label_am')}
@@ -357,7 +358,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
357
358
  }}
358
359
  />
359
360
  <Spacer />
360
- <Text style={{ marginHorizontal: cx(24), color: props.theme.global.fontColor }}>
361
+ <Text style={{ marginHorizontal: cx(24), color: props.theme?.global.fontColor }}>
361
362
  {loopText(state.sleepWakeUp.weeks, parseTimer(getEndTime(state.sleepWakeUp) * 60))}
362
363
  </Text>
363
364
  <Spacer />
@@ -370,7 +371,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
370
371
  </Text>
371
372
  <View
372
373
  style={{
373
- backgroundColor: props.theme.container.background,
374
+ backgroundColor: props.theme?.container.background,
374
375
  borderRadius: 4,
375
376
  minHeight: cx(50),
376
377
  flex: 1,
@@ -390,14 +391,14 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
390
391
  flexDirection: 'row',
391
392
  justifyContent: 'space-between',
392
393
  alignItems: 'center',
393
- backgroundColor: props.theme.global.background,
394
+ backgroundColor: props.theme?.global.background,
394
395
  marginBottom: cx(8),
395
396
  }}
396
397
  key={`${apply.dp}-key`}
397
398
  >
398
399
  <Text
399
400
  style={{
400
- color: props.theme.global.fontColor,
401
+ color: props.theme?.global.fontColor,
401
402
  fontSize: cx(14),
402
403
  marginHorizontal: cx(6),
403
404
  marginVertical: cx(9),
@@ -476,7 +477,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
476
477
  {I18n.getLang('timeschedule_add_schedule_subheadline4_text')}
477
478
  </Text>
478
479
  <Spacer />
479
- <Text style={{color: props.theme.global.secondFontColor}}>
480
+ <Text style={{color: props.theme?.global.secondFontColor}}>
480
481
  {I18n.getLang(
481
482
  params.isSleep
482
483
  ? 'add_sleepschedule_one_source_settings_text'
@@ -499,7 +500,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
499
500
  unit={['h', 'min']}
500
501
  maxHour={3}
501
502
  />
502
- <Text style={{color: props.theme.global.secondFontColor}}>
503
+ <Text style={{color: props.theme?.global.secondFontColor}}>
503
504
  {I18n.formatValue(
504
505
  params.isSleep
505
506
  ? 'add_sleepschedule_one_source_settings_text2'
@@ -513,7 +514,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
513
514
  <LdvSwitch
514
515
  title={I18n.getLang('add_wakeupschedule_settings_text3')}
515
516
  enable={state.sleepWakeUp.last > 0}
516
- color={props.theme.global.background}
517
+ color={props.theme?.global.background}
517
518
  colorAlpha={1}
518
519
  setEnable={v => {
519
520
  state.sleepWakeUp.last = v ? 1 : 0;
@@ -523,7 +524,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
523
524
  )}
524
525
  {state.sleepWakeUp.last > 0 && (
525
526
  <>
526
- <Text style={{ fontSize: cx(14), color: props.theme.global.secondFontColor }}>
527
+ <Text style={{ fontSize: cx(14), color: props.theme?.global.secondFontColor }}>
527
528
  {I18n.getLang('add_wakeupschedule_settings_text4')}
528
529
  </Text>
529
530
  <LdvPickerView
@@ -550,7 +551,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
550
551
  unit={['h', 'min']}
551
552
  maxHour={3}
552
553
  />
553
- <Text style={{color: props.theme.global.secondFontColor}}>
554
+ <Text style={{color: props.theme?.global.secondFontColor}}>
554
555
  {I18n.formatValue(
555
556
  'add_wakeupschedule_settings_text5',
556
557
  `${convertMinutesTo12HourFormat(
@@ -569,7 +570,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
569
570
  time={`${convertMinutesTo12HourFormat(state.sleepWakeUp.startTime, is24HourClock)} - ${convertMinutesTo12HourFormat(state.sleepWakeUp.endTime, is24HourClock)}`}
570
571
  actions={(
571
572
  <View>
572
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
573
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
573
574
  {I18n.getLang(
574
575
  !params.isSleep ? 'feature_summary_action_txt_11' : 'feature_summary_action_txt_10'
575
576
  )}
@@ -580,7 +581,7 @@ const SleepWakeUpDetailPage = (props: { theme?: any }) => {
580
581
  </Text>
581
582
  </View>
582
583
  <Spacer height={cx(10)} />
583
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
584
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
584
585
  {I18n.getLang(
585
586
  params.isSleep
586
587
  ? 'feature_summary_action_txt_2'
@@ -20,6 +20,7 @@ import Card from "@ledvance/base/src/components/Card";
20
20
  import { useParams } from "@ledvance/base/src/hooks/Hooks";
21
21
  import { ApplyForItem } from "../timeSchedule/Interface";
22
22
  import InfoText from "@ledvance/base/src/components/InfoText";
23
+ import ThemeType from '@ledvance/base/src/config/themeType'
23
24
 
24
25
  const cx = Utils.RatioUtils.convertX
25
26
  const { parseTimer } = Utils.TimeUtils
@@ -41,7 +42,7 @@ export interface SleepWakeUpPageRouteParams {
41
42
  }
42
43
 
43
44
  const MAX_SCHEDULE = 4
44
- const SleepWakeUpPage = (props: { theme?: any }) => {
45
+ const SleepWakeUpPage = (props: { theme?: ThemeType }) => {
45
46
  const deviceInfo = useDeviceInfo()
46
47
  const navigation = useNavigation()
47
48
  const is24HourClock = useSystemTimeFormate()
@@ -188,7 +189,7 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
188
189
  height: cx(90.5),
189
190
  marginStart: cx(115),
190
191
  marginTop: cx(100),
191
- backgroundColor: props.theme.card.background,
192
+ backgroundColor: props.theme?.card.background,
192
193
  },
193
194
  popoverItem: {
194
195
  width: cx(210),
@@ -212,13 +213,13 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
212
213
  lineHeight: cx(20),
213
214
  textAlign: 'center',
214
215
  fontFamily: 'helvetica_neue_lt_std_roman',
215
- color: props.theme.global.fontColor
216
+ color: props.theme?.global.fontColor
216
217
  },
217
218
  emptyBtnView: {
218
219
  alignItems: 'center'
219
220
  },
220
221
  emptyBtn: {
221
- backgroundColor: props.theme.button.primary,
222
+ backgroundColor: props.theme?.button.primary,
222
223
  borderRadius: cx(5),
223
224
  paddingHorizontal: cx(15),
224
225
  paddingVertical: cx(10)
@@ -243,14 +244,14 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
243
244
  },
244
245
  time: {
245
246
  flex: 1,
246
- color: props.theme.global.fontColor,
247
+ color: props.theme?.global.fontColor,
247
248
  fontSize: cx(16),
248
249
  fontWeight: 'bold',
249
250
  fontFamily: 'helvetica_neue_lt_std_bd',
250
251
  },
251
252
  switchBtn: {},
252
253
  loopText: {
253
- color: props.theme.global.fontColor,
254
+ color: props.theme?.global.fontColor,
254
255
  fontSize: cx(14),
255
256
  fontFamily: 'helvetica_neue_lt_std_roman',
256
257
  height: cx(20)
@@ -259,14 +260,14 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
259
260
  alignSelf: 'flex-start',
260
261
  borderRadius: cx(16),
261
262
  height: cx(16),
262
- backgroundColor: props.theme.tag.background,
263
+ backgroundColor: props.theme?.tag.background,
263
264
  paddingHorizontal: cx(10),
264
265
  },
265
266
  tagTitle: {
266
267
  fontSize: cx(10),
267
268
  textAlign: 'center',
268
269
  fontFamily: 'PingFangSC-Medium',
269
- color: props.theme.tag.fontColor
270
+ color: props.theme?.tag.fontColor
270
271
  },
271
272
  })
272
273
 
@@ -283,7 +284,7 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
283
284
  loading={state.loading}
284
285
  >
285
286
  <View style={{ marginHorizontal: cx(24) }}>
286
- <Text style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>
287
+ <Text style={{ color: props.theme?.global.fontColor, fontSize: cx(12) }}>
287
288
  {I18n.getLang('timeschedule_overview_description_text')}
288
289
  </Text>
289
290
  </View>
@@ -291,8 +292,8 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
291
292
  {!!getTipText() && <InfoText
292
293
  style={{ marginHorizontal: cx(24), marginBottom: cx(5) }}
293
294
  icon={res.ic_warning_amber}
294
- iconStyle={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }}
295
- contentColor={props.theme.global.secondFontColor}
295
+ iconStyle={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }}
296
+ contentColor={props.theme?.global.secondFontColor}
296
297
  text={tipText}
297
298
  textStyle={{ fontSize: cx(12) }}
298
299
  />}
@@ -348,7 +349,7 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
348
349
  <View style={styles.emptyText}>
349
350
  <Image
350
351
  source={{ uri: res.device_panel_schedule_alert }}
351
- style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }}
352
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
352
353
  />
353
354
  <Text style={styles.emptyNoTime}>
354
355
  {
@@ -363,14 +364,14 @@ const SleepWakeUpPage = (props: { theme?: any }) => {
363
364
  <Spacer />
364
365
  <TextButton
365
366
  style={styles.emptyBtn}
366
- textStyle={isSleepMax ? styles.disableItemText : { color: props.theme.button.fontColor }}
367
+ textStyle={isSleepMax ? styles.disableItemText : { color: props.theme?.button.fontColor }}
367
368
  text={I18n.getLang('sleepwakeschedule_add_button_text1')}
368
369
  onPress={() => onAddScheduleDialogItemClick(true, 'add', getNewSleepWakeUp(true, params))}
369
370
  />
370
371
  <Spacer />
371
372
  <TextButton
372
373
  style={styles.emptyBtn}
373
- textStyle={isWakeUpMax ? styles.disableItemText : { color: props.theme.button.fontColor }}
374
+ textStyle={isWakeUpMax ? styles.disableItemText : { color: props.theme?.button.fontColor }}
374
375
  text={I18n.getLang('sleepwakeschedule_add_button_text2')}
375
376
  onPress={() => onAddScheduleDialogItemClick(false, 'add', getNewSleepWakeUp(false, params))}
376
377
  />
@@ -12,6 +12,7 @@ import {useNavigation} from '@react-navigation/core'
12
12
  import I18n from '@ledvance/base/src/i18n'
13
13
  import Stepper from '@ledvance/base/src/components/Stepper'
14
14
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
15
+ import ThemeType from '@ledvance/base/src/config/themeType'
15
16
 
16
17
  const {convertX: cx} = Utils.RatioUtils
17
18
  const { withTheme } = Utils.ThemeUtils
@@ -20,7 +21,7 @@ export interface SwitchGradientPageParams {
20
21
  switchGradientDpCode: string
21
22
  }
22
23
 
23
- const SwitchGradientPage = (props: { theme?: any }) => {
24
+ const SwitchGradientPage = (props: { theme?: ThemeType }) => {
24
25
  const devInfo = useDeviceInfo()
25
26
  const navigation = useNavigation()
26
27
  const params = useParams<SwitchGradientPageParams>()
@@ -48,7 +49,7 @@ const SwitchGradientPage = (props: { theme?: any }) => {
48
49
  paddingHorizontal: cx(16),
49
50
  },
50
51
  stepTitle: {
51
- color: props.theme.global.fontColor,
52
+ color: props.theme?.global.fontColor,
52
53
  fontSize: cx(14),
53
54
  },
54
55
  stepGroup: {
@@ -57,7 +58,7 @@ const SwitchGradientPage = (props: { theme?: any }) => {
57
58
  },
58
59
  stepText: {
59
60
  flex: 1,
60
- color: props.theme.global.fontColor,
61
+ color: props.theme?.global.fontColor,
61
62
  fontSize: cx(16),
62
63
  },
63
64
  })
@@ -11,6 +11,7 @@ import {SwitchInchingPageParams, useCountdown1, useSwitchInching} from "./SwithI
11
11
  import {useRandomTime} from "../randomTime/RandomTimeActions";
12
12
  import {useFixedTime} from "../fixedTime/FixedTimeActions";
13
13
  import {useParams} from "@ledvance/base/src/hooks/Hooks";
14
+ import ThemeType from '@ledvance/base/src/config/themeType'
14
15
 
15
16
  const { convertX: cx } = Utils.RatioUtils
16
17
  const { withTheme } = Utils.ThemeUtils
@@ -22,7 +23,7 @@ interface SwitchInchingState {
22
23
  flag: Symbol | number
23
24
  }
24
25
 
25
- const SwitchInching = (props: { theme?: any }) => {
26
+ const SwitchInching = (props: { theme?: ThemeType }) => {
26
27
  const params = useParams<SwitchInchingPageParams>()
27
28
  const deviceInfo = useDeviceInfo()
28
29
  const navigation = useNavigation()
@@ -134,7 +135,7 @@ const SwitchInching = (props: { theme?: any }) => {
134
135
 
135
136
  const styles = StyleSheet.create({
136
137
  switchContainer: {
137
- backgroundColor: props.theme.container.background,
138
+ backgroundColor: props.theme?.container.background,
138
139
  marginHorizontal: cx(24),
139
140
  padding: cx(10),
140
141
  borderRadius: cx(6),
@@ -143,26 +144,26 @@ const SwitchInching = (props: { theme?: any }) => {
143
144
  switchCardContainer: {
144
145
  paddingVertical: cx(4),
145
146
  paddingHorizontal: cx(10),
146
- backgroundColor: props.theme.global.background,
147
+ backgroundColor: props.theme?.global.background,
147
148
  flexDirection: 'row',
148
149
  justifyContent: 'center',
149
150
  alignItems: 'center',
150
151
  borderRadius: cx(6),
151
152
  },
152
153
  switchCardTitle: {
153
- color: props.theme.global.fontColor,
154
+ color: props.theme?.global.fontColor,
154
155
  fontSize: cx(14),
155
156
  flex: 1,
156
157
  fontWeight: '400',
157
158
  },
158
159
  switchDescription: {
159
- color: props.theme.global.fontColor,
160
+ color: props.theme?.global.fontColor,
160
161
  flexWrap: 'wrap',
161
162
  fontSize: cx(12),
162
163
  marginTop: cx(4),
163
164
  },
164
165
  secondTopic: {
165
- color: props.theme.global.fontColor,
166
+ color: props.theme?.global.fontColor,
166
167
  flexWrap: 'wrap',
167
168
  fontSize: cx(14),
168
169
  marginTop: cx(30),
@@ -44,6 +44,7 @@ import MoodItem from '../mood/MoodItem';
44
44
  import { getRemoteMoodList } from '../mood/MoodActions';
45
45
  import { MoodUIInfo } from '../mood/Interface';
46
46
  import Summary from '@ledvance/base/src/components/Summary'
47
+ import ThemeType from '@ledvance/base/src/config/themeType'
47
48
 
48
49
  const { convertX: cx } = Utils.RatioUtils;
49
50
  const { toFixedString } = Utils.NumberUtils;
@@ -56,7 +57,7 @@ interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
56
57
  refreshFn: () => void;
57
58
  }
58
59
 
59
- const TimeScheduleDetailPage = (props: { theme?: any }) => {
60
+ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
60
61
  const is24HourClock = useSystemTimeFormate();
61
62
  const params = useParams<TimeScheduleDetailPageParams>();
62
63
  const navigation = useNavigation();
@@ -215,13 +216,13 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
215
216
  marginHorizontal: cx(24),
216
217
  },
217
218
  itemTitle: {
218
- color: props.theme.global.fontColor,
219
+ color: props.theme?.global.fontColor,
219
220
  fontSize: cx(16),
220
221
  fontWeight: 'bold',
221
222
  fontFamily: 'helvetica_neue_lt_std_bd',
222
223
  },
223
224
  applyContent: {
224
- backgroundColor: props.theme.container.background,
225
+ backgroundColor: props.theme?.container.background,
225
226
  borderRadius: 4,
226
227
  minHeight: cx(55),
227
228
  flex: 1,
@@ -234,7 +235,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
234
235
  flexDirection: 'row',
235
236
  justifyContent: 'space-between',
236
237
  alignItems: 'center',
237
- backgroundColor: props.theme.global.background,
238
+ backgroundColor: props.theme?.global.background,
238
239
  height: cx(35),
239
240
  },
240
241
  moodScrollView: {
@@ -249,7 +250,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
249
250
  summaryImg: {
250
251
  height: cx(12),
251
252
  width: cx(12),
252
- tintColor: props.theme.global.fontColor,
253
+ tintColor: props.theme?.global.fontColor,
253
254
  },
254
255
  summaryLeft: {
255
256
  flexDirection: 'row',
@@ -258,19 +259,19 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
258
259
  },
259
260
  leftTitle: {
260
261
  fontSize: cx(14),
261
- color: props.theme.global.fontColor,
262
+ color: props.theme?.global.fontColor,
262
263
  marginTop: 0,
263
264
  },
264
265
  summaryRight: {
265
266
  flexDirection: 'column',
266
- backgroundColor: props.theme.tag.background,
267
+ backgroundColor: props.theme?.tag.background,
267
268
  borderRadius: cx(16),
268
269
  alignItems: 'center'
269
270
  },
270
271
 
271
272
  rightItem: {
272
273
  paddingHorizontal: cx(12),
273
- color: props.theme.global.fontColor,
274
+ color: props.theme?.global.fontColor,
274
275
  fontSize: cx(14)
275
276
  },
276
277
  switchButton: {
@@ -280,7 +281,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
280
281
  marginBottom: cx(10),
281
282
  },
282
283
  text: {
283
- color: props.theme.global.fontColor,
284
+ color: props.theme?.global.fontColor,
284
285
  fontSize: cx(14)
285
286
  },
286
287
  });
@@ -336,8 +337,8 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
336
337
  {/* pick */}
337
338
  <TimerPicker
338
339
  itemTextColor="#aeadb5"
339
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
340
- pickerFontColor={props.theme.global.fontColor}
340
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
341
+ pickerFontColor={props.theme?.global.fontColor}
341
342
  is12Hours={!is24HourClock}
342
343
  singlePicker={true}
343
344
  amText={I18n.getLang('manage_user_calendar_label_am')}
@@ -360,7 +361,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
360
361
  }}
361
362
  />
362
363
  <Spacer />
363
- <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>{loopText(state.timeSchedule.loops.split(''))}</Text>
364
+ <Text style={{ ...styles.cardContainer, color: props.theme?.global.fontColor, fontSize: cx(14) }}>{loopText(state.timeSchedule.loops.split(''))}</Text>
364
365
  <Spacer height={cx(30)} />
365
366
 
366
367
  {/* Apply for */}
@@ -371,14 +372,14 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
371
372
  <Spacer height={cx(10)} />
372
373
  <View style={[styles.applyContent, { paddingTop: state.selectedSkill.length ? cx(10) : 0 }]}>
373
374
  {state.selectedSkill.length === 0 ? (
374
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text>
375
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text>
375
376
  ) : (
376
377
  state.selectedSkill.map(skill => (
377
378
  <View
378
379
  style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}
379
380
  key={skill.dp}
380
381
  >
381
- <Text style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>{skill.key}</Text>
382
+ <Text style={{ color: props.theme?.global.fontColor, fontSize: cx(12) }}>{skill.key}</Text>
382
383
  {showSelectedIcon && (
383
384
  <TouchableOpacity
384
385
  onPress={() => {
@@ -388,7 +389,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
388
389
  style={{ paddingHorizontal: cx(5) }}
389
390
  >
390
391
  <Image
391
- style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }}
392
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
392
393
  source={res.ic_arrows_nav_clear}
393
394
  />
394
395
  </TouchableOpacity>
@@ -407,9 +408,9 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
407
408
  state.unSelectedSkill = state.unSelectedSkill.filter(s => item.dp !== s.dp);
408
409
  }}
409
410
  >
410
- <Text style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>{item.key}</Text>
411
+ <Text style={{ color: props.theme?.global.fontColor, fontSize: cx(12) }}>{item.key}</Text>
411
412
  <Image
412
- style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }}
413
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
413
414
  source={res.device_panel_timer_add}
414
415
  />
415
416
  </TouchableOpacity>
@@ -521,7 +522,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
521
522
  <>
522
523
  {!!state.selectedSkill.filter(skill => skill.enable).length && (
523
524
  <>
524
- <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>
525
+ <Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>
525
526
  {I18n.getLang('feature_summary_action_txt_1')}
526
527
  </Text>
527
528
  <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
@@ -544,7 +545,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
544
545
 
545
546
  {!!state.selectedSkill.filter(skill => !skill.enable).length && (
546
547
  <>
547
- <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>
548
+ <Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>
548
549
  {I18n.getLang('feature_summary_action_txt_2')}
549
550
  </Text>
550
551
  <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
@@ -21,6 +21,7 @@ import ScheduleCard from './components/ScheduleCard';
21
21
  import { ui_biz_routerKey } from '../../navigation/Routers';
22
22
  import Tag from '@ledvance/base/src/components/Tag';
23
23
  import { cloneDeep } from 'lodash';
24
+ import ThemeType from '@ledvance/base/src/config/themeType'
24
25
 
25
26
  const { convertX: cx } = Utils.RatioUtils;
26
27
  const { withTheme } = Utils.ThemeUtils
@@ -46,7 +47,7 @@ export interface TimeSchedulePageParams {
46
47
  manualDataObj2Dp: (deviceState: DeviceStateType, applyForList: ApplyForItem[]) => Record<string, any>;
47
48
  }
48
49
 
49
- const TimeSchedulePage = (props: { theme?: any }) => {
50
+ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
50
51
  const deviceInfo = useDeviceInfo();
51
52
  const devId = useDeviceId();
52
53
  const navigation = useNavigation();
@@ -125,7 +126,7 @@ const TimeSchedulePage = (props: { theme?: any }) => {
125
126
 
126
127
  const styles = StyleSheet.create({
127
128
  overviewDescription: {
128
- color: props.theme.global.fontColor,
129
+ color: props.theme?.global.fontColor,
129
130
  marginHorizontal: cx(24),
130
131
  },
131
132
  emptyImage: {
@@ -141,7 +142,7 @@ const TimeSchedulePage = (props: { theme?: any }) => {
141
142
  width: 'auto',
142
143
  minWidth: cx(150),
143
144
  paddingHorizontal: cx(16),
144
- backgroundColor: props.theme.button.primary,
145
+ backgroundColor: props.theme?.button.primary,
145
146
  },
146
147
  categoryList: {
147
148
  display: 'flex',
@@ -190,8 +191,8 @@ const TimeSchedulePage = (props: { theme?: any }) => {
190
191
  text={I18n.getLang('motion_detection_time_schedule_notifications_warning_text')}
191
192
  icon={res.ic_warning_amber}
192
193
  style={{ marginHorizontal: cx(24) }}
193
- textStyle={{ color: props.theme.global.fontColor }}
194
- iconStyle={{ tintColor: props.theme.global.warning }}
194
+ textStyle={{ color: props.theme?.global.fontColor }}
195
+ iconStyle={{ tintColor: props.theme?.global.warning }}
195
196
  />
196
197
  )}
197
198
  {params.applyForList.length > 1 && !!state.originList.length && !(params.isCeilingLight || params.isMixLight) && showTags}
@@ -232,8 +233,8 @@ const TimeSchedulePage = (props: { theme?: any }) => {
232
233
  icon={res.device_panel_schedule_alert}
233
234
  text={I18n.getLang(!state.originList.length ? 'timeschedule_overview_empty_information_text' : 'sleepwakeschedule_empty_filtering_information_text')}
234
235
  style={{ width: 'auto', alignItems: 'center' }}
235
- textStyle={{ color: props.theme.global.fontColor, flex: undefined }}
236
- iconStyle={{ tintColor: props.theme.global.fontColor }}
236
+ textStyle={{ color: props.theme?.global.fontColor, flex: undefined }}
237
+ iconStyle={{ tintColor: props.theme?.global.fontColor }}
237
238
  />
238
239
  <Spacer height={cx(16)} />
239
240
  {!state.originList.length && <DeleteButton