@ledvance/group-ui-biz-bundle 1.0.82 → 1.0.84

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 (52) hide show
  1. package/package.json +1 -1
  2. package/src/modules/biorhythm/BiorhythmDetailPage.tsx +12 -11
  3. package/src/modules/biorhythm/BiorhythmPage.tsx +25 -24
  4. package/src/modules/biorhythm/IconSelect.tsx +4 -3
  5. package/src/modules/childLock/ChildLockPage.tsx +7 -6
  6. package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +3 -2
  7. package/src/modules/energyConsumption/EnergyConsumptionDetail.tsx +16 -15
  8. package/src/modules/energyConsumption/EnergyConsumptionPage.tsx +16 -15
  9. package/src/modules/energyConsumption/component/BarChart.tsx +19 -5
  10. package/src/modules/energyConsumption/component/EnergyModal.tsx +26 -25
  11. package/src/modules/energyConsumption/component/Overview.tsx +10 -9
  12. package/src/modules/fixedTimeForPlug/FixedTimeForPlugDetailPage.tsx +21 -20
  13. package/src/modules/fixedTimeForPlug/FixedTimeForPlugPage.tsx +8 -7
  14. package/src/modules/fixedTimeForPlug/ItemCard.tsx +4 -3
  15. package/src/modules/fixedTimeForPlug/Summary.tsx +7 -6
  16. package/src/modules/fixedTimingForLight/FixedTimingForLightDetailPage.tsx +22 -21
  17. package/src/modules/fixedTimingForLight/FixedTimingForLightPage.tsx +9 -8
  18. package/src/modules/fixedTimingForLight/ItemCard.tsx +4 -3
  19. package/src/modules/fixedTimingForLight/Summary.tsx +7 -6
  20. package/src/modules/flags/FlagEditPage.tsx +13 -12
  21. package/src/modules/flags/FlagItem.tsx +4 -3
  22. package/src/modules/flags/FlagPage.tsx +4 -2
  23. package/src/modules/lightMode/LightModePage.tsx +9 -8
  24. package/src/modules/mood_new/AddMoodPage.tsx +3 -2
  25. package/src/modules/mood_new/DynamicMoodEditorPage.tsx +12 -11
  26. package/src/modules/mood_new/MixDynamicMoodEditor.tsx +18 -17
  27. package/src/modules/mood_new/MoodItem.tsx +5 -4
  28. package/src/modules/mood_new/MoodPage.tsx +5 -4
  29. package/src/modules/mood_new/RecommendMoodItem.tsx +4 -3
  30. package/src/modules/mood_new/StaticMoodEditorPage.tsx +5 -4
  31. package/src/modules/music/MusicPage.tsx +8 -6
  32. package/src/modules/overchargeSwitch/OverchargeSwitchPage.tsx +6 -5
  33. package/src/modules/randomTimeForPlug/ItemCard.tsx +4 -3
  34. package/src/modules/randomTimeForPlug/RandomTimeForPlugDetailPage.tsx +13 -12
  35. package/src/modules/randomTimeForPlug/RandomTimeForPlugPage.tsx +8 -7
  36. package/src/modules/randomTimeForPlug/Summary.tsx +7 -6
  37. package/src/modules/randomTimingForLight/ItemCard.tsx +4 -3
  38. package/src/modules/randomTimingForLight/RandomTimingForLightDetailPage.tsx +14 -13
  39. package/src/modules/randomTimingForLight/RandomTimingForLightPage.tsx +9 -8
  40. package/src/modules/randomTimingForLight/Summary.tsx +7 -6
  41. package/src/modules/remoteSwitch/RemoteSwitchPage.tsx +5 -4
  42. package/src/modules/select/SelectPage.tsx +10 -9
  43. package/src/modules/sleepWakeUp/SleepWakeUpDetailPage.tsx +24 -23
  44. package/src/modules/sleepWakeUp/SleepWakeUpPage.tsx +17 -16
  45. package/src/modules/switchGradient/SwitchGradientPage.tsx +4 -3
  46. package/src/modules/swithInching/SwithInching.tsx +7 -6
  47. package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +20 -19
  48. package/src/modules/timeSchedule/TimeSchedulePage.tsx +8 -7
  49. package/src/modules/timeSchedule/components/ManuaSettings.tsx +9 -9
  50. package/src/modules/timeSchedule/components/ScheduleCard.tsx +6 -4
  51. package/src/modules/timeSchedule/components/Summary.tsx +7 -6
  52. package/src/modules/timer/TimerPage.tsx +18 -17
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/group-ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.0.82",
7
+ "version": "1.0.84",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -20,6 +20,7 @@ import { useParams } from '@ledvance/base/src/hooks/Hooks'
20
20
  import Card from '@ledvance/base/src/components/Card'
