@ledvance/group-ui-biz-bundle 1.0.81 → 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
@@ -2,8 +2,22 @@ import React from 'react';
2
2
  import { View } from 'react-native';
3
3
  import ECharts from '@ledvance/react-native-echarts-pro';
4
4
  import I18n from "@ledvance/base/src/i18n";
5
+ import ThemeType from "@ledvance/base/src/config/themeType";
6
+ import {Utils} from "tuya-panel-kit";
7
+ import {OverviewItem} from "../EnergyConsumptionPage";
5
8
 
6
- const BarChartWithTouch = ({ data, height, width }) => {
9
+ const { withTheme } = Utils.ThemeUtils
10
+
11
+ interface BarChartProps {
12
+ theme?: ThemeType
13
+ data: OverviewItem[]
14
+ height: number
15
+ width: number
16
+ }
17
+
18
+
19
+ const BarChartWithTouch = (props: BarChartProps) => {
20
+ const { data, height, width } = props
7
21
  const dataX = data?.map(item => { return item.chartTitle });
8
22
  const dataY = data?.map(item => { return item.value });
9
23
  const option = {
@@ -11,7 +25,7 @@ const BarChartWithTouch = ({ data, height, width }) => {
11
25
  text: I18n.getLang('consumption_data_annual_bar_chart_text'),
12
26
  textStyle: {
13
27
  fontSize: 14,
14
- color: "#666666",
28
+ color: props.theme?.global.secondFontColor,
15
29
  },
16
30
  top: 10,
17
31
  },
@@ -30,7 +44,7 @@ const BarChartWithTouch = ({ data, height, width }) => {
30
44
  },
31
45
  axisLabel: {
32
46
  show: true,
33
- color: '#999999',
47
+ color: props.theme?.global.secondFontColor,
34
48
  interval: 0,
35
49
  }
36
50
  },
@@ -55,7 +69,7 @@ const BarChartWithTouch = ({ data, height, width }) => {
55
69
  distance: 10, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
56
70
  verticalAlign: 'middle',
57
71
  textStyle: { // 数值样式
58
- color: 'black',
72
+ color: props.theme?.global.fontColor,
59
73
  fontSize: 12
60
74
  },
61
75
  },
@@ -90,4 +104,4 @@ const BarChartWithTouch = ({ data, height, width }) => {
90
104
  );
91
105
  };
92
106
 
93
- export default BarChartWithTouch;
107
+ export default withTheme(BarChartWithTouch)
@@ -8,6 +8,7 @@ import { TouchableOpacity, View, Text, TextInput, StyleSheet, Linking, FlatList,
8
8
  import { Utils, Modal, Popup } from "tuya-panel-kit";
9
9
  import { useReactive, useUpdateEffect } from "ahooks";
10
10
  import { cloneDeep } from "lodash";
11
+ import ThemeType from '@ledvance/base/src/config/themeType'
11
12
 
12
13
  const { convertX: cx, height } = Utils.RatioUtils
13
14
  const { withTheme } = Utils.ThemeUtils
@@ -24,7 +25,7 @@ export interface EnergyData {
24
25
  unit: string
25
26
  }
26
27
  interface EnergyModalProps {
27
- theme?: any
28
+ theme?: ThemeType
28
29
  visible: boolean
29
30
  popupType: 'money' | 'co2' | 'unit'
30
31
  title: string
@@ -51,14 +52,14 @@ const EnergyModal = (props: EnergyModalProps) => {
51
52
  const text = string.split(separators)
52
53
  const length = text.length - 1
53
54
  return <View>
54
- <Text style={{ color: props.theme.global.fontColor }}>{text[length - 6] + '.'}</Text>
55
+ <Text style={{ color: props.theme?.global.fontColor }}>{text[length - 6] + '.'}</Text>
55
56
  <Spacer />
56
- <Text style={{ color: props.theme.global.fontColor }}>{text[length - 5] + '.'}</Text>
57
+ <Text style={{ color: props.theme?.global.fontColor }}>{text[length - 5] + '.'}</Text>
57
58
  <Spacer />
58
- <Text style={{ color: props.theme.global.fontColor }}>{text[length - 4] + text[length - 3] + ':'}</Text>
59
+ <Text style={{ color: props.theme?.global.fontColor }}>{text[length - 4] + text[length - 3] + ':'}</Text>
59
60
  <Spacer />
60
61
  <Text
61
- style={{ textDecorationLine: 'underline', color: props.theme.button.active }}
62
+ style={{ textDecorationLine: 'underline', color: props.theme?.button.active }}
62
63
  onPress={() => openLink(`${text[length - 2]}:${text[length - 1]}${text[length]}`)}
63
64
  >
64
65
  {`${text[length - 2]}:${text[length - 1]}${text[length]}`}
@@ -73,7 +74,7 @@ const EnergyModal = (props: EnergyModalProps) => {
73
74
  const styles = StyleSheet.create({
74
75
  popupTip: {
75
76
  fontSize: cx(16),
76
- color: props.theme.global.fontColor,
77
+ color: props.theme?.global.fontColor,
77
78
  fontWeight: 'bold'
78
79
  },
79
80
  textInput: {
@@ -82,13 +83,13 @@ const EnergyModal = (props: EnergyModalProps) => {
82
83
  marginStart: cx(16),
83
84
  marginEnd: cx(6),
84
85
  fontSize: cx(16),
85
- color: props.theme.textInput.fontColor,
86
+ color: props.theme?.textInput.fontColor,
86
87
  fontFamily: 'helvetica_neue_lt_std_roman',
87
88
  },
88
89
  textInputGroup: {
89
90
  flexDirection: 'row',
90
91
  borderRadius: cx(4),
91
- backgroundColor: props.theme.textInput.background,
92
+ backgroundColor: props.theme?.textInput.background,
92
93
  alignItems: 'center',
93
94
  },
94
95
  iconTouchable: {
@@ -101,7 +102,7 @@ const EnergyModal = (props: EnergyModalProps) => {
101
102
  start: cx(4),
102
103
  end: cx(4),
103
104
  bottom: 0,
104
- backgroundColor: props.theme.textInput.line,
105
+ backgroundColor: props.theme?.textInput.line,
105
106
  },
106
107
  unitItem: {
107
108
  flexDirection: 'row',
@@ -120,12 +121,12 @@ const EnergyModal = (props: EnergyModalProps) => {
120
121
  <Spacer />
121
122
  <Text style={styles.popupTip}>{I18n.getLang('consumption_data_price_per_kwh_headline_text')}</Text>
122
123
  <Spacer height={cx(40)} />
123
- <Text style={{ fontSize: cx(14), color: props.theme.global.fontColor }}>{I18n.getLang('consumption_data_price_per_kwh_description_text')}</Text>
124
+ <Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>{I18n.getLang('consumption_data_price_per_kwh_description_text')}</Text>
124
125
  <Spacer height={cx(15)} />
125
126
  <View style={{ flexDirection: 'row', alignItems: 'center' }}>
126
127
  <View style={{ flex: 3 }}>
127
128
  <Spacer height={cx(4)} />
128
- <Text style={{ color: props.theme.global.secondFontColor, marginStart: cx(13), fontFamily: 'helvetica_neue_lt_std_bd' }}>{I18n.getLang('consumption_data_price_per_kwh_headline_text')}</Text>
129
+ <Text style={{ color: props.theme?.global.secondFontColor, marginStart: cx(13), fontFamily: 'helvetica_neue_lt_std_bd' }}>{I18n.getLang('consumption_data_price_per_kwh_headline_text')}</Text>
129
130
  <View style={styles.textInputGroup}>
130
131
  <TextInput
131
132
  value={state.energyData?.price}
@@ -169,7 +170,7 @@ const EnergyModal = (props: EnergyModalProps) => {
169
170
  data={UnitList}
170
171
  renderItem={({ item }) => (
171
172
  <View style={styles.unitItem}>
172
- <Text style={{ fontSize: cx(16), color: props.theme.global.fontColor }}>{item}</Text>
173
+ <Text style={{ fontSize: cx(16), color: props.theme?.global.fontColor }}>{item}</Text>
173
174
  {props.energyData && props.energyData.unit === item && <Image
174
175
  style={{ width: cx(16), height: cx(16) }}
175
176
  source={res.app_music_check}
@@ -178,7 +179,7 @@ const EnergyModal = (props: EnergyModalProps) => {
178
179
  </View>
179
180
  )}
180
181
  ItemSeparatorComponent={() => (
181
- <View style={{ flex: 1, height: 1, backgroundColor: props.theme.card.background }}></View>
182
+ <View style={{ flex: 1, height: 1, backgroundColor: props.theme?.card.background }}></View>
182
183
  )}
183
184
  keyExtractor={item => item}
184
185
  />
@@ -206,23 +207,23 @@ const EnergyModal = (props: EnergyModalProps) => {
206
207
  return (
207
208
  Popup.custom({
208
209
  title: (
209
- <View style={{ backgroundColor: props.theme.card.head, flexDirection: 'row', height: cx(60), justifyContent: 'space-between', alignItems: 'center', borderTopLeftRadius: cx(10), borderTopRightRadius: cx(10), paddingHorizontal: cx(8) }}>
210
+ <View style={{ backgroundColor: props.theme?.card.head, flexDirection: 'row', height: cx(60), justifyContent: 'space-between', alignItems: 'center', borderTopLeftRadius: cx(10), borderTopRightRadius: cx(10), paddingHorizontal: cx(8) }}>
210
211
  <TouchableOpacity onPress={() => Popup.close()}>
211
- <Text style={{ color: props.theme.global.secondBrand, fontSize: cx(16) }}>{I18n.getLang('auto_scan_system_cancel')}</Text>
212
+ <Text style={{ color: props.theme?.global.secondBrand, fontSize: cx(16) }}>{I18n.getLang('auto_scan_system_cancel')}</Text>
212
213
  </TouchableOpacity>
213
214
  </View>
214
215
  ),
215
216
  wrapperStyle: {
216
217
  height: height - cx(40),
217
- backgroundColor: props.theme.global.background
218
+ backgroundColor: props.theme?.global.background
218
219
  },
219
- footer: (<View style={{ backgroundColor: props.theme.global.background}}></View>),
220
+ footer: (<View style={{ backgroundColor: props.theme?.global.background}}></View>),
220
221
  onMaskPress: () => { },
221
222
  motionType: 'none',
222
223
  useKeyboardView: true,
223
224
  content: (
224
225
  <View
225
- style={{ backgroundColor: props.theme.global.background, paddingHorizontal: cx(16) }}>
226
+ style={{ backgroundColor: props.theme?.global.background, paddingHorizontal: cx(16) }}>
226
227
  <Spacer />
227
228
  <Card>
228
229
  <FlatList
@@ -235,7 +236,7 @@ const EnergyModal = (props: EnergyModalProps) => {
235
236
  }}
236
237
  >
237
238
  <View style={styles.unitItem}>
238
- <Text style={{ fontSize: cx(16), color: props.theme.global.fontColor }}>{item}</Text>
239
+ <Text style={{ fontSize: cx(16), color: props.theme?.global.fontColor }}>{item}</Text>
239
240
  {energyData && energyData.unit === item && <Image
240
241
  style={{ width: cx(16), height: cx(16) }}
241
242
  source={res.app_music_check}
@@ -245,7 +246,7 @@ const EnergyModal = (props: EnergyModalProps) => {
245
246
  </TouchableOpacity>
246
247
  )}
247
248
  ItemSeparatorComponent={() => (
248
- <View style={{ flex: 1, height: 1, backgroundColor: props.theme.card.background }}></View>
249
+ <View style={{ flex: 1, height: 1, backgroundColor: props.theme?.card.background }}></View>
249
250
  )}
250
251
  keyExtractor={item => item}
251
252
  />
@@ -261,20 +262,20 @@ const EnergyModal = (props: EnergyModalProps) => {
261
262
  visible={props.visible}
262
263
  >
263
264
  <ScrollView>
264
- <View style={{ backgroundColor: props.theme.card.head, flexDirection: 'row', height: cx(60), justifyContent: 'space-between', alignItems: 'center', borderTopLeftRadius: cx(10), borderTopRightRadius: cx(10), paddingHorizontal: cx(8) }}>
265
+ <View style={{ backgroundColor: props.theme?.card.head, flexDirection: 'row', height: cx(60), justifyContent: 'space-between', alignItems: 'center', borderTopLeftRadius: cx(10), borderTopRightRadius: cx(10), paddingHorizontal: cx(8) }}>
265
266
  <TouchableOpacity onPress={() => {
266
267
  props.onCancel && props.onCancel()
267
268
  }}>
268
- <Text style={{ color: props.theme.button.cancel, fontSize: cx(16) }}>{props.cancelText}</Text>
269
+ <Text style={{ color: props.theme?.button.cancel, fontSize: cx(16) }}>{props.cancelText}</Text>
269
270
  </TouchableOpacity>
270
- <Text style={{ color: props.theme.global.fontColor, fontSize: cx(16), fontWeight: 'bold' }}>{props.title}</Text>
271
+ <Text style={{ color: props.theme?.global.fontColor, fontSize: cx(16), fontWeight: 'bold' }}>{props.title}</Text>
271
272
  <TouchableOpacity onPress={() => {
272
273
  props.onConfirm && props.onConfirm(state.energyData)
273
274
  }}>
274
- <Text style={{ color: props.theme.button.primary, fontSize: cx(16) }}>{props.confirmText}</Text>
275
+ <Text style={{ color: props.theme?.button.primary, fontSize: cx(16) }}>{props.confirmText}</Text>
275
276
  </TouchableOpacity>
276
277
  </View>
277
- <View style={{ height: height - cx(100), paddingHorizontal: cx(16), backgroundColor: props.theme.global.background }}>
278
+ <View style={{ height: height - cx(100), paddingHorizontal: cx(16), backgroundColor: props.theme?.global.background }}>
278
279
  {getContent()}
279
280
  </View>
280
281
  </ScrollView>
@@ -8,12 +8,13 @@ import { isEmpty } from "lodash";
8
8
  import { OverviewItem } from "../EnergyConsumptionPage";
9
9
  import { EnergyConsumptionChartProps } from "../EnergyConsumptionChart";
10
10
  import { useRoute } from '@react-navigation/core'
11
+ import ThemeType from '@ledvance/base/src/config/themeType'
11
12
 
12
13
  const { convertX: cx } = Utils.RatioUtils
13
14
  const { withTheme } = Utils.ThemeUtils
14
15
 
15
16
  interface OverViewProps {
16
- theme?: any
17
+ theme?: ThemeType
17
18
  style?: StyleProp<ViewStyle>
18
19
  headlineText?: string
19
20
  headlineClick?: () => void
@@ -34,22 +35,22 @@ const OverView = (props: OverViewProps) => {
34
35
  listEmptyTextIcon: {
35
36
  width: cx(16),
36
37
  height: cx(16),
37
- tintColor: props.theme.global.fontColor,
38
+ tintColor: props.theme?.global.fontColor,
38
39
  },
39
40
  listEmptyText: {
40
- color: props.theme.global.fontColor,
41
+ color: props.theme?.global.fontColor,
41
42
  fontSize: cx(12),
42
43
  fontFamily: 'helvetica_neue_lt_std_roman',
43
44
  },
44
45
  overviewItemText: {
45
- color: props.theme.global.fontColor,
46
+ color: props.theme?.global.fontColor,
46
47
  fontSize: cx(14)
47
48
  },
48
49
  })
49
50
  return (
50
51
  <View style={[props.style]}>
51
52
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
52
- <Text style={{ color: props.theme.global.fontColor, fontWeight: 'bold' }}>{props.headlineText}</Text>
53
+ <Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>{props.headlineText}</Text>
53
54
  {!isEmpty(props.overViewList) && <TouchableOpacity
54
55
  onPress={() => {
55
56
  props.headlineClick && props.headlineClick()
@@ -71,16 +72,16 @@ const OverView = (props: OverViewProps) => {
71
72
  props.overviewItemClick && props.overviewItemClick(item)
72
73
  }}
73
74
  >
74
- <View style={{ backgroundColor: props.theme.card.background, alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', }}>
75
+ <View style={{ backgroundColor: props.theme?.card.background, alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', }}>
75
76
  <Text style={styles.overviewItemText}>{item.key}</Text>
76
77
  <View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
77
78
  <View style={{ flexDirection: 'row' }}>
78
- <Text style={[styles.overviewItemText, { color: props.theme.global.secondFontColor }]}>{item.value}</Text>
79
- <Text style={[styles.overviewItemText, { color: props.theme.global.secondFontColor }]}> kWh</Text>
79
+ <Text style={[styles.overviewItemText, { color: props.theme?.global.secondFontColor }]}>{item.value}</Text>
80
+ <Text style={[styles.overviewItemText, { color: props.theme?.global.secondFontColor }]}> kWh</Text>
80
81
  </View>
81
82
  <Image
82
83
  source={res.energy_consumption_right}
83
- style={{ width: cx(16), height: cx(16), marginLeft: cx(8), tintColor: props.theme.global.secondFontColor }}
84
+ style={{ width: cx(16), height: cx(16), marginLeft: cx(8), tintColor: props.theme?.global.secondFontColor }}
84
85
  />
85
86
  </View>
86
87
  </View>
@@ -18,6 +18,7 @@ import Summary from "./Summary";
18
18
  import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
19
19
  import DeleteButton from "@ledvance/base/src/components/DeleteButton";
20
20
  import LdvPickerView from "@ledvance/base/src/components/ldvPickerView";
21
+ import ThemeType from '@ledvance/base/src/config/themeType'
21
22
 
22
23
  const {parseTimer} = Utils.TimeUtils
23
24
  const {convertX: cx} = Utils.RatioUtils;
@@ -43,7 +44,7 @@ const newFixedTimeItem = (): FixedTimeItem => {
43
44
  }
44
45
  }
45
46
 
46
- const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
47
+ const FixedTimeForPlugDetailPage = (props: { theme?: ThemeType }) => {
47
48
  const navigation = useNavigation()
48
49
  const params = useRoute().params as FixedTimeDetailParam
49
50
  const initItem = newFixedTimeItem();
@@ -136,13 +137,13 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
136
137
  marginHorizontal: cx(24)
137
138
  },
138
139
  itemTitle: {
139
- color: props.theme.global.fontColor,
140
+ color: props.theme?.global.fontColor,
140
141
  fontSize: cx(16),
141
142
  fontWeight: 'bold',
142
143
  fontFamily: 'helvetica_neue_lt_std_bd',
143
144
  },
144
145
  applyContent: {
145
- backgroundColor: props.theme.container.background,
146
+ backgroundColor: props.theme?.container.background,
146
147
  borderRadius: 4,
147
148
  minHeight: cx(55),
148
149
  flex: 1,
@@ -155,11 +156,11 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
155
156
  flexDirection: 'row',
156
157
  justifyContent: 'space-between',
157
158
  alignItems: 'center',
158
- backgroundColor: props.theme.global.background,
159
+ backgroundColor: props.theme?.global.background,
159
160
  height: cx(35),
160
161
  },
161
162
  rightTitle: {
162
- color: props.theme.tag.fontColor,
163
+ color: props.theme?.tag.fontColor,
163
164
  paddingLeft: cx(12),
164
165
  paddingRight: cx(12),
165
166
  fontSize: cx(10),
@@ -168,7 +169,7 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
168
169
  },
169
170
  filletCorner: {
170
171
  flexDirection: 'row',
171
- backgroundColor: props.theme.tag.background,
172
+ backgroundColor: props.theme?.tag.background,
172
173
  borderRadius: cx(16),
173
174
  alignSelf: 'flex-start'
174
175
  }
@@ -203,8 +204,8 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
203
204
  {/* pick */}
204
205
  <TimerPicker
205
206
  itemTextColor='#aeadb5'
206
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
207
- pickerFontColor={props.theme.global.fontColor}
207
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
208
+ pickerFontColor={props.theme?.global.fontColor}
208
209
  is12Hours={!params.is24Hour}
209
210
  startTime={state.item.startTime}
210
211
  endTime={state.item.endTime}
@@ -220,7 +221,7 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
220
221
  state.item.weeks[rawIndex] = state.item.weeks[rawIndex] === 1 ? 0 : 1
221
222
  }}/>
222
223
  <Spacer/>
223
- <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
224
+ <Text style={{ ...styles.cardContainer, color: props.theme?.global.fontColor, fontSize: cx(14) }}>
224
225
  {loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
225
226
  </Text>
226
227
  <Spacer/>
@@ -230,17 +231,17 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
230
231
  <Spacer height={cx(10)}/>
231
232
  <View style={styles.applyContent}>
232
233
  {state.item.channel === undefined ?
233
- <Text style={{color: props.theme.global.fontColor}}>
234
+ <Text style={{color: props.theme?.global.fontColor}}>
234
235
  {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
235
236
  </Text> :
236
237
  <View style={[styles.applyItem, {marginBottom: cx(10), borderRadius: 4}]}>
237
- <Text style={{color: props.theme.global.fontColor}}>{params.channels[state.item.channel]}</Text>
238
+ <Text style={{color: props.theme?.global.fontColor}}>{params.channels[state.item.channel]}</Text>
238
239
  {params.channels.length > 1 && <TouchableOpacity
239
240
  onPress={() => {
240
241
  state.item.channel = undefined
241
242
  }}
242
243
  style={{paddingHorizontal: cx(5)}}>
243
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.ic_arrows_nav_clear}/>
244
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.ic_arrows_nav_clear}/>
244
245
  </TouchableOpacity>}
245
246
  </View>
246
247
  }
@@ -257,8 +258,8 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
257
258
  state.item.channel = index
258
259
  }}
259
260
  >
260
- <Text style={{color: props.theme.global.fontColor}}>{item}</Text>
261
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.device_panel_timer_add}/>
261
+ <Text style={{color: props.theme?.global.fontColor}}>{item}</Text>
262
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.device_panel_timer_add}/>
262
263
  </TouchableOpacity>
263
264
  )
264
265
  })}
@@ -267,11 +268,11 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
267
268
  <View style={styles.cardContainer}>
268
269
  <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline4_text')}</Text>
269
270
  {!isTimeEffective && <View style={{ flexDirection: 'row', alignItems: 'center' }}>
270
- <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }} source={res.ic_warning_amber} />
271
- <Text style={{ fontSize: cx(12), color: props.theme.global.warning }}>{I18n.getLang('addTimeCycle_warning_text')}</Text>
271
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }} source={res.ic_warning_amber} />
272
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.warning }}>{I18n.getLang('addTimeCycle_warning_text')}</Text>
272
273
  </View>}
273
274
  <View >
274
- <Text style={{ color: props.theme.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text')}</Text>
275
+ <Text style={{ color: props.theme?.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text')}</Text>
275
276
  <LdvPickerView
276
277
  hour={state.onHour}
277
278
  minute={state.onMinute}
@@ -281,7 +282,7 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
281
282
  />
282
283
  </View>
283
284
  <View>
284
- <Text style={{ color: props.theme.global.fontColor, marginVertical: cx(10) }}>
285
+ <Text style={{ color: props.theme?.global.fontColor, marginVertical: cx(10) }}>
285
286
  {I18n.getLang('addTimeCycle_settings_sec_text2')}
286
287
  </Text>
287
288
  <LdvPickerView
@@ -305,7 +306,7 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
305
306
  actions={<View style={{ flex: 1 }}>
306
307
  <>
307
308
  <View>
308
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
309
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
309
310
  {I18n.formatValue('feature_summary_action_txt_4', `${Number(state.onHour)}`, `${Number(state.onMinute)}`)}
310
311
  </Text>
311
312
  </View>
@@ -317,7 +318,7 @@ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
317
318
  </>
318
319
  <>
319
320
  <View>
320
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
321
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
321
322
  {I18n.formatValue('feature_summary_action_txt_6', `${Number(state.offHour)}`, `${Number(state.offMinute)}`)}
322
323
  </Text>
323
324
  </View>
@@ -13,12 +13,13 @@ import Spacer from "@ledvance/base/src/components/Spacer";
13
13
  import {Utils} from "tuya-panel-kit";
14
14
  import ItemCard from "./ItemCard";
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 = 10
20
21
 
21
- const FixedTimeForPlugPage = (props: { theme?: any}) => {
22
+ const FixedTimeForPlugPage = (props: { theme?: ThemeType}) => {
22
23
  const devInfo = useDeviceInfo()
23
24
  const navigation = useNavigation()
24
25
  const params = useRoute().params as FixedTimeParam
@@ -75,16 +76,16 @@ const FixedTimeForPlugPage = (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
  })
90
91
 
@@ -135,7 +136,7 @@ const FixedTimeForPlugPage = (props: { theme?: any}) => {
135
136
  icon={res.device_panel_schedule_alert}
136
137
  text={I18n.getLang('fixedTimeCycle_information_text')}
137
138
  textStyle={{flex: undefined}}
138
- contentColor={props.theme.global.secondFontColor}
139
+ contentColor={props.theme?.global.secondFontColor}
139
140
  />
140
141
  <View
141
142
  style={{
@@ -144,7 +145,7 @@ const FixedTimeForPlugPage = (props: { theme?: any}) => {
144
145
  marginVertical: cx(25),
145
146
  marginHorizontal: cx(24),
146
147
  borderRadius: cx(6),
147
- backgroundColor: props.theme.button.primary,
148
+ backgroundColor: props.theme?.button.primary,
148
149
  }}
149
150
  >
150
151
  <TouchableOpacity
@@ -155,7 +156,7 @@ const FixedTimeForPlugPage = (props: { theme?: any}) => {
155
156
  }}
156
157
  onPress={() => onAddOrEditItem('add')}
157
158
  >
158
- <Text style={{fontSize: cx(12), fontWeight: 'bold', color: props.theme.button.fontColor, textAlign: 'center'}}>
159
+ <Text style={{fontSize: cx(12), fontWeight: 'bold', color: props.theme?.button.fontColor, textAlign: 'center'}}>
159
160
  {I18n.getLang('fixedTimeCycle_bttn_text')}
160
161
  </Text>
161
162
  </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 {FixedTimeItem} from "./FixedTimeForPlugActon";
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: FixedTimeItem,
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