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

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
@@ -21,6 +21,7 @@ import LdvSwitch from "@ledvance/base/src/components/ldvSwitch";
21
21
  import LampAdjustView from "@ledvance/base/src/components/LampAdjustView";
22
22
  import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
23
23
  import LdvPickerView from "@ledvance/base/src/components/ldvPickerView";
24
+ import ThemeType from '@ledvance/base/src/config/themeType'
24
25
 
25
26
  const {parseTimer} = Utils.TimeUtils
26
27
  const {convertX: cx} = Utils.RatioUtils;
@@ -53,7 +54,7 @@ const newFixedTimingItem = (): FixedTimingItem => {
53
54
  }
54
55
  }
55
56
 
56
- const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
57
+ const FixedTimingForLightDetailPage = (props: { theme?: ThemeType }) => {
57
58
  const navigation = useNavigation()
58
59
  const params = useRoute().params as FixedTimeDetailParam
59
60
  const initItem = newFixedTimingItem();
@@ -163,13 +164,13 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
163
164
  marginHorizontal: cx(24)
164
165
  },
165
166
  itemTitle: {
166
- color: props.theme.global.fontColor,
167
+ color: props.theme?.global.fontColor,
167
168
  fontSize: cx(16),
168
169
  fontWeight: 'bold',
169
170
  fontFamily: 'helvetica_neue_lt_std_bd',
170
171
  },
171
172
  applyContent: {
172
- backgroundColor: props.theme.container.background,
173
+ backgroundColor: props.theme?.container.background,
173
174
  borderRadius: 4,
174
175
  minHeight: cx(55),
175
176
  flex: 1,
@@ -182,11 +183,11 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
182
183
  flexDirection: 'row',
183
184
  justifyContent: 'space-between',
184
185
  alignItems: 'center',
185
- backgroundColor: props.theme.global.background,
186
+ backgroundColor: props.theme?.global.background,
186
187
  height: cx(35),
187
188
  },
188
189
  rightTitle: {
189
- color: props.theme.tag.fontColor,
190
+ color: props.theme?.tag.fontColor,
190
191
  paddingLeft: cx(12),
191
192
  paddingRight: cx(12),
192
193
  fontSize: cx(10),
@@ -195,7 +196,7 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
195
196
  },
196
197
  filletCorner: {
197
198
  flexDirection: 'row',
198
- backgroundColor: props.theme.tag.background,
199
+ backgroundColor: props.theme?.tag.background,
199
200
  borderRadius: cx(16),
200
201
  alignSelf: 'flex-start'
201
202
  }
@@ -230,8 +231,8 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
230
231
  {/* pick */}
231
232
  <TimerPicker
232
233
  itemTextColor='#aeadb5'
233
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
234
- pickerFontColor={props.theme.global.fontColor}
234
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
235
+ pickerFontColor={props.theme?.global.fontColor}
235
236
  is12Hours={!params.is24Hour}
236
237
  startTime={state.item.startTime}
237
238
  endTime={state.item.endTime}
@@ -247,7 +248,7 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
247
248
  state.item.weeks[rawIndex] = state.item.weeks[rawIndex] === 1 ? 0 : 1
248
249
  }}/>
249
250
  <Spacer/>
250
- <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
251
+ <Text style={{ ...styles.cardContainer, color: props.theme?.global.fontColor, fontSize: cx(14) }}>
251
252
  {loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
252
253
  </Text>
253
254
  <Spacer/>
@@ -257,17 +258,17 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
257
258
  <Spacer height={cx(10)}/>
258
259
  <View style={styles.applyContent}>
259
260
  {state.item.channel === undefined ?
260
- <Text style={{color: props.theme.global.fontColor}}>
261
+ <Text style={{color: props.theme?.global.fontColor}}>
261
262
  {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
262
263
  </Text> :
263
264
  <View style={[styles.applyItem, {marginBottom: cx(10), borderRadius: 4}]}>
264
- <Text style={{color: props.theme.global.fontColor}}>{params.channels[state.item.channel]}</Text>
265
+ <Text style={{color: props.theme?.global.fontColor}}>{params.channels[state.item.channel]}</Text>
265
266
  {params.channels.length > 1 && <TouchableOpacity
266
267
  onPress={() => {
267
268
  state.item.channel = undefined
268
269
  }}
269
270
  style={{paddingHorizontal: cx(5)}}>
270
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.ic_arrows_nav_clear}/>
271
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.ic_arrows_nav_clear}/>
271
272
  </TouchableOpacity>}
272
273
  </View>
273
274
  }
