@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
@@ -39,6 +39,7 @@ import LdvSwitch from '@ledvance/base/src/components/ldvSwitch';
39
39
  import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView';
40
40
  import { useParams } from '@ledvance/base/src/hooks/Hooks';
41
41
  import { showDialog } from '@ledvance/base/src/utils/common';
42
+ import ThemeType from '@ledvance/base/src/config/themeType'
42
43
 
43
44
  const cx = Utils.RatioUtils.convertX;
44
45
  const { withTheme } = Utils.ThemeUtils
@@ -49,7 +50,7 @@ interface MixDynamicMoodEditorPageState extends StaticMoodEditorPageState {
49
50
  secondaryIdx: number;
50
51
  sceneMode: StripLightMoodMode;
51
52
  }
52
- const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
53
+ const MixDynamicMoodEditorPage = (props: { theme?: ThemeType }) => {
53
54
  const navigation = useNavigation();
54
55
  const routeParams = useParams<StaticMoodEditorPageParams>();
55
56
  const params = cloneDeep(routeParams);
@@ -164,7 +165,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
164
165
  marginHorizontal: cx(16),
165
166
  },
166
167
  light: {
167
- color: props.theme.global.fontColor,
168
+ color: props.theme?.global.fontColor,
168
169
  fontSize: cx(18),
169
170
  fontFamily: 'helvetica_neue_lt_std_bd',
170
171
  },
@@ -220,17 +221,17 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
220
221
  borderRadius: cx(8),
221
222
  borderWidth: cx(1),
222
223
  borderStyle: 'dashed',
223
- borderColor: props.theme.addNode.border,
224
- backgroundColor: props.theme.addNode.background,
224
+ borderColor: props.theme?.addNode.border,
225
+ backgroundColor: props.theme?.addNode.background,
225
226
  },
226
227
  deleteBtn: {
227
228
  width: '100%',
228
229
  height: cx(50),
229
- backgroundColor: props.theme.button.delete,
230
+ backgroundColor: props.theme?.button.delete,
230
231
  borderRadius: cx(8),
231
232
  },
232
233
  deleteBtnText: {
233
- color: props.theme.button.fontColor,
234
+ color: props.theme?.button.fontColor,
234
235
  fontSize: cx(16),
235
236
  fontFamily: 'helvetica_neue_lt_std_bd',
236
237
  },
@@ -286,7 +287,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
286
287
  }}
287
288
  maxLength={33}
288
289
  showError={state.mood.name.length > 32 || nameRepeat}
289
- tipColor={nameRepeat ? props.theme.global.error : undefined}
290
+ tipColor={nameRepeat ? props.theme?.global.error : undefined}
290
291
  tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