21
21
  import { useSystemTimeFormate } from '@ledvance/base/src/models/modules/NativePropsSlice'
22
22
  import Spacer from '@ledvance/base/src/components/Spacer'
23
+ import ThemeType from '@ledvance/base/src/config/themeType'
23
24
 
24
25
  const cx = Utils.RatioUtils.convertX
25
26
  const { withTheme } = Utils.ThemeUtils
@@ -38,7 +39,7 @@ export interface BiorhythmEditPageParams {
38
39
  showDeleteBtn?: boolean
39
40
  }
40
41
 
41
- const BiorhythmEditPage = (props: { theme?: any }) => {
42
+ const BiorhythmEditPage = (props: { theme?: ThemeType }) => {
42
43
  const navigation = useNavigation()
43
44
  const is24Hour = useSystemTimeFormate()
44
45
  const params = useParams<BiorhythmEditPageParams>()
@@ -119,7 +120,7 @@ const BiorhythmEditPage = (props: { theme?: any }) => {
119
120
  borderRadius: cx(4),
120
121
  },
121
122
  title: {
122
- color: props.theme.global.fontColor,
123
+ color: props.theme?.global.fontColor,
123
124
  fontSize: cx(16),
124
125
  fontFamily: 'helvetica_neue_lt_std_bd',
125
126
  paddingVertical: cx(16),
@@ -141,7 +142,7 @@ const BiorhythmEditPage = (props: { theme?: any }) => {
141
142
  <View
142
143
  style={{
143
144
  marginHorizontal: cx(24),
144
- backgroundColor: props.theme.global.background,
145
+ backgroundColor: props.theme?.global.background,
145
146
  }}>
146
147
  <View style={{ height: cx(20) }} />
147
148
  <TextField
@@ -157,8 +158,8 @@ const BiorhythmEditPage = (props: { theme?: any }) => {
157
158
  <Spacer />
158
159
  <TimerPicker
159
160
  itemTextColor='#aeadb5'
160
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
161
- pickerFontColor={props.theme.global.fontColor}
161
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
162
+ pickerFontColor={props.theme?.global.fontColor}
162
163
  is12Hours={!is24Hour}
163
164
  singlePicker={true}
164
165
  amText={I18n.getLang('manage_user_calendar_label_am')}
@@ -170,14 +171,14 @@ const BiorhythmEditPage = (props: { theme?: any }) => {
170
171
  }}
171
172
  />
172
173
  {minimumTipEnable() && <View style={{ flexDirection: 'row', marginVertical: cx(5) }}>
173
- <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }} source={res.ic_info} />
174
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }} source={res.ic_info} />
174
175
  <Text
175
- style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>{I18n.getLang('add_new_trigger_time_information_text')}</Text>
176
+ style={{ color: props.theme?.global.fontColor, fontSize: cx(12) }}>{I18n.getLang('add_new_trigger_time_information_text')}</Text>
176
177
  </View>}
177
178
  <Spacer />
178
179
  <View style={{ flexDirection: 'row' }}>
179
180
  <View style={{ flex: 1 }}>
180
- <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>{I18n.getLang('add_new_trigger_time_text')}</Text>
181
+ <Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>{I18n.getLang('add_new_trigger_time_text')}</Text>
181
182
  </View>
182
183
  <TouchableOpacity
183
184
  activeOpacity={1}
@@ -194,15 +195,15 @@ const BiorhythmEditPage = (props: { theme?: any }) => {
194
195
  <View
195
196
  style={{ flex: 1, flexDirection: 'row', justifyContent: 'flex-end', alignContent: 'center', alignItems: 'center' }}>
196
197
  <Image
197
- style={{ width: cx(24), height: cx(24), tintColor: props.theme.global.fontColor }}
198
+ style={{ width: cx(24), height: cx(24), tintColor: props.theme?.global.fontColor }}
198
199
  source={setImg()}
199
200
  />
200
- <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }} source={BiologicalRes.biorhythom_select_rightIcon} />
201
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }} source={BiologicalRes.biorhythom_select_rightIcon} />
201
202
  </View>
202
203
  </TouchableOpacity>
203
204
  </View>
204
205
  <Text
205
- style={{ fontSize: cx(16), color: props.theme.global.fontColor, fontFamily: 'helvetica_neue_lt_std_bd', marginTop: cx(33), marginBottom: cx(16) }}>
206
+ style={{ fontSize: cx(16), color: props.theme?.global.fontColor, fontFamily: 'helvetica_neue_lt_std_bd', marginTop: cx(33), marginBottom: cx(16) }}>
206
207
  {I18n.getLang('add_new_trigger_time_subheadline_text')}