@@ -284,8 +285,8 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
284
285
  state.item.channel = index
285
286
  }}
286
287
  >
287
- <Text style={{color: props.theme.global.fontColor}}>{item}</Text>
288
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.device_panel_timer_add}/>
288
+ <Text style={{color: props.theme?.global.fontColor}}>{item}</Text>
289
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.device_panel_timer_add}/>
289
290
  </TouchableOpacity>
290
291
  )
291
292
  })}
@@ -298,7 +299,7 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
298
299
  <Card>
299
300
  <LdvSwitch
300
301
  title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
301
- color={props.theme.card.background}
302
+ color={props.theme?.card.background}
302
303
  colorAlpha={1}
303
304
  enable={true}
304
305
  setEnable={() => { }}
@@ -343,11 +344,11 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
343
344
  <View style={styles.cardContainer}>
344
345
  <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline4_text')}</Text>
345
346
  {!isTimeEffective && <View style={{ flexDirection: 'row', alignItems: 'center' }}>
346
- <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }} source={res.ic_warning_amber} />
347
- <Text style={{ fontSize: cx(12), color: props.theme.global.warning }}>{I18n.getLang('addTimeCycle_warning_text')}</Text>
347
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }} source={res.ic_warning_amber} />
348
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.warning }}>{I18n.getLang('addTimeCycle_warning_text')}</Text>
348
349
  </View>}
349
350
  <View >