291
292
  errorText={I18n.getLang(
292
293
  nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text'
@@ -295,7 +296,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
295
296
  <Card style={styles.adjustCard}>
296
297
  <LdvSwitch
297
298
  title={I18n.getLang('light_sources_tile_main_lighting_headline')}
298
- color={props.theme.card.background}
299
+ color={props.theme?.card.background}
299
300
  colorAlpha={1}
300
301
  enable={!!state.mood.mainLamp.enable}
301
302
  setEnable={v => {
@@ -365,7 +366,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
365
366
  <Image
366
367
  style={[
367
368
  styles.adjustButton,
368
- { tintColor: state.mainBucketSelected ? props.theme.icon.primary : props.theme.icon.normal },
369
+ { tintColor: state.mainBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal },
369
370
  ]}
370
371
  source={res.ic_paint_bucket}
371
372
  />
@@ -378,7 +379,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
378
379
  <Image
379
380
  style={[
380
381
  styles.adjustButton,
381
- { tintColor: state.mainBucketSelected ? props.theme.icon.normal : props.theme.icon.primary },
382
+ { tintColor: state.mainBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary },
382
383
  ]}
383
384
  source={res.ic_colorize}
384
385
  />
@@ -414,7 +415,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
414
415
  style={[
415
416
  styles.nodeDeleteIcon,
416
417
  {
417
- tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme.icon.disable : props.theme.icon.normal,
418
+ tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
418
419
  },
419
420
  ]}
420
421
  source={res.ic_mood_del}
@@ -446,7 +447,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
446
447
  style={{
447
448
  width: cx(18),
448
449
  height: cx(18),
449
- tintColor: props.theme.addNode.fontColor,
450
+ tintColor: props.theme?.addNode.fontColor,
450
451
  }}
451
452
  source={{ uri: res.add }}
452
453
  />
@@ -490,7 +491,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
490
491
  <Card style={styles.adjustCard}>
491
492
  <LdvSwitch
492
493
  title={I18n.getLang('light_sources_tile_sec_lighting_headline')}
493
- color={props.theme.card.background}
494
+ color={props.theme?.card.background}
494
495
  colorAlpha={1}
495
496
  enable={!!state.mood.secondaryLamp.enable}
496
497
  setEnable={v => {
@@ -630,7 +631,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
630
631
  <Image
631
632
  style={[
632
633
  styles.adjustButton,
633
- { tintColor: state.secondaryBucketSelected ? props.theme.icon.primary : props.theme.icon.normal },
634
+ { tintColor: state.secondaryBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal },
634
635
  ]}
635
636
  source={res.ic_paint_bucket}
636
637
  />
@@ -643,7 +644,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
643
644
  <Image
644
645
  style={[
645
646
  styles.adjustButton,
646
- { tintColor: state.secondaryBucketSelected ? props.theme.icon.normal : props.theme.icon.primary },
647
+ { tintColor: state.secondaryBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary },
647
648
  ]}
648
649
  source={res.ic_colorize}
649
650
  />
@@ -679,7 +680,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
679
680
  styles.nodeDeleteIcon,
680
681
  {
681
682
  tintColor:
682
- state.mood.secondaryLamp.nodes.length < 3 ? props.theme.icon.disable : props.theme.icon.normal,
683
+ state.mood.secondaryLamp.nodes.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
683
684
  },
684
685
  ]}
685
686
  source={res.ic_mood_del}
@@ -711,7 +712,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
711
712
  style={{
712
713
  width: cx(18),
713
714
  height: cx(18),
714
- tintColor: props.theme.addNode.fontColor,
715
+ tintColor: props.theme?.addNode.fontColor,
715
716
  }}
716
717
  source={{ uri: res.add }}
717
718
  />
@@ -10,6 +10,7 @@ import MoodColorsLine from '@ledvance/base/src/components/MoodColorsLine';
10
10
  import { MoodJumpGradientMode, MoodLampInfo, MoodUIInfo } from './Interface';
11
11
  import I18n from '@ledvance/base/src/i18n';
12
12
  import res from '@ledvance/base/src/res';
13
+ import ThemeType from '@ledvance/base/src/config/themeType'
13
14
 
14
15
  const cx = Utils.RatioUtils.convertX;
15
16
  const { withTheme } = Utils.ThemeUtils
@@ -22,7 +23,7 @@ interface LightCategory {
22
23
  }
23
24
 
24
25
  interface MoodItemProps extends ViewProps {
25
- theme?: any
26
+ theme?: ThemeType
26
27
  enable: boolean;
27
28
  isMix: boolean;
28
29
  mood: MoodUIInfo;
@@ -52,7 +53,7 @@ const MoodItem = (props: MoodItemProps) => {
52
53
  },
53
54
  headText: {
54
55
  flex: 1,
55
- color: props.theme.global.fontColor,
56
+ color: props.theme?.global.fontColor,
56
57
  fontSize: cx(16),
57
58
  fontFamily: 'helvetica_neue_lt_std_bd',
58
59
  lineHeight: cx(20),
@@ -63,12 +64,12 @@ const MoodItem = (props: MoodItemProps) => {
63
64
  moodTypeLabel: {
64
65
  marginStart: cx(16),
65
66
  paddingHorizontal: cx(12.5),
66
- backgroundColor: props.theme.tag.background,
67
+ backgroundColor: props.theme?.tag.background,
67
68
  borderRadius: cx(8),
68
69
  },
69
70
  moodTypeLabelText: {
70
71
  height: cx(16),
71
- color: props.theme.tag.fontColor,
72
+ color: props.theme?.tag.fontColor,
72
73
  fontSize: cx(10),
73
74
  textAlignVertical: 'center',
74
75
  fontFamily: 'helvetica_neue_lt_std_roman',
@@ -24,13 +24,14 @@ import { ui_biz_routerKey } from '../../navigation/Routers'
24
24
  import { cloneDeep, filter, map } from 'lodash';
25
25
  import { useFlagMode } from '../flags/FlagActions';
26
26
  import { WorkMode } from '@ledvance/base/src/utils/interface';
27
+ import ThemeType from '@ledvance/base/src/config/themeType'
27
28
 
28
29
  const cx = Utils.RatioUtils.convertX;
29
30
  const { withTheme } = Utils.ThemeUtils
30
31
 
31
32
  const MAX_MOOD_COUNT = 255;
32
33
 
33
- const MoodPage = (props: {theme?: any}) => {
34
+ const MoodPage = (props: {theme?: ThemeType}) => {
34
35
  const params = useParams<MoodPageParams>();
35
36
  const deviceInfo = useDeviceInfo();
36
37
  const uaGroupInfo = useUAGroupInfo()
@@ -266,7 +267,7 @@ const MoodPage = (props: {theme?: any}) => {
266
267
  right: cx(60),
267
268
  top: Platform.OS === 'android' ? cx(90) : cx(130),
268
269
  maxWidth: cx(200),
269
- backgroundColor: props.theme.card.background,
270
+ backgroundColor: props.theme?.card.background,
270
271
  },
271
272
  popoverItem: {
272
273
  padding: cx(5),
@@ -289,7 +290,7 @@ const MoodPage = (props: {theme?: any}) => {
289
290
  }}
290
291
  loading={state.loading}
291
292
  >
292
- {!params.isStripLight && <View style={styles.tagLine}>
293
+ {!params.isStripLight && !params.isStringLight && <View style={styles.tagLine}>
293
294
  <Tag
294
295
  checked={state.staticTagChecked}
295
296
  text={Strings.getLang('mood_overview_filter_name_text1')}
@@ -313,7 +314,7 @@ const MoodPage = (props: {theme?: any}) => {
313
314
  <InfoText
314
315
  icon={res.ic_warning_amber}
315
316
  text={Strings.getLang('mood_overview_warning_max_number_text')}
316
- contentColor={props.theme.global.warning}
317
+ contentColor={props.theme?.global.warning}
317
318
  />
318
319
  <Spacer height={cx(6)} />
319
320
  </View>
@@ -6,6 +6,7 @@ import { StyleSheet, View } from 'react-native';
6
6
  import Spacer from '@ledvance/base/src/components/Spacer';
7
7
  import { MoodJumpGradientMode, MoodUIInfo } from './Interface';
8
8
  import { MixMoodColorsLine } from './MoodItem';
9
+ import ThemeType from '@ledvance/base/src/config/themeType'
9
10
 
10
11
  const cx = Utils.RatioUtils.convertX;
11
12
  const { withTheme } = Utils.ThemeUtils
@@ -18,7 +19,7 @@ interface LightCategory {
18
19
  }
19
20
 
20
21
  interface RecommendMixMoodItemProps {
21
- theme?: any
22
+ theme?: ThemeType
22
23
  title: string;
23
24
  isMix: boolean;
24
25
  mood: MoodUIInfo;
@@ -46,7 +47,7 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
46
47
  width: cx(295)
47
48
  },
48
49
  title: {
49
- color: props.theme.global.fontColor,
50
+ color: props.theme?.global.fontColor,
50
51
  fontSize: cx(16),
51
52
  fontFamily: 'helvetica_neue_lt_std_bd',
52
53
  },
@@ -63,7 +64,7 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
63
64
  style={styles.content}
64
65
  titleStyle={styles.title}
65
66
  iconStyle={{
66
- color: props.theme.global.fontColor,
67
+ color: props.theme?.global.fontColor,
67
68
  size: cx(16),
68
69
  }}
69
70
  />
@@ -22,6 +22,7 @@ import { useParams } from '@ledvance/base/src/hooks/Hooks';
22
22
  import { ui_biz_routerKey } from '../../navigation/Routers'
23
23
  import LdvSwitch from '@ledvance/base/src/components/ldvSwitch';
24
24
  import { showDialog } from '@ledvance/base/src/utils/common';
25
+ import ThemeType from '@ledvance/base/src/config/themeType'
25
26
 
26
27
  const cx = Utils.RatioUtils.convertX;
27
28
  const { withTheme } = Utils.ThemeUtils
@@ -42,7 +43,7 @@ export interface StaticMoodEditorPageState {
42
43
  loading: boolean;
43
44
  }
44
45
 
45
- const StaticMoodEditorPage = (props: { theme?: any }) => {
46
+ const StaticMoodEditorPage = (props: { theme?: ThemeType }) => {
46
47
  const navigation = useNavigation();
47
48
  const routeParams = useParams<StaticMoodEditorPageParams>();
48
49
  const params = cloneDeep(routeParams);
@@ -143,11 +144,11 @@ const StaticMoodEditorPage = (props: { theme?: any }) => {
143
144
  deleteBtn: {
144
145
  width: '100%',
145
146
  height: cx(50),
146
- backgroundColor: props.theme.button.delete,
147
+ backgroundColor: props.theme?.button.delete,
147
148
  borderRadius: cx(8),
148
149
  },
149
150
  deleteBtnText: {
150
- color: props.theme.button.fontColor,
151
+ color: props.theme?.button.fontColor,
151
152
  fontSize: cx(16),
152
153
  fontFamily: 'helvetica_neue_lt_std_bd',
153
154
  },
@@ -183,7 +184,7 @@ const StaticMoodEditorPage = (props: { theme?: any }) => {
183
184
  }}
184
185
  maxLength={33}
185
186
  showError={state.mood.name.length > 32 || nameRepeat}
186
- tipColor={nameRepeat ? props.theme.global.error : undefined}
187
+ tipColor={nameRepeat ? props.theme?.global.error : undefined}
187
188
  tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
188
189
  errorText={I18n.getLang(
189
190
  nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text'
@@ -19,6 +19,8 @@ import { cloneDeep } from 'lodash'
19
19
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
20
20
  import { ColorParser } from '@ledvance/base/src/utils/ColorParser'
21
21
  import { WorkMode } from '@ledvance/base/src/utils/interface'
22
+ import ThemeType from '@ledvance/base/src/config/themeType'
23
+
22
24
  const { convertX: cx } = Utils.RatioUtils
23
25
  const { withTheme } = Utils.ThemeUtils
24
26
 
@@ -30,7 +32,7 @@ export interface MusicPageParams {
30
32
  isMixLight?: boolean
31
33
  }
32
34
 
33
- const MusicPage = (props: { theme?: any }) => {
35
+ const MusicPage = (props: { theme?: ThemeType }) => {
34
36
  const deviceInfo = useDeviceInfo()
35
37
  const tyGroupId = useUAGroupInfo().tyGroupId
36
38
  const params = useParams<MusicPageParams>()
@@ -108,7 +110,7 @@ const MusicPage = (props: { theme?: any }) => {
108
110
  marginBottom: cx(24)
109
111
  },
110
112
  tiptext: {
111
- color: props.theme.global.fontColor,
113
+ color: props.theme?.global.fontColor,
112
114
  fontSize: cx(14),
113
115
  lineHeight: cx(14),
114
116
  }
@@ -134,10 +136,10 @@ const MusicPage = (props: { theme?: any }) => {
134
136
  {params.dreamMusicDp && <TabBar
135
137
  type='radio'
136
138
  tabs={musicTabs}
137
- style={{ borderRadius: cx(8), backgroundColor: props.theme.segment.background, height: cx(36) }}
138
- tabTextStyle={{ color: props.theme.segment.fontColor, fontSize: cx(14) }}
139
- tabActiveTextStyle={{ color: props.theme.segment.fontColor, fontSize: cx(14), fontWeight: 'bold' }}
140
- activeColor={props.theme.segment.active}
139
+ style={{ borderRadius: cx(8), backgroundColor: props.theme?.segment.background, height: cx(36) }}
140
+ tabTextStyle={{ color: props.theme?.segment.fontColor, fontSize: cx(14) }}
141
+ tabActiveTextStyle={{ color: props.theme?.segment.fontColor, fontSize: cx(14), fontWeight: 'bold' }}
142
+ activeColor={props.theme?.segment.active}
141
143
  activeKey={state.musicData.musicType}
142
144
  onChange={async (v) => {
143
145
  state.musicData.musicType = Number(v)
@@ -7,6 +7,7 @@ import {useReactive} from "ahooks";
7
7
  import Spacer from "@ledvance/base/src/components/Spacer";
8
8
  import {StyleSheet, Text, View} from "react-native";
9
9
  import {Result} from "@ledvance/base/src/models/modules/Result";
10
+ import ThemeType from '@ledvance/base/src/config/themeType'
10
11
 
11
12
  const { convertX: cx } = Utils.RatioUtils
12
13
  const { withTheme } = Utils.ThemeUtils
@@ -19,7 +20,7 @@ export function useOverchargeSwitch(): [boolean, (v: boolean) => Promise<Result<
19
20
  return useFeatureHook<OverchargeSwitchConfig, boolean>('overchargeSwitch', false)
20
21
  }
21
22
 
22
- const OverchargeSwitchPage = (props: { theme?: any }) => {
23
+ const OverchargeSwitchPage = (props: { theme?: ThemeType }) => {
23
24
  const devInfo = useDeviceInfo()
24
25
  const [overchargeSwitch, setOverchargeSwitch] = useOverchargeSwitch()
25
26
  const state = useReactive({
@@ -35,16 +36,16 @@ const OverchargeSwitchPage = (props: { theme?: any }) => {
35
36
  marginTop: cx(30)
36
37
  },
37
38
  title: {
38
- color: props.theme.global.fontColor,
39
+ color: props.theme?.global.fontColor,
39
40
  fontSize: cx(14),
40
41
  fontFamily: 'helvetica_neue_lt_std_bd',
41
42
  paddingVertical: cx(16),
42
43
  },
43
44
  desc: {
44
- color: props.theme.global.fontColor,
45
+ color: props.theme?.global.fontColor,
45
46
  },
46
47
  shadow: {
47
- shadowColor: props.theme.card.shadowColor,
48
+ shadowColor: props.theme?.card.shadowColor,
48
49
  shadowOpacity: 0.2,
49
50
  shadowRadius: 8,
50
51
  elevation:8,
@@ -52,7 +53,7 @@ const OverchargeSwitchPage = (props: { theme?: any }) => {
52
53
  width: 0,
53
54
  height: 4,
54
55
  },
55
- backgroundColor: props.theme.card.background,
56
+ backgroundColor: props.theme?.card.background,
56
57
  borderRadius: 8,
57
58
  },
58
59
  })
@@ -5,13 +5,14 @@ import {StyleSheet, Text, View} from "react-native";
5
5
  import {SwitchButton, Utils} from "tuya-panel-kit";
6
6
  import {getIsClosed, loopText} from "@ledvance/base/src/utils/common";
7
7
  import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
8
+ import ThemeType from '@ledvance/base/src/config/themeType'
8
9
 
9
10
  const {convertX: cx} = Utils.RatioUtils
10
11
  const { withTheme } = Utils.ThemeUtils
11
12
  const {parseTimer} = Utils.TimeUtils
12
13
 
13
14
  export interface ItemCardProps<T> {
14
- theme?: any
15
+ theme?: ThemeType
15
16
  item: T & {
16
17
  enable: boolean
17
18
  startTime: number
@@ -42,14 +43,14 @@ const ItemCard = <T, >(props: ItemCardProps<T>) => {
42
43
  },
43
44
  time: {
44
45
  flex: 1,
45
- color: props.theme.global.fontColor,
46
+ color: props.theme?.global.fontColor,
46
47
  fontSize: cx(16),
47
48
  fontWeight: 'bold',
48
49
  fontFamily: 'helvetica_neue_lt_std_bd',
49
50
  },
50
51
  switchBtn: {},
51
52
  loopText: {
52
- color: props.theme.global.fontColor,
53
+ color: props.theme?.global.fontColor,
53
54
  fontSize: cx(14),
54
55
  fontFamily: 'helvetica_neue_lt_std_roman',
55
56
  },
@@ -18,6 +18,7 @@ import {cloneDeep, isEqual} from "lodash";
18
18
  import Summary from "./Summary";
19
19
  import {RandomTimeParam} from "./RandomTimeForPlugAction";
20
20
  import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
21
+ import ThemeType from '@ledvance/base/src/config/themeType'
21
22
 
22
23
  const {parseTimer} = Utils.TimeUtils
23
24
  const { withTheme } = Utils.ThemeUtils
@@ -41,7 +42,7 @@ const newRandomTimeItem = (): RandomTimeItem => {
41
42
  }
42
43
  }
43
44
 
44
- const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
45
+ const RandomTimeForPlugDetailPage = (props: { theme?: ThemeType }) => {
45
46
  const navigation = useNavigation()
46
47
  const params = useRoute().params as RandomTimeDetailParam
47
48
  const initItem = newRandomTimeItem();
@@ -109,13 +110,13 @@ const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
109
110
  marginHorizontal: cx(24)
110
111
  },
111
112
  itemTitle: {
112
- color: props.theme.global.fontColor,
113
+ color: props.theme?.global.fontColor,
113
114
  fontSize: cx(16),
114
115
  fontWeight: 'bold',
115
116
  fontFamily: 'helvetica_neue_lt_std_bd',
116
117
  },
117
118
  applyContent: {
118
- backgroundColor: props.theme.container.background,
119
+ backgroundColor: props.theme?.container.background,
119
120
  borderRadius: 4,
120
121
  minHeight: cx(55),
121
122
  flex: 1,
@@ -128,7 +129,7 @@ const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
128
129
  flexDirection: 'row',
129
130
  justifyContent: 'space-between',
130
131
  alignItems: 'center',
131
- backgroundColor: props.theme.global.background,
132
+ backgroundColor: props.theme?.global.background,
132
133
  height: cx(35),
133
134
  },
134
135
  })
@@ -162,8 +163,8 @@ const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
162
163
  {/* pick */}
163
164
  <TimerPicker
164
165
  itemTextColor="#aeadb5"
165
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
166
- pickerFontColor={props.theme.global.fontColor}
166
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
167
+ pickerFontColor={props.theme?.global.fontColor}
167
168
  is12Hours={!params.is24Hour}
168
169
  startTime={state.item.startTime}
169
170
  endTime={state.item.endTime}
@@ -179,7 +180,7 @@ const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
179
180
  state.item.weeks[rawIndex] = state.item.weeks[rawIndex] === 1 ? 0 : 1
180
181
  }}/>
181
182
  <Spacer/>
182
- <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
183
+ <Text style={{ ...styles.cardContainer, color: props.theme?.global.fontColor, fontSize: cx(14) }}>
183
184
  {loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
184
185
  </Text>
185
186
  <Spacer/>
@@ -189,17 +190,17 @@ const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
189
190
  <Spacer height={cx(10)}/>
190
191
  <View style={styles.applyContent}>
191
192
  {state.item.channel === undefined ?
192
- <Text style={{color: props.theme.global.fontColor}}>
193
+ <Text style={{color: props.theme?.global.fontColor}}>
193
194
  {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
194
195
  </Text> :
195
196
  <View style={[styles.applyItem, {marginBottom: cx(10), borderRadius: 4}]}>
196
- <Text style={{color: props.theme.global.fontColor}}>{params.channels[state.item.channel]}</Text>
197
+ <Text style={{color: props.theme?.global.fontColor}}>{params.channels[state.item.channel]}</Text>
197
198
  {params.channels.length > 1 && <TouchableOpacity
198
199
  onPress={() => {
199
200
  state.item.channel = undefined
200
201
  }}
201
202
  style={{paddingHorizontal: cx(5)}}>
202
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.ic_arrows_nav_clear}/>
203
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.ic_arrows_nav_clear}/>
203
204
  </TouchableOpacity>}
204
205
  </View>
205
206
  }
@@ -216,8 +217,8 @@ const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
216
217
  state.item.channel = index
217
218
  }}
218
219
  >
219
- <Text style={{color: props.theme.global.fontColor}}>{item}</Text>
220
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.device_panel_timer_add}/>
220
+ <Text style={{color: props.theme?.global.fontColor}}>{item}</Text>
221
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.device_panel_timer_add}/>
221
222
  </TouchableOpacity>
222
223
  )
223
224
  })}
@@ -13,12 +13,13 @@ import Spacer from "@ledvance/base/src/components/Spacer";
13
13
  import ItemCard from "./ItemCard";
14
14
  import {cloneDeep} from "lodash";
15
15
  import InfoText from "@ledvance/base/src/components/InfoText";
16
+ import ThemeType from '@ledvance/base/src/config/themeType'
16
17
 
17
18
  const {convertX: cx, topBarHeight} = Utils.RatioUtils;
18
19
  const { withTheme } = Utils.ThemeUtils
19
20
  const MAX_NUM = 16
20
21
 
21
- const RandomTimeForPlugPage = (props: { theme?: any}) => {
22
+ const RandomTimeForPlugPage = (props: { theme?: ThemeType}) => {
22
23
  const devInfo = useDeviceInfo()
23
24
  const navigation = useNavigation()
24
25
  const params = useRoute().params as RandomTimeParam
@@ -75,16 +76,16 @@ const RandomTimeForPlugPage = (props: { theme?: any}) => {
75
76
  height: cx(198)
76
77
  },
77
78
  execTip: {
78
- color: props.theme.global.fontColor,
79
+ color: props.theme?.global.fontColor,
79
80
  marginLeft: cx(24),
80
81
  },
81
82
  maxImg: {
82
83
  width: cx(16),
83
84
  height: cx(16),
84
- tintColor: props.theme.global.warning
85
+ tintColor: props.theme?.global.warning
85
86
  },
86
87
  maxTip: {
87
- color: props.theme.global.secondFontColor,
88
+ color: props.theme?.global.secondFontColor,
88
89
  },
89
90
  addButton: {
90
91
  height: cx(36),
@@ -92,12 +93,12 @@ const RandomTimeForPlugPage = (props: { theme?: any}) => {
92
93
  marginVertical: cx(25),
93
94
  marginHorizontal: cx(24),
94
95
  borderRadius: cx(6),
95
- backgroundColor: props.theme.button.primary,
96
+ backgroundColor: props.theme?.button.primary,
96
97
  },
97
98
  addButtonText: {
98
99
  fontSize: cx(12),
99
100
  fontWeight: 'bold',
100
- color: props.theme.button.fontColor,
101
+ color: props.theme?.button.fontColor,
101
102
  textAlign: 'center'
102
103
  }
103
104
  })
@@ -149,7 +150,7 @@ const RandomTimeForPlugPage = (props: { theme?: any}) => {
149
150
  icon={res.device_panel_schedule_alert}
150
151
  text={I18n.getLang('randomtimecycle_empty_information_text')}
151
152
  textStyle={{flex: undefined}}
152
- contentColor={props.theme.global.secondFontColor}
153
+ contentColor={props.theme?.global.secondFontColor}
153
154
  />
154
155
  <View style={styles.addButton}>
155
156
  <TouchableOpacity
@@ -4,12 +4,13 @@ import res from "@ledvance/base/src/res"
4
4
  import I18n from "@ledvance/base/src/i18n";
5
5
  import { Utils } from "tuya-panel-kit";
6
6
  import Spacer from "@ledvance/base/src/components/Spacer";
7
+ import ThemeType from '@ledvance/base/src/config/themeType'
7
8
 
8
9
  const { convertX: cx } = Utils.RatioUtils;
9
10
  const { withTheme } = Utils.ThemeUtils
10
11
 
11
12
  interface SummaryProps {
12
- theme?: any
13
+ theme?: ThemeType
13
14
  style?: ViewStyle
14
15
  frequency?: string | ReactElement
15
16
  time?: string | ReactElement
@@ -24,7 +25,7 @@ const Summary = (props: SummaryProps) => {
24
25
  marginHorizontal: cx(24),
25
26
  },
26
27
  itemTitle: {
27
- color: props.theme.global.fontColor,
28
+ color: props.theme?.global.fontColor,
28
29
  fontSize: cx(16),
29
30
  fontWeight: 'bold',
30
31
  fontFamily: 'helvetica_neue_lt_std_bd',
@@ -40,14 +41,14 @@ const Summary = (props: SummaryProps) => {
40
41
  minWidth: cx(100)
41
42
  },
42
43
  summaryImg: {
43
- tintColor: props.theme.global.fontColor,
44
+ tintColor: props.theme?.global.fontColor,
44
45
  width: cx(12),
45
46
  height: cx(12),
46
47
  marginRight: cx(6)
47
48
  },
48
49
  leftTitle: {
49
50
  fontSize: cx(14),
50
- color: props.theme.global.fontColor,
51
+ color: props.theme?.global.fontColor,
51
52
  },
52
53
  summaryRight: {
53
54
  flex: 1,
@@ -58,10 +59,10 @@ const Summary = (props: SummaryProps) => {
58
59
  borderRadius: cx(16),
59
60
  paddingHorizontal: cx(12),
60
61
  alignSelf: 'flex-start',
61
- backgroundColor: props.theme.tag.background,
62
+ backgroundColor: props.theme?.tag.background,
62
63
  },
63
64
  rightItem: {
64
- color: props.theme.tag.fontColor,
65
+ color: props.theme?.tag.fontColor,
65
66
  },
66
67
  })
67
68
 
@@ -5,13 +5,14 @@ import {StyleSheet, Text, View} from "react-native";
5
5
  import {SwitchButton, Utils} from "tuya-panel-kit";
6
6
  import {getIsClosed, loopText} from "@ledvance/base/src/utils/common";
7
7
  import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
8
+ import ThemeType from '@ledvance/base/src/config/themeType'
8
9
 
9
10
  const {convertX: cx} = Utils.RatioUtils
10
11
  const { withTheme } = Utils.ThemeUtils
11
12
  const {parseTimer} = Utils.TimeUtils
12
13
 
13
14
  export interface ItemCardProps<T> {
14
- theme?: any
15
+ theme?: ThemeType
15
16
  item: T & {
16
17
  power: boolean
17
18
  startTime: number
@@ -41,14 +42,14 @@ const ItemCard = <T, >(props: ItemCardProps<T>) => {
41
42
  },
42
43
  time: {
43
44
  flex: 1,
44
- color: props.theme.global.fontColor,
45
+ color: props.theme?.global.fontColor,
45
46
  fontSize: cx(16),
46
47
  fontWeight: 'bold',
47
48
  fontFamily: 'helvetica_neue_lt_std_bd',
48
49
  },
49
50
  switchBtn: {},
50
51
  loopText: {
51
- color: props.theme.global.fontColor,
52
+ color: props.theme?.global.fontColor,
52
53
  fontSize: cx(14),
53
54
  fontFamily: 'helvetica_neue_lt_std_roman',
54
55
  },