207
208
  </Text>
208
209
  <Card>
@@ -34,6 +34,7 @@ import Spacer from '@ledvance/base/src/components/Spacer'
34
34
  import ApplyForDeviceList from '@ledvance/base/src/components/ApplyForDeviceList'
35
35
  import DeleteButton from '@ledvance/base/src/components/DeleteButton'
36
36
  import InfoText from '@ledvance/base/src/components/InfoText'
37
+ import ThemeType from '@ledvance/base/src/config/themeType'
37
38
 
38
39
  const cx = Utils.RatioUtils.convertX
39
40
  const { withTheme } = Utils.ThemeUtils
@@ -54,7 +55,7 @@ export interface BiorhythmPageParams {
54
55
  isMixLight: boolean
55
56
  }
56
57
 
57
- const BiorhythmPage = (props: { theme?: any }) => {
58
+ const BiorhythmPage = (props: { theme?: ThemeType }) => {
58
59
  const navigation = useNavigation()
59
60
  const params = useParams<BiorhythmPageParams>()
60
61
  const [biorhythm, setBiorhythm] = useBiorhythm()
@@ -209,20 +210,20 @@ const BiorhythmPage = (props: { theme?: any }) => {
209
210
 
210
211
  const sunHomeText = string => {
211
212
  const text = string.split('SUN@HOME')
212
- return text?.length === 1 && <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>{text[0]}</Text> ||
213
+ return text?.length === 1 && <Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>{text[0]}</Text> ||
213
214
  <Text style={{
214
215
  fontSize: cx(14),
215
216
  flexDirection: 'row',
216
217
  }}>
217
- <Text style={{color: props.theme.global.fontColor }}>{text[0]}</Text>
218
+ <Text style={{color: props.theme?.global.fontColor }}>{text[0]}</Text>
218
219
  <Text onPress={openLink}
219
220
  style={{
220
221
  fontFamily: 'helvetica_neue_lt_std_roman',
221
- color: props.theme.button.primary,
222
+ color: props.theme?.button.primary,
222
223
  textDecorationLine: 'underline',
223
224
  flexWrap: 'wrap',
224
225
  }}>SUN@HOME</Text>
225
- <Text style={{color: props.theme.global.fontColor }}>{text[1]}</Text>
226
+ <Text style={{color: props.theme?.global.fontColor }}>{text[1]}</Text>
226
227
  </Text>
227
228
  }
228
229
 
@@ -249,7 +250,7 @@ const BiorhythmPage = (props: { theme?: any }) => {
249
250
  headlineText={I18n.getLang('add_new_trigger_time_system_back_text')}
250
251
  headlineIconContent={<Switch
251
252
  value={state.enable}
252
- thumbColor={props.theme.icon.primary}
253
+ thumbColor={props.theme?.icon.primary}
253
254
  trackColor={{ false: '#00000026', true: '#ff660036' }}
254
255
  onValueChange={async enable => {
255
256
  if (enable) return showDialog({
@@ -304,14 +305,14 @@ const BiorhythmPage = (props: { theme?: any }) => {
304
305
  justifyContent: 'center',
305
306
  alignItems: 'center',
306
307
  borderRadius: cx(20),
307
- backgroundColor: period.enabled ? props.theme.global.thirdBrand : props.theme.global.background,
308
+ backgroundColor: period.enabled ? props.theme?.global.thirdBrand : props.theme?.global.background,
308
309
  borderWidth: cx(1),
309
- borderColor: props.theme.global.brand,
310
+ borderColor: props.theme?.global.brand,
310
311
  }}
311
312
  >
312
313
  <Text
313
314
  style={{
314
- color: props.theme.global.brand,
315
+ color: props.theme?.global.brand,
315
316
  textAlign: 'center',
316
317
  }}
317
318
  >
@@ -323,10 +324,10 @@ const BiorhythmPage = (props: { theme?: any }) => {
323
324
  })}
324
325
  </View>
325
326
  <View style={{ marginHorizontal: cx(24), marginTop: cx(20) }}>
326
- <Text style={{color: props.theme.global.fontColor}}>{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 style={{color: props.theme.global.fontColor}}>
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 = (props: { theme?: any }) => {
338
339
  style={{
339
340
  flexDirection: 'row',
340
341
  borderRadius: cx(4),
341
- backgroundColor: props.theme.textInput.background,
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: props.theme.textInput.line,
347
+ borderBottomColor: props.theme?.textInput.line,
347
348
  }}
348
349
  >
349
350
  <Text style={{
350
351
  fontSize: cx(16),
351
- color: props.theme.textInput.fontColor,
352
+ color: props.theme?.textInput.fontColor,
352
353
  fontFamily: 'helvetica_neue_lt_std_roman',
353
354
  paddingLeft: cx(16),
354
355
  }}>
@@ -390,12 +391,12 @@ const BiorhythmPage = (props: { theme?: any }) => {
390
391
  }}>
391
392
  {state.planList.length === 8 && <View
392
393
  style={{ marginVertical: cx(10), flexDirection: 'row', alignItems: 'center', width: width - cx(48) }}>
393
- <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }} source={res.ic_warning_amber} />
394
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }} source={res.ic_warning_amber} />
394
395
  <Text
395
396
  style={{
396
397
  flexWrap: 'wrap',
397
398
  fontSize: cx(12),
398
- color: props.theme.global.fontColor
399
+ color: props.theme?.global.fontColor
399
400
  }}>{I18n.getLang('add_new_trigger_time_warning_max_number_text')}</Text>
400
401
  </View>}
401
402
  {state.planList.length < 8 &&
@@ -404,7 +405,7 @@ const BiorhythmPage = (props: { theme?: any }) => {
404
405
  style={{
405
406
  fontSize: cx(16),
406
407
  fontWeight: 'bold',
407
- color: props.theme.global.fontColor,
408
+ color: props.theme?.global.fontColor,
408
409
  }}>{I18n.getLang('bio_ryhthm_default_subheadline_text')}</Text>
409
410
  <TouchableOpacity
410
411
  onPress={() => {
@@ -446,7 +447,7 @@ const BiorhythmPage = (props: { theme?: any }) => {
446
447
  }
447
448
  navigation.navigate(ui_biz_routerKey.group_ui_biz_biological_detail, editPageParams)
448
449
  }}>
449
- <Image source={BiologicalRes.biorhythom_add} style={{ height: cx(24), width: cx(24), tintColor: props.theme.icon.primary }} />
450
+ <Image source={BiologicalRes.biorhythom_add} style={{ height: cx(24), width: cx(24), tintColor: props.theme?.icon.primary }} />
450
451
  </TouchableOpacity>
451
452
  </>
452
453
  }
@@ -465,9 +466,9 @@ const BiorhythmPage = (props: { theme?: any }) => {
465
466
  <View
466
467
  style={{
467
468
  height: cx(118),
468
- backgroundColor: props.theme.card.background,
469
+ backgroundColor: props.theme?.card.background,
469
470
  elevation: cx(7),
470
- shadowColor: props.theme.card.shadowColor,
471
+ shadowColor: props.theme?.card.shadowColor,
471
472
  shadowOpacity: 0.2,
472
473
  shadowRadius: cx(7),
473
474
  shadowOffset: {
@@ -518,13 +519,13 @@ const BiorhythmPage = (props: { theme?: any }) => {
518
519
  height: cx(24),
519
520
  marginStart: cx(10),
520
521
  marginRight: cx(6),
521
- tintColor: props.theme.icon.normal,
522
+ tintColor: props.theme?.icon.normal,
522
523
  }}
523
524
  />
524
525
  <Text
525
526
  style={{
526
527
  fontSize: cx(16),
527
- color: props.theme.global.fontColor,
528
+ color: props.theme?.global.fontColor,
528
529
  fontFamily: 'helvetica_neue_lt_std_roman',
529
530
  }}
530
531
  >
@@ -533,7 +534,7 @@ const BiorhythmPage = (props: { theme?: any }) => {
533
534
  </View>
534
535
  <Switch
535
536
  value={item.enable}
536
- thumbColor={props.theme.icon.primary}
537
+ thumbColor={props.theme?.icon.primary}
537
538
  trackColor={{ false: '#00000026', true: '#ff660036' }}
538
539
  onValueChange={e => {
539
540
  item.enable = e
@@ -546,7 +547,7 @@ const BiorhythmPage = (props: { theme?: any }) => {
546
547
  <Text
547
548
  style={{
548
549
  fontSize: cx(12),
549
- color: props.theme.global.secondFontColor,
550
+ color: props.theme?.global.secondFontColor,
550
551
  fontFamily: 'helvetica_neue_lt_std_roman',
551
552
  paddingLeft: cx(20),
552
553
  }}
@@ -6,6 +6,7 @@ import iconList from './iconListData'
6
6
  import LDVTopBar from '@ledvance/base/src/components/ldvTopBar'
7
7
  import I18n from '@ledvance/base/src/i18n'
8
8
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
9
+ import ThemeType from '@ledvance/base/src/config/themeType'
9
10
 
10
11
  const cx = Utils.RatioUtils.convertX
11
12
  const { withTheme } = Utils.ThemeUtils
@@ -16,7 +17,7 @@ interface IconSelectPageParams {
16
17
  iconIdList: any
17
18
  }
18
19
 
19
- function IconSelectPage(props: { theme?: any }) {
20
+ function IconSelectPage(props: { theme?: ThemeType }) {
20
21
  const [list, setList] = useState(iconList)
21
22
  const navigation = useNavigation()
22
23
  const params = useParams<IconSelectPageParams>()
@@ -52,7 +53,7 @@ function IconSelectPage(props: { theme?: any }) {
52
53
  />
53
54
  <ScrollView nestedScrollEnabled={true} style={{marginHorizontal: cx(24)}}>
54
55
  <View style={{marginTop: cx(40), marginBottom: cx(20)}}>
55
- <Text style={{fontSize: cx(24), color: props.theme.global.brand}}>{I18n.getLang('add_new_trigger_time_icon_selection_headline_text')}</Text>
56
+ <Text style={{fontSize: cx(24), color: props.theme?.global.brand}}>{I18n.getLang('add_new_trigger_time_icon_selection_headline_text')}</Text>
56
57
  </View>
57
58
  <View
58
59
  style={{flexDirection: 'row', flex: 1, flexWrap: 'wrap', justifyContent: 'space-between', alignItems: 'flex-start'}}>
@@ -71,7 +72,7 @@ function IconSelectPage(props: { theme?: any }) {
71
72
  width: cx(32),
72
73
  height: cx(32),
73
74
  margin: cx(10),
74
- tintColor: item?.selectStatus ? props.theme.icon.primary : item?.disabled && props.theme.icon.disable || props.theme.icon.normal,
75
+ tintColor: item?.selectStatus ? props.theme?.icon.primary : item?.disabled && props.theme?.icon.disable || props.theme?.icon.normal,
75
76
  }}
76
77
  />
77
78
  </TouchableOpacity>
@@ -8,6 +8,7 @@ import Spacer from "@ledvance/base/src/components/Spacer";
8
8
  import {View, Text, StyleSheet, Image} from "react-native";
9
9
  import {Result} from "@ledvance/base/src/models/modules/Result";
10
10
  import res from "@ledvance/base/src/res";
11
+ import ThemeType from '@ledvance/base/src/config/themeType'
11
12
 
12
13
  const { convertX: cx } = Utils.RatioUtils
13
14
  const { withTheme } = Utils.ThemeUtils
@@ -20,7 +21,7 @@ export function useChildLock(): [boolean, (v: boolean) => Promise<Result<any>>]
20
21
  return useFeatureHook<ChildLockConfig, boolean>('childLock', false)
21
22
  }
22
23
 
23
- const ChildLockPage = (props: { theme?: any }) => {
24
+ const ChildLockPage = (props: { theme?: ThemeType }) => {
24
25
  const devInfo = useDeviceInfo()
25
26
  const [childLock, setChildLock] = useChildLock()
26
27
  const state = useReactive({
@@ -37,7 +38,7 @@ const ChildLockPage = (props: { theme?: any }) => {
37
38
  width: cx(16),
38
39
  height: cx(16),
39
40
  marginRight: cx(5),
40
- tintColor: props.theme.global.fontColor
41
+ tintColor: props.theme?.global.fontColor
41
42
  },
42
43
  titleBGView: {
43
44
  flexDirection: 'row',
@@ -52,13 +53,13 @@ const ChildLockPage = (props: { theme?: any }) => {
52
53
  borderRadius: cx(4),
53
54
  },
54
55
  title: {
55
- color: props.theme.global.fontColor,
56
+ color: props.theme?.global.fontColor,
56
57
  fontSize: cx(14),
57
58
  fontFamily: 'helvetica_neue_lt_std_bd',
58
59
  paddingVertical: cx(16),
59
60
  },
60
61
  shadow: {
61
- shadowColor: props.theme.card.shadowColor,
62
+ shadowColor: props.theme?.card.shadowColor,
62
63
  shadowOpacity: 0.2,
63
64
  shadowRadius: 8,
64
65
  elevation:8,
@@ -66,7 +67,7 @@ const ChildLockPage = (props: { theme?: any }) => {
66
67
  width: 0,
67
68
  height: 4,
68
69
  },
69
- backgroundColor: props.theme.card.background,
70
+ backgroundColor: props.theme?.card.background,
70
71
  borderRadius: 8,
71
72
  },
72
73
  })
@@ -77,7 +78,7 @@ const ChildLockPage = (props: { theme?: any }) => {
77
78
  loading={state.loading}>
78
79
  <View style={styles.tipInfoContainer}>
79
80
  <Image style={styles.image} source={res.ic_info} />
80
- <Text style={{ color: props.theme.global.fontColor }}>
81
+ <Text style={{ color: props.theme?.global.fontColor }}>
81
82
  {I18n.getLang('childlock_overview_description_text')}
82
83
  </Text>
83
84
  </View>
@@ -10,6 +10,7 @@ import { exportFile } from "@ledvance/base/src/utils/common";
10
10
  import { OverviewItem } from "./EnergyConsumptionPage";
11
11
  import Spacer from "@ledvance/base/src/components/Spacer";
12
12
  import InfoText from "@ledvance/base/src/components/InfoText";
13
+ import ThemeType from '@ledvance/base/src/config/themeType'
13
14
 
14
15
  const { convertX: cx, height, width } = Utils.RatioUtils
15
16
  const { withTheme } = Utils.ThemeUtils
@@ -22,7 +23,7 @@ export interface EnergyConsumptionChartProps {
22
23
  over7Days?: boolean
23
24
  }
24
25
 
25
- const EnergyConsumptionChart = (props: { theme?: any }) => {
26
+ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
26
27
  const params = useRoute().params as EnergyConsumptionChartProps
27
28
  const computeNum = Platform.OS === 'ios' && 180 || 130
28
29
 
@@ -59,7 +60,7 @@ const EnergyConsumptionChart = (props: { theme?: any }) => {
59
60
  <InfoText
60
61
  text={I18n.getLang('energyconsumption_hourlylimit')}
61
62
  icon={res.ic_info}
62
- contentColor={props.theme.global.fontColor}
63
+ contentColor={props.theme?.global.fontColor}
63
64
  />
64
65
  </View>
65
66
  ) : (
@@ -20,6 +20,7 @@ import { EnergyConsumptionChartProps } from "./EnergyConsumptionChart";
20
20
  import { overDays } from "@ledvance/base/src/utils";
21
21
  import EnergyPopup, { EnergyData } from "./component/EnergyModal";
22
22
  import { carbonDioxideEmission, countryAndRegion } from "./co2Data";
23
+ import ThemeType from '@ledvance/base/src/config/themeType'
23
24
 
24
25
  const { convertX: cx } = Utils.RatioUtils
25
26
  const { withTheme } = Utils.ThemeUtils
@@ -34,7 +35,7 @@ export interface EnergyConsumptionDetailProps {
34
35
  updateEnergyData: (data: EnergyData) => {}
35
36
  }
36
37
 
37
- const EnergyConsumptionDetail = (props: { theme?: any }) => {
38
+ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
38
39
  const params = useRoute().params as EnergyConsumptionDetailProps
39
40
  const navigation = useNavigation()
40
41
  const timeZoneCity = useTimeZoneCity()
@@ -158,7 +159,7 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
158
159
  padding: cx(16)
159
160
  },
160
161
  cardTitle: {
161
- color: props.theme.global.fontColor,
162
+ color: props.theme?.global.fontColor,
162
163
  fontSize: cx(16),
163
164
  fontWeight: 'bold'
164
165
  },
@@ -167,7 +168,7 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
167
168
  flexDirection: 'row',
168
169
  },
169
170
  consumptionNum: {
170
- color: props.theme.global.secondBrand,
171
+ color: props.theme?.global.secondBrand,
171
172
  fontFamily: 'helvetica_neue_lt_std_bd',
172
173
  },
173
174
  subContent: {
@@ -178,19 +179,19 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
178
179
  valueText: {
179
180
  fontSize: cx(24),
180
181
  fontWeight: 'bold',
181
- color: props.theme.global.secondBrand,
182
+ color: props.theme?.global.secondBrand,
182
183
  },
183
184
  titleText: {
184
185
  fontFamily: 'helvetica_neue_lt_std_roman',
185
186
  fontSize: cx(14),
186
- color: props.theme.global.secondFontColor,
187
+ color: props.theme?.global.secondFontColor,
187
188
  textAlign: 'center',
188
189
  },
189
190
  priceBg: {
190
191
  height: cx(40),
191
192
  width: cx(40),
192
193
  borderRadius: cx(40),
193
- backgroundColor: props.theme.global.thirdBrand,
194
+ backgroundColor: props.theme?.global.thirdBrand,
194
195
  justifyContent: 'center',
195
196
  alignItems: 'center',
196
197
  marginRight: cx(10)
@@ -203,7 +204,7 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
203
204
  paddingHorizontal: cx(10),
204
205
  paddingVertical: cx(8),
205
206
  marginTop: cx(8),
206
- backgroundColor: props.theme.button.primary,
207
+ backgroundColor: props.theme?.button.primary,
207
208
  alignItems: 'center',
208
209
  justifyContent: 'center'
209
210
  }
@@ -242,12 +243,12 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
242
243
  <Image
243
244
  source={res.energy_consumption_cash}
244
245
  resizeMode="contain"
245
- style={{ height: cx(20), width: cx(20), tintColor: props.theme.button.active }}
246
+ style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.active }}
246
247
  />
247
248
  </View>
248
249
  <View style={styles.priceNum}>
249
250
  <View style={{ flexDirection: 'row' }}>
250
- <Text style={{ color: props.theme.global.secondFontColor, marginRight: cx(5) }}>{I18n.getLang('consumption_data_field3_co2_topic_text')}</Text>
251
+ <Text style={{ color: props.theme?.global.secondFontColor, marginRight: cx(5) }}>{I18n.getLang('consumption_data_field3_co2_topic_text')}</Text>
251
252
  <TouchableOpacity
252
253
  onPress={() => {
253
254
  state.showPopup = true
@@ -257,11 +258,11 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
257
258
  <Image
258
259
  source={res.co2Icon}
259
260
  resizeMode="contain"
260
- style={{ height: cx(20), width: cx(20), tintColor: props.theme.button.action }}
261
+ style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.action }}
261
262
  />
262
263
  </TouchableOpacity>
263
264
  </View>
264
- <Text style={{ color: props.theme.global.fontColor, fontWeight: 'bold' }}>{`${state.co2Saved} kg`}</Text>
265
+ <Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>{`${state.co2Saved} kg`}</Text>
265
266
  </View>
266
267
  </View>
267
268
  <Spacer height={cx(10)} />
@@ -272,20 +273,20 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
272
273
  <Image
273
274
  source={res.energy_consumption_cash}
274
275
  resizeMode="contain"
275
- style={{ height: cx(20), width: cx(20), tintColor: props.theme.button.active }}
276
+ style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.active }}
276
277
  />
277
278
  </View>
278
279
  <View>
279
280
  <View style={styles.priceNum}>
280
- <Text style={{ color: props.theme.global.secondFontColor }}>{I18n.getLang('consumption_data_field3_value_text2')}</Text>
281
- <Text style={{ color: props.theme.global.fontColor, fontWeight: 'bold' }}>{state.price ? `${localeNumber(Number(state.price) * Number(params.curMonth.value), 2)} ${state.unit}` : '-'}</Text>
281
+ <Text style={{ color: props.theme?.global.secondFontColor }}>{I18n.getLang('consumption_data_field3_value_text2')}</Text>
282
+ <Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>{state.price ? `${localeNumber(Number(state.price) * Number(params.curMonth.value), 2)} ${state.unit}` : '-'}</Text>
282
283
  </View>
283
284
  <TouchableOpacity onPress={() => {
284
285
  state.showPopup = true
285
286
  state.popupType = 'money'
286
287
  }}>
287
288
  <View style={styles.priceButton}>
288
- <Text style={{ color: props.theme.button.fontColor }}>{I18n.getLang('consumption_data_field3_button_text')}</Text>
289
+ <Text style={{ color: props.theme?.button.fontColor }}>{I18n.getLang('consumption_data_field3_button_text')}</Text>
289
290
  </View>
290
291
  </TouchableOpacity>
291
292
  </View>
@@ -27,6 +27,7 @@ import { carbonDioxideEmission, countryAndRegion } from './co2Data';
27
27
  import { EnergyConsumptionDetailProps } from './EnergyConsumptionDetail';
28
28
  import { EnergyConsumptionChartProps } from './EnergyConsumptionChart';
29
29
  import SegmentControl from '@ledvance/base/src/components/segmentControl';
30
+ import ThemeType from '@ledvance/base/src/config/themeType'
30
31
 
31
32
  const { convertX: cx } = Utils.RatioUtils;
32
33
  const { withTheme } = Utils.ThemeUtils;
@@ -67,7 +68,7 @@ interface EnergyConsumptionState {
67
68
  collapsed: boolean
68
69
  }
69
70
 
70
- const EnergyConsumptionPage = (props: { theme?: any }) => {
71
+ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
71
72
  const params = useRoute().params as EnergyConsumptionPageProps;
72
73
  const navigation = useNavigation();
73
74
  const timeZoneCity = useTimeZoneCity();
@@ -204,7 +205,7 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
204
205
  padding: cx(16),
205
206
  },
206
207
  cardTitle: {
207
- color: props.theme.global.fontColor,
208
+ color: props.theme?.global.fontColor,
208
209
  fontSize: cx(16),
209
210
  fontWeight: 'bold',
210
211
  },
@@ -213,7 +214,7 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
213
214
  flexDirection: 'row',
214
215
  },
215
216
  consumptionNum: {
216
- color: props.theme.global.secondBrand,
217
+ color: props.theme?.global.secondBrand,
217
218
  fontFamily: 'helvetica_neue_lt_std_bd',
218
219
  },
219
220
  subContent: {
@@ -224,19 +225,19 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
224
225
  valueText: {
225
226
  fontSize: cx(24),
226
227
  fontWeight: 'bold',
227
- color: props.theme.global.secondBrand,
228
+ color: props.theme?.global.secondBrand,
228
229
  },
229
230
  titleText: {
230
231
  fontFamily: 'helvetica_neue_lt_std_roman',
231
232
  fontSize: cx(14),
232
- color: props.theme.global.secondFontColor,
233
+ color: props.theme?.global.secondFontColor,
233
234
  textAlign: 'center',
234
235
  },
235
236
  priceBg: {
236
237
  height: cx(40),
237
238
  width: cx(40),
238
239
  borderRadius: cx(40),
239
- backgroundColor: props.theme.global.thirdBrand,
240
+ backgroundColor: props.theme?.global.thirdBrand,
240
241
  justifyContent: 'center',
241
242
  alignItems: 'center',
242
243
  marginRight: cx(10),
@@ -249,7 +250,7 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
249
250
  paddingHorizontal: cx(10),
250
251
  paddingVertical: cx(8),
251
252
  marginTop: cx(8),
252
- backgroundColor: props.theme.button.primary,
253
+ backgroundColor: props.theme?.button.primary,
253
254
  alignItems: 'center',
254
255
  justifyContent: 'center',
255
256
  },
@@ -377,14 +378,14 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
377
378
  style={{
378
379
  height: cx(20),
379
380
  width: cx(20),
380
- tintColor: props.theme.button.active,
381
+ tintColor: props.theme?.button.active,
381
382
  }}
382
383
  />
383
384
  </View>
384
385
  <View style={styles.priceNum}>
385
386
  <View style={{ flexDirection: 'row' }}>
386
387
  <Text
387
- style={{ color: props.theme.global.secondFontColor, marginRight: cx(5) }}
388
+ style={{ color: props.theme?.global.secondFontColor, marginRight: cx(5) }}
388
389
  >
389
390
  {I18n.getLang('consumption_data_field3_co2_topic_text')}
390
391
  </Text>
@@ -400,13 +401,13 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
400
401
  style={{
401
402
  height: cx(20),
402
403
  width: cx(20),
403
- tintColor: props.theme.button.active,
404
+ tintColor: props.theme?.button.active,
404
405
  }}
405
406
  />
406
407
  </TouchableOpacity>
407
408
  </View>
408
409
  <Text
409
- style={{ color: props.theme.global.fontColor, fontWeight: 'bold' }}
410
+ style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}
410
411
  >{`${state.co2Saved} kg`}</Text>
411
412
  </View>
412
413
  </View>
@@ -419,19 +420,19 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
419
420
  <Image
420
421
  source={res.energy_consumption_cash}
421
422
  resizeMode="contain"
422
- style={{ height: cx(20), width: cx(20), tintColor: props.theme.button.active }}
423
+ style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.active }}
423
424
  />
424
425
  </View>
425
426
  <View>
426
427
  <View style={styles.priceNum}>
427
- <Text style={{ color: props.theme.global.secondFontColor }}>
428
+ <Text style={{ color: props.theme?.global.secondFontColor }}>
428
429
  {I18n.getLang(
429
430
  state.isSolarMode
430
431
  ? 'consumption_data_monthly_overview_field1_text2'
431
432
  : 'consumption_data_field3_value_text2'
432
433
  )}
433
434
  </Text>
434
- <Text style={{ color: props.theme.global.fontColor, fontWeight: 'bold' }}>
435
+ <Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>
435
436
  {state.price
436
437
  ? `${localeNumber(Number(state.price) * Number(state.isSolarMode ? state.solarTotalElectricity : state.wifiTotalElectricity), 2)} ${state.unit
437
438
  }`
@@ -445,7 +446,7 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
445
446
  }}
446
447
  >
447
448
  <View style={styles.priceButton}>
448
- <Text style={{ color: props.theme.button.fontColor }}>
449
+ <Text style={{ color: props.theme?.button.fontColor }}>
449
450
  {I18n.getLang('consumption_data_field3_button_text')}
450
451
  </Text>
451
452
  </View>