350
- <Text style={{ color: props.theme.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text')}</Text>
351
+ <Text style={{ color: props.theme?.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text')}</Text>
351
352
  <LdvPickerView
352
353
  hour={state.onHour}
353
354
  minute={state.onMinute}
@@ -357,7 +358,7 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
357
358
  />
358
359
  </View>
359
360
  <View>
360
- <Text style={{ color: props.theme.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text2')}</Text>
361
+ <Text style={{ color: props.theme?.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text2')}</Text>
361
362
  <LdvPickerView
362
363
  hour={state.offHour}
363
364
  minute={state.offMinute}
@@ -379,7 +380,7 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
379
380
  actions={<View style={{ flex: 1 }}>
380
381
  <>
381
382
  <View>
382
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
383
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
383
384
  {I18n.formatValue('feature_summary_action_txt_4', `${Number(state.onHour)}`, `${Number(state.onMinute)}`)}
384
385
  </Text>
385
386
  </View>
@@ -391,7 +392,7 @@ const FixedTimingForLightDetailPage = (props: { theme?: any }) => {
391
392
  </>
392
393
  <>
393
394
  <View>
394
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
395
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
395
396
  {I18n.formatValue('feature_summary_action_txt_6', `${Number(state.offHour)}`, `${Number(state.offMinute)}`)}
396
397
  </Text>
397
398
  </View>
@@ -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 = 4
20
21
 
21
- const FixedTimeForLightPage = (props: { theme?: any}) => {
22
+ const FixedTimeForLightPage = (props: { theme?: ThemeType}) => {
22
23
  const devInfo = useDeviceInfo()
23
24
  const navigation = useNavigation()
24
25
  const params = useRoute().params as FixedTimingParam
@@ -76,19 +77,19 @@ const FixedTimeForLightPage = (props: { theme?: any}) => {
76
77
  },
77
78
  emptyNoTime: {
78
79
  fontSize: cx(12),
79
- color: props.theme.global.fontColor,
80
+ color: props.theme?.global.fontColor,
80
81
  },
81
82
  execTip: {
82
- color: props.theme.global.fontColor,
83
+ color: props.theme?.global.fontColor,
83
84
  marginLeft: cx(24),
84
85
  },
85
86
  maxImg: {
86
87
  width: cx(16),
87
88
  height: cx(16),
88
- tintColor: props.theme.global.warning
89
+ tintColor: props.theme?.global.warning
89
90
  },
90
91
  maxTip: {
91
- color: props.theme.global.secondFontColor,
92
+ color: props.theme?.global.secondFontColor,
92
93
  },
93
94
  })
94
95
 
@@ -140,7 +141,7 @@ const FixedTimeForLightPage = (props: { theme?: any}) => {
140
141
  icon={res.device_panel_schedule_alert}
141
142
  text={I18n.getLang('fixedTimeCycle_information_text')}
142
143
  textStyle={{flex: undefined}}
143
- contentColor={props.theme.global.secondFontColor}
144
+ contentColor={props.theme?.global.secondFontColor}
144
145
  />
145
146
  <View
146
147
  style={{
@@ -149,7 +150,7 @@ const FixedTimeForLightPage = (props: { theme?: any}) => {
149
150
  marginVertical: cx(25),
150
151
  marginHorizontal: cx(24),
151
152
  borderRadius: cx(6),
152
- backgroundColor: props.theme.button.primary,
153
+ backgroundColor: props.theme?.button.primary,
153
154
  }}
154
155
  >
155
156
  <TouchableOpacity
@@ -160,7 +161,7 @@ const FixedTimeForLightPage = (props: { theme?: any}) => {
160
161
  }}
161
162
  onPress={() => onAddOrEditItem('add')}
162
163
  >
163
- <Text style={{fontSize: cx(12), fontWeight: 'bold', color: props.theme.button.fontColor, textAlign: 'center'}}>
164
+ <Text style={{fontSize: cx(12), fontWeight: 'bold', color: props.theme?.button.fontColor, textAlign: 'center'}}>
164
165
  {I18n.getLang('fixedTimeCycle_bttn_text')}
165
166
  </Text>
166
167
  </TouchableOpacity>
@@ -6,13 +6,14 @@ 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
8
  import {FixedTimingItem} from "./FixedTimingForLightAction";
9
+ import ThemeType from '@ledvance/base/src/config/themeType'
9
10
 
10
11
  const {convertX: cx} = Utils.RatioUtils
11
12
  const { withTheme } = Utils.ThemeUtils
12
13
  const {parseTimer} = Utils.TimeUtils
13
14
 
14
15
  export interface ItemCardProps {
15
- theme?: any
16
+ theme?: ThemeType
16
17
  item: FixedTimingItem,
17
18
  is24Hour?: boolean,
18
19
  onSwitch: (enable: boolean) => void
@@ -35,14 +36,14 @@ const ItemCard = (props: ItemCardProps) => {
35
36
  },
36
37
  time: {
37
38
  flex: 1,
38
- color: props.theme.global.fontColor,
39
+ color: props.theme?.global.fontColor,
39
40
  fontSize: cx(16),
40
41
  fontWeight: 'bold',
41
42
  fontFamily: 'helvetica_neue_lt_std_bd',
42
43
  },
43
44
  switchBtn: {},
44
45
  loopText: {
45
- color: props.theme.global.fontColor,
46
+ color: props.theme?.global.fontColor,
46
47
  fontSize: cx(14),
47
48
  fontFamily: 'helvetica_neue_lt_std_roman',
48
49
  },
@@ -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
 
@@ -21,6 +21,7 @@ import { FlagPageProps } from './FlagPage'
21
21
  import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView'
22
22
  import { showDialog } from '@ledvance/base/src/utils/common'
23
23
  import { cctToColor } from '@ledvance/base/src/utils/cctUtils'
24
+ import ThemeType from '@ledvance/base/src/config/themeType'
24
25
 
25
26
  const cx = Utils.RatioUtils.convertX
26
27
  const { withTheme } = Utils.ThemeUtils
@@ -33,7 +34,7 @@ export interface FlagEditParams {
33
34
  modDeleteFlag: (mode: 'add' | 'edit' | 'del', currentMood: FlagUiInfo, options?: FlagOption) => Promise<Result<any>>
34
35
  }
35
36
 
36
- const FlagEditPage = (props: { theme?: any }) => {
37
+ const FlagEditPage = (props: { theme?: ThemeType }) => {
37
38
  const navigation = useNavigation()
38
39
  const params = cloneDeep(useRoute().params as FlagEditParams)
39
40
  const state = useReactive({
@@ -101,7 +102,7 @@ const FlagEditPage = (props: { theme?: any }) => {
101
102
  marginHorizontal: cx(16),
102
103
  },
103
104
  light: {
104
- color: props.theme.global.fontColor,
105
+ color: props.theme?.global.fontColor,
105
106
  fontSize: cx(18),
106
107
  fontFamily: 'helvetica_neue_lt_std_bd',
107
108
  },
@@ -139,7 +140,7 @@ const FlagEditPage = (props: { theme?: any }) => {
139
140
  height: cx(40),
140
141
  borderRadius: cx(8),
141
142
  borderWidth: 1,
142
- borderColor: props.theme.card.border
143
+ borderColor: props.theme?.card.border
143
144
  },
144
145
  nodeDeleteBtn: {
145
146
  width: cx(24),
@@ -159,17 +160,17 @@ const FlagEditPage = (props: { theme?: any }) => {
159
160
  borderRadius: cx(8),
160
161
  borderWidth: cx(1),
161
162
  borderStyle: 'dashed',
162
- borderColor: props.theme.addNode.border,
163
- backgroundColor: props.theme.addNode.background,
163
+ borderColor: props.theme?.addNode.border,
164
+ backgroundColor: props.theme?.addNode.background,
164
165
  },
165
166
  deleteBtn: {
166
167
  width: '100%',
167
168
  height: cx(50),
168
- backgroundColor: props.theme.button.delete,
169
+ backgroundColor: props.theme?.button.delete,
169
170
  borderRadius: cx(8),
170
171
  },
171
172
  deleteBtnText: {
172
- color: props.theme.button.fontColor,
173
+ color: props.theme?.button.fontColor,
173
174
  fontSize: cx(16),
174
175
  fontFamily: 'helvetica_neue_lt_std_bd',
175
176
  },
@@ -213,7 +214,7 @@ const FlagEditPage = (props: { theme?: any }) => {
213
214
  }}
214
215
  maxLength={33}
215
216
  showError={state.mood.name.length > 32 || nameRepeat}
216
- tipColor={nameRepeat ? props.theme.global.error : undefined}
217
+ tipColor={nameRepeat ? props.theme?.global.error : undefined}
217
218
  tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
218
219
  errorText={I18n.getLang(nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text')} />
219
220
  {(params.moduleParams.isMixLight || params.moduleParams.isCeilingLight) && <><Card style={styles.adjustCard}>
@@ -292,7 +293,7 @@ const FlagEditPage = (props: { theme?: any }) => {
292
293
  state.colorPaintBucketSelected = true
293
294
  }}>
294
295
  <Image
295
- style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme.icon.primary : props.theme.icon.normal }]}
296
+ style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal }]}
296
297
  source={res.ic_paint_bucket} />
297
298
  </TouchableOpacity>
298
299
  <TouchableOpacity
@@ -300,7 +301,7 @@ const FlagEditPage = (props: { theme?: any }) => {
300
301
  state.colorPaintBucketSelected = false
301
302
  }}>
302
303
  <Image
303
- style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme.icon.normal : props.theme.icon.primary }]}
304
+ style={[styles.adjustButton, { tintColor: state.colorPaintBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary }]}
304
305
  source={res.ic_colorize} />
305
306
  </TouchableOpacity>
306
307
  </View>
@@ -332,7 +333,7 @@ const FlagEditPage = (props: { theme?: any }) => {
332
333
  style={[
333
334
  styles.nodeDeleteIcon,
334
335
  {
335
- tintColor: state.mood.colors.length < 3 ? props.theme.icon.disable : props.theme.icon.normal,
336
+ tintColor: state.mood.colors.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
336
337
  },
337
338
  ]}
338
339
  source={res.ic_mood_del} />
@@ -363,7 +364,7 @@ const FlagEditPage = (props: { theme?: any }) => {
363
364
  style={{
364
365
  width: cx(18),
365
366
  height: cx(18),
366
- tintColor: props.theme.global.fontColor,
367
+ tintColor: props.theme?.global.fontColor,
367
368
  }}
368
369
  source={{ uri: res.add }} />
369
370
  </TouchableOpacity>
@@ -4,12 +4,13 @@ import Card from '@ledvance/base/src/components/Card'
4
4
  import { SwitchButton, Utils } from 'tuya-panel-kit'
5
5
  import MoodColorsLine from '@ledvance/base/src/components/MoodColorsLine'
6
6
  import Spacer from '@ledvance/base/src/components/Spacer'
7
+ import ThemeType from '@ledvance/base/src/config/themeType'
7
8
 
8
9
  const cx = Utils.RatioUtils.convertX
9
10
  const { withTheme } = Utils.ThemeUtils
10
11
 
11
12
  interface RecommendMoodItemProps {
12
- theme?: any
13
+ theme?: ThemeType
13
14
  enable: boolean
14
15
  title: string
15
16
  colors: string[]
@@ -32,7 +33,7 @@ const FlagItem = (props: RecommendMoodItemProps) => {
32
33
  justifyContent: 'space-between',
33
34
  },
34
35
  headText: {
35
- color: props.theme.global.fontColor,
36
+ color: props.theme?.global.fontColor,
36
37
  fontSize: cx(16),
37
38
  fontFamily: 'helvetica_neue_lt_std_bd',
38
39
  lineHeight: cx(20),
@@ -66,7 +67,7 @@ const FlagItem = (props: RecommendMoodItemProps) => {
66
67
  <View style={styles.gradientItem}>
67
68
  <MoodColorsLine
68
69
  type={'separate'}
69
- nodeStyle={{ borderColor: props.theme.card.border, borderWidth: 1 }}
70
+ nodeStyle={{ borderColor: props.theme?.card.border, borderWidth: 1 }}
70
71
  colors={props.colors} />
71
72
  </View>
72
73
  <Spacer height={cx(16)} />
@@ -19,6 +19,8 @@ import TextField from "@ledvance/base/src/components/TextField";
19
19
  import { useParams } from "@ledvance/base/src/hooks/Hooks";
20
20
  import { WorkMode } from "@ledvance/base/src/utils/interface";
21
21
  import { showDialog } from "@ledvance/base/src/utils/common";
22
+ import ThemeType from '@ledvance/base/src/config/themeType'
23
+
22
24
  const cx = Utils.RatioUtils.convertX
23
25
  const { withTheme } = Utils.ThemeUtils
24
26
 
@@ -33,7 +35,7 @@ export interface FlagPageProps {
33
35
  switchLedCode: string
34
36
  }
35
37
 
36
- const FlagPage = (props: { theme?: any }) => {
38
+ const FlagPage = (props: { theme?: ThemeType }) => {
37
39
  const params = useParams<FlagPageProps>()
38
40
  const devInfo = useDeviceInfo()
39
41
  const uaGroupInfo = useUAGroupInfo()
@@ -170,7 +172,7 @@ const FlagPage = (props: { theme?: any }) => {
170
172
  })
171
173
  }}
172
174
  >
173
- <Image source={res.ic_refresh} style={{width: cx(24), height: cx(24), tintColor: props.theme.global.fontColor}}/>
175
+ <Image source={res.ic_refresh} style={{width: cx(24), height: cx(24), tintColor: props.theme?.global.fontColor}}/>
174
176
  </TouchableOpacity>
175
177
  </View>
176
178
  <FlatList
@@ -9,6 +9,7 @@ import Card from '@ledvance/base/src/components/Card'
9
9
  import res from '@ledvance/base/src/res'
10
10
  import {useReactive, useUpdateEffect} from 'ahooks'
11
11
  import {Result} from "@ledvance/base/src/models/modules/Result";
12
+ import ThemeType from '@ledvance/base/src/config/themeType'
12
13
 
13
14
  const { convertX: cx } = Utils.RatioUtils
14
15
  const { withTheme } = Utils.ThemeUtils
@@ -28,7 +29,7 @@ export function useLightMode(): [LightMode, (v: LightMode) => Promise<Result<any
28
29
  return useFeatureHook<LightModeConfig, LightMode>('lightMode', 'relay')
29
30
  }
30
31
 
31
- const LightModePage = (props: { theme?: any }) => {
32
+ const LightModePage = (props: { theme?: ThemeType }) => {
32
33
  const deviceInfo = useDeviceInfo()
33
34
  const [lightMode, setLightMode] = useLightMode()
34
35
 
@@ -47,25 +48,25 @@ const LightModePage = (props: { theme?: any }) => {
47
48
  },
48
49
  desc: {
49
50
  marginHorizontal: cx(24),
50
- color: props.theme.global.fontColor,
51
+ color: props.theme?.global.fontColor,
51
52
  fontSize: cx(14),
52
53
  fontWeight: 'bold',
53
54
  fontFamily: 'helvetica_neue_lt_std_bd',
54
55
  },
55
56
  tipText: {
56
57
  marginHorizontal: cx(24),
57
- color: props.theme.global.fontColor,
58
+ color: props.theme?.global.fontColor,
58
59
  fontSize: cx(14),
59
60
  fontFamily: 'helvetica_neue_lt_std_roman',
60
61
  },
61
62
  modeSelectGroup: {
62
63
  marginHorizontal: cx(24),
63
- backgroundColor: props.theme.container.background,
64
+ backgroundColor: props.theme?.container.background,
64
65
  borderRadius: cx(4),
65
66
  },
66
67
  modeTip: {
67
68
  marginHorizontal: cx(8),
68
- color: props.theme.global.fontColor,
69
+ color: props.theme?.global.fontColor,
69
70
  fontSize: cx(14),
70
71
  fontWeight: 'bold',
71
72
  fontFamily: 'helvetica_neue_lt_std_bd',
@@ -76,7 +77,7 @@ const LightModePage = (props: { theme?: any }) => {
76
77
  line: {
77
78
  height: cx(1),
78
79
  marginHorizontal: cx(12),
79
- backgroundColor: props.theme.container.divider,
80
+ backgroundColor: props.theme?.container.divider,
80
81
  },
81
82
  itemRoot: {
82
83
  flexDirection: 'row',
@@ -90,12 +91,12 @@ const LightModePage = (props: { theme?: any }) => {
90
91
  justifyContent: 'center',
91
92
  },
92
93
  itemTitle: {
93
- color: props.theme.global.fontColor,
94
+ color: props.theme?.global.fontColor,
94
95
  fontSize: cx(14),
95
96
  fontFamily: 'helvetica_neue_lt_std_roman',
96
97
  },
97
98
  itemContent: {
98
- color: props.theme.global.secondFontColor,
99
+ color: props.theme?.global.secondFontColor,
99
100
  fontSize: cx(14),
100
101
  fontFamily: 'helvetica_neue_lt_std_roman',
101
102
  },
@@ -17,6 +17,7 @@ import { Result } from '@ledvance/base/src/models/modules/Result';
17
17
  import { ui_biz_routerKey } from '../../navigation/Routers'
18
18
  import { difference, head, range } from 'lodash';
19
19
  import { RecommendMood, getRecommendMixMoods, getRecommendMoods } from './MoodInfo';
20
+ import ThemeType from '@ledvance/base/src/config/themeType'
20
21
 
21
22
  const cx = Utils.RatioUtils.convertX;
22
23
  const { withTheme } = Utils.ThemeUtils
@@ -33,7 +34,7 @@ interface AddMoodPageState {
33
34
  data: RecommendMood[];
34
35
  }
35
36
 
36
- const AddMoodPage = (props: { theme?: any }) => {
37
+ const AddMoodPage = (props: { theme?: ThemeType }) => {
37
38
  const navigation = useNavigation();
38
39
  const routeParams = useRoute().params as AddMoodPageParams;
39
40
  const moduleParams = routeParams.moduleParams;
@@ -84,7 +85,7 @@ const AddMoodPage = (props: { theme?: any }) => {
84
85
  flexDirection: 'column',
85
86
  },
86
87
  desc: {
87
- color: props.theme.global.fontColor,
88
+ color: props.theme?.global.fontColor,
88
89
  fontSize: cx(16),
89
90
  marginHorizontal: cx(24),
90
91
  marginTop: cx(12),
@@ -41,6 +41,7 @@ import Segmented from '@ledvance/base/src/components/Segmented';
41
41
  import { MoodNodeInfo } from './Interface';
42
42
  import { showDialog } from '@ledvance/base/src/utils/common';
43
43
  import { useParams } from '@ledvance/base/src/hooks/Hooks';
44
+ import ThemeType from '@ledvance/base/src/config/themeType'
44
45
 
45
46
  const cx = Utils.RatioUtils.convertX;
46
47
  const { withTheme } = Utils.ThemeUtils
@@ -53,7 +54,7 @@ interface DynamicMoodEditorPageState {
53
54
  loading: boolean;
54
55
 
55
56
  }
56
- const DynamicMoodEditorPage = (props: { theme?: any }) => {
57
+ const DynamicMoodEditorPage = (props: { theme?: ThemeType }) => {
57
58
  const navigation = useNavigation();
58
59
  const routeParams = useParams<StaticMoodEditorPageParams>()
59
60
  const params = cloneDeep(routeParams);
@@ -156,7 +157,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
156
157
  marginHorizontal: cx(16),
157
158
  },
158
159
  light: {
159
- color: props.theme.global.fontColor,
160
+ color: props.theme?.global.fontColor,
160
161
  fontSize: cx(18),
161
162
  fontFamily: 'helvetica_neue_lt_std_bd',
162
163
  },
@@ -212,17 +213,17 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
212
213
  borderRadius: cx(8),
213
214
  borderWidth: cx(1),
214
215
  borderStyle: 'dashed',
215
- borderColor: props.theme.addNode.border,
216
- backgroundColor: props.theme.addNode.background,
216
+ borderColor: props.theme?.addNode.border,
217
+ backgroundColor: props.theme?.addNode.background,
217
218
  },
218
219
  deleteBtn: {
219
220
  width: '100%',
220
221
  height: cx(50),
221
- backgroundColor: props.theme.button.delete,
222
+ backgroundColor: props.theme?.button.delete,
222
223
  borderRadius: cx(8),
223
224
  },
224
225
  deleteBtnText: {
225
- color: props.theme.button.fontColor,
226
+ color: props.theme?.button.fontColor,
226
227
  fontSize: cx(16),
227
228
  fontFamily: 'helvetica_neue_lt_std_bd',
228
229
  },
@@ -266,7 +267,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
266
267
  }}
267
268
  maxLength={33}
268
269
  showError={state.mood.name.length > 32 || nameRepeat}
269
- tipColor={nameRepeat ? props.theme.global.error : undefined}
270
+ tipColor={nameRepeat ? props.theme?.global.error : undefined}
270
271
  tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
271
272
  errorText={I18n.getLang(
272
273
  nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text'
@@ -383,7 +384,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
383
384
  <Image
384
385
  style={[
385
386
  styles.adjustButton,
386
- { tintColor: state.mainBucketSelected ? props.theme.icon.primary : props.theme.icon.normal },
387
+ { tintColor: state.mainBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal },
387
388
  ]}
388
389
  source={res.ic_paint_bucket}
389
390
  />
@@ -396,7 +397,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
396
397
  <Image
397
398
  style={[
398
399
  styles.adjustButton,
399
- { tintColor: state.mainBucketSelected ? props.theme.icon.normal : props.theme.icon.primary },
400
+ { tintColor: state.mainBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary },
400
401
  ]}
401
402
  source={res.ic_colorize}
402
403
  />
@@ -431,7 +432,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
431
432
  style={[
432
433
  styles.nodeDeleteIcon,
433
434
  {
434
- tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme.icon.disable : props.theme.icon.normal,
435
+ tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
435
436
  },
436
437
  ]}
437
438
  source={res.ic_mood_del}
@@ -463,7 +464,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
463
464
  style={{
464
465
  width: cx(18),
465
466
  height: cx(18),
466
- tintColor: props.theme.global.fontColor,
467
+ tintColor: props.theme?.global.fontColor,
467
468
  }}
468
469
  source={{ uri: res.add }}
469
470
  />