@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
@@ -20,6 +20,7 @@ import Card from "@ledvance/base/src/components/Card";
20
20
  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
+ import ThemeType from '@ledvance/base/src/config/themeType'
23
24
 
24
25
  const {parseTimer} = Utils.TimeUtils
25
26
  const {convertX: cx} = Utils.RatioUtils;
@@ -50,7 +51,7 @@ const newRandomTimingItem = (): RandomTimingItem => {
50
51
  }
51
52
  }
52
53
 
53
- const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
54
+ const RandomTimingForLightDetailPage = (props: { theme?: ThemeType }) => {
54
55
  const navigation = useNavigation()
55
56
  const params = useRoute().params as RandomTimeDetailParam
56
57
  const initItem = newRandomTimingItem();
@@ -132,13 +133,13 @@ const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
132
133
  marginHorizontal: cx(24)
133
134
  },
134
135
  itemTitle: {
135
- color: props.theme.global.fontColor,
136
+ color: props.theme?.global.fontColor,
136
137
  fontSize: cx(16),
137
138
  fontWeight: 'bold',
138
139
  fontFamily: 'helvetica_neue_lt_std_bd',
139
140
  },
140
141
  applyContent: {
141
- backgroundColor: props.theme.container.background,
142
+ backgroundColor: props.theme?.container.background,
142
143
  borderRadius: 4,
143
144
  minHeight: cx(55),
144
145
  flex: 1,
@@ -151,7 +152,7 @@ const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
151
152
  flexDirection: 'row',
152
153
  justifyContent: 'space-between',
153
154
  alignItems: 'center',
154
- backgroundColor: props.theme.global.background,
155
+ backgroundColor: props.theme?.global.background,
155
156
  height: cx(35),
156
157
  },
157
158
  })
@@ -185,8 +186,8 @@ const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
185
186
  {/* pick */}
186
187
  <TimerPicker
187
188
  itemTextColor='#aeadb5'
188
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
189
- pickerFontColor={props.theme.global.fontColor}
189
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
190
+ pickerFontColor={props.theme?.global.fontColor}
190
191
  is12Hours={!params.is24Hour}
191
192
  startTime={state.item.startTime}
192
193
  endTime={state.item.endTime}
@@ -202,7 +203,7 @@ const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
202
203
  state.item.weeks[rawIndex] = state.item.weeks[rawIndex] === 1 ? 0 : 1
203
204
  }}/>
204
205
  <Spacer/>
205
- <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
206
+ <Text style={{ ...styles.cardContainer, color: props.theme?.global.fontColor, fontSize: cx(14) }}>
206
207
  {loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
207
208
  </Text>
208
209
  <Spacer/>
@@ -212,17 +213,17 @@ const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
212
213
  <Spacer height={cx(10)}/>
213
214
  <View style={styles.applyContent}>
214
215
  {state.item.channel === undefined ?
215
- <Text style={{color: props.theme.global.fontColor}}>
216
+ <Text style={{color: props.theme?.global.fontColor}}>
216
217
  {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
217
218
  </Text> :
218
219
  <View style={[styles.applyItem, {marginBottom: cx(10), borderRadius: 4}]}>
219
- <Text style={{color: props.theme.global.fontColor}}>{params.channels[state.item.channel]}</Text>
220
+ <Text style={{color: props.theme?.global.fontColor}}>{params.channels[state.item.channel]}</Text>
220
221
  {params.channels.length > 1 && <TouchableOpacity
221
222
  onPress={() => {
222
223
  state.item.channel = undefined
223
224
  }}
224
225
  style={{paddingHorizontal: cx(5)}}>
225
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.ic_arrows_nav_clear}/>
226
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.ic_arrows_nav_clear}/>
226
227
  </TouchableOpacity>}
227
228
  </View>
228
229
  }
@@ -239,8 +240,8 @@ const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
239
240
  state.item.channel = index
240
241
  }}
241
242
  >
242
- <Text style={{color: props.theme.global.fontColor}}>{item}</Text>
243
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.device_panel_timer_add}/>
243
+ <Text style={{color: props.theme?.global.fontColor}}>{item}</Text>
244
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor}} source={res.device_panel_timer_add}/>
244
245
  </TouchableOpacity>
245
246
  )
246
247
  })}
@@ -253,7 +254,7 @@ const RandomTimingForLightDetailPage = (props: { theme?: any }) => {
253
254
  <Card>
254
255
  <LdvSwitch
255
256
  title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
256
- color={props.theme.card.background}
257
+ color={props.theme?.card.background}
257
258
  colorAlpha={1}
258
259
  enable={true}
259
260
  setEnable={() => { }}
@@ -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 RandomTimeForLightPage = (props: { theme?: any}) => {
22
+ const RandomTimeForLightPage = (props: { theme?: ThemeType}) => {
22
23
  const devInfo = useDeviceInfo()
23
24
  const navigation = useNavigation()
24
25
  const params = useRoute().params as RandomTimingParam
@@ -76,15 +77,15 @@ const RandomTimeForLightPage = (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
  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 RandomTimeForLightPage = (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
  })
@@ -106,7 +107,7 @@ const RandomTimeForLightPage = (props: { theme?: any}) => {
106
107
  return (
107
108
  <ScrollView nestedScrollEnabled={true}>
108
109
  <Text style={{
109
- color: props.theme.global.fontColor,
110
+ color: props.theme?.global.fontColor,
110
111
  marginLeft: cx(24),
111
112
  }}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
112
113
  <Spacer height={cx(10)}/>
@@ -152,7 +153,7 @@ const RandomTimeForLightPage = (props: { theme?: any}) => {
152
153
  icon={res.device_panel_schedule_alert}
153
154
  text={I18n.getLang('randomtimecycle_empty_information_text')}
154
155
  textStyle={{flex: undefined}}
155
- contentColor={props.theme.global.secondFontColor}
156
+ contentColor={props.theme?.global.secondFontColor}
156
157
  />
157
158
  <View
158
159
  style={styles.addButton}>
@@ -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
 
@@ -8,11 +8,12 @@ import Spacer from "@ledvance/base/src/components/Spacer";
8
8
  import {useRemoteSwitch} from "./RemoteSwitchAction";
9
9
  import {View, Text, StyleSheet} from "react-native";
10
10
  import {showDialog} from "@ledvance/base/src/utils/common";
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
- const RemoteSwitchPage = (props: { theme?: any }) => {
16
+ const RemoteSwitchPage = (props: { theme?: ThemeType }) => {
16
17
  const devInfo = useDeviceInfo()
17
18
  const [remoteSwitch, setRemoteSwitch] = useRemoteSwitch()
18
19
  const state = useReactive({
@@ -34,13 +35,13 @@ const RemoteSwitchPage = (props: { theme?: any }) => {
34
35
  borderRadius: cx(4),
35
36
  },
36
37
  title: {
37
- color: props.theme.global.fontColor,
38
+ color: props.theme?.global.fontColor,
38
39
  fontSize: cx(14),
39
40
  fontFamily: 'helvetica_neue_lt_std_bd',
40
41
  paddingVertical: cx(16),
41
42
  },
42
43
  shadow: {
43
- shadowColor: props.theme.card.shadow,
44
+ shadowColor: props.theme?.card.shadow,
44
45
  shadowOpacity: 0.2,
45
46
  shadowRadius: 8,
46
47
  elevation:8,
@@ -48,7 +49,7 @@ const RemoteSwitchPage = (props: { theme?: any }) => {
48
49
  width: 0,
49
50
  height: 4,
50
51
  },
51
- backgroundColor: props.theme.card.background,
52
+ backgroundColor: props.theme?.card.background,
52
53
  borderRadius: 8,
53
54
  },
54
55
  })
@@ -6,6 +6,7 @@ import Spacer from '@ledvance/base/src/components/Spacer'
6
6
  import I18n from '@ledvance/base/src/i18n'
7
7
  import Card from '@ledvance/base/src/components/Card'
8
8
  import res from '@ledvance/base/src/res'
9
+ import ThemeType from '@ledvance/base/src/config/themeType'
9
10
 
10
11
  const cx = Utils.RatioUtils.convertX
11
12
  const { withTheme } = Utils.ThemeUtils
@@ -22,7 +23,7 @@ export interface SelectPageParams<T> {
22
23
  onSelect: (selectPageData: SelectPageData<T>) => void
23
24
  }
24
25
 
25
- const SelectPage = (props: { theme?: any }) => {
26
+ const SelectPage = (props: { theme?: ThemeType }) => {
26
27
  const params = useRoute().params as SelectPageParams<any>
27
28
  const navigation = useNavigation()
28
29
 
@@ -32,11 +33,11 @@ const SelectPage = (props: { theme?: any }) => {
32
33
  },
33
34
  topBar: {
34
35
  height: cx(91),
35
- backgroundColor: props.theme.card.head,
36
+ backgroundColor: props.theme?.card.head,
36
37
  },
37
38
  line: {
38
39
  height: cx(1),
39
- backgroundColor: props.theme.container.divider,
40
+ backgroundColor: props.theme?.container.divider,
40
41
  },
41
42
  topContent: {
42
43
  height: cx(45),
@@ -45,7 +46,7 @@ const SelectPage = (props: { theme?: any }) => {
45
46
  },
46
47
  cancel: {
47
48
  marginStart: cx(16),
48
- color: props.theme.button.cancel,
49
+ color: props.theme?.button.cancel,
49
50
  fontSize: cx(17),
50
51
  fontFamily: 'helvetica_neue_lt_std_roman',
51
52
  },
@@ -54,12 +55,12 @@ const SelectPage = (props: { theme?: any }) => {
54
55
  position: 'absolute',
55
56
  start: 0,
56
57
  textAlign: 'center',
57
- color: props.theme.global.fontColor,
58
+ color: props.theme?.global.fontColor,
58
59
  fontSize: cx(17),
59
60
  fontFamily: 'helvetica_neue_lt_std_bd',
60
61
  },
61
62
  card: {
62
- backgroundColor: props.theme.card.background,
63
+ backgroundColor: props.theme?.card.background,
63
64
  marginHorizontal: cx(16),
64
65
  },
65
66
  item: {
@@ -70,20 +71,20 @@ const SelectPage = (props: { theme?: any }) => {
70
71
  itemText: {
71
72
  flex: 1,
72
73
  marginStart: cx(13),
73
- color: props.theme.global.fontColor,
74
+ color: props.theme?.global.fontColor,
74
75
  fontSize: cx(17),
75
76
  fontFamily: 'helvetica_neue_lt_std_roman',
76
77
  },
77
78
  itemLine: {
78
79
  height: cx(1),
79
80
  marginStart: cx(13),
80
- backgroundColor: props.theme.container.divider,
81
+ backgroundColor: props.theme?.container.divider,
81
82
  },
82
83
  itemIcon: {
83
84
  width: cx(30),
84
85
  height: cx(30),
85
86
  marginEnd: cx(13),
86
- tintColor: props.theme.icon.primary,
87
+ tintColor: props.theme?.icon.primary,
87
88
  },
88
89
  })
89
90
 
@@ -30,6 +30,7 @@ import { useParams } from '@ledvance/base/src/hooks/Hooks';
30
30
  import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView';
31
31
  import ColorAdjustView from '@ledvance/base/src/components/ColorAdjustView';
32
32
  import {getEndTime, getStartTime, SleepWakeUpItem} from "./SleepWakeUpActions";
33
+ import ThemeType from '@ledvance/base/src/config/themeType'
33
34
 
34
35
  const { convertX: cx } = Utils.RatioUtils;
35
36
  const { toFixedString } = Utils.NumberUtils;
@@ -48,7 +49,7 @@ interface SleepWakeUpDetailPageProps extends SleepWakeUpPageRouteParams {
48
49
  ) => Promise<Result<any>>;
49
50
  }
50
51
 
51
- const SleepWakeUpDetailPage = (props: {theme?: any}) => {
52
+ const SleepWakeUpDetailPage = (props: {theme?: ThemeType}) => {
52
53
  const navigation = useNavigation();
53
54
  const params = useParams<SleepWakeUpDetailPageProps>();
54
55
  const is24HourClock = useSystemTimeFormate();
@@ -127,7 +128,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
127
128
  <Card style={{ marginHorizontal: cx(24) }}>
128
129
  <LdvSwitch
129
130
  title={item.key}
130
- color={props.theme.card.background}
131
+ color={props.theme?.card.background}
131
132
  colorAlpha={1}
132
133
  enable={
133
134
  item.type === 'mainLight'
@@ -190,11 +191,11 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
190
191
  picker: {
191
192
  marginHorizontal: cx(24),
192
193
  marginVertical: cx(15),
193
- color: props.theme.global.backgournd,
194
+ color: props.theme?.global.backgournd,
194
195
  },
195
196
  week: {},
196
197
  itemTitle: {
197
- color: props.theme.global.fontColor,
198
+ color: props.theme?.global.fontColor,
198
199
  fontSize: cx(16),
199
200
  fontWeight: 'bold',
200
201
  fontFamily: 'helvetica_neue_lt_std_bd',
@@ -216,7 +217,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
216
217
  summaryImg: {
217
218
  height: cx(12),
218
219
  width: cx(12),
219
- tintColor: props.theme.global.fontColor,
220
+ tintColor: props.theme?.global.fontColor,
220
221
  },
221
222
  summaryLeft: {
222
223
  flexDirection: 'row',
@@ -225,20 +226,20 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
225
226
  },
226
227
  leftTitle: {
227
228
  fontSize: cx(14),
228
- color: props.theme.global.fontColor,
229
+ color: props.theme?.global.fontColor,
229
230
  },
230
231
  summaryRight: {
231
232
  flexDirection: 'column',
232
233
  marginLeft: cx(21),
233
234
  borderRadius: cx(16),
234
- backgroundColor: props.theme.tag.background,
235
+ backgroundColor: props.theme?.tag.background,
235
236
  },
236
237
  rightItem: {
237
238
  paddingHorizontal: cx(12),
238
- color: props.theme.global.fontColor,
239
+ color: props.theme?.global.fontColor,
239
240
  },
240
241
  rightTitle: {
241
- color: props.theme.tag.fontColor,
242
+ color: props.theme?.tag.fontColor,
242
243
  paddingLeft: cx(12),
243
244
  paddingRight: cx(12),
244
245
  fontSize: cx(10),
@@ -247,7 +248,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
247
248
  },
248
249
  filletCorner: {
249
250
  flexDirection: 'row',
250
- backgroundColor: props.theme.tag.background,
251
+ backgroundColor: props.theme?.tag.background,
251
252
  borderRadius: cx(16),
252
253
  alignSelf: 'flex-start',
253
254
  },
@@ -326,8 +327,8 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
326
327
  {/* pick */}
327
328
  <TimerPicker
328
329
  itemTextColor="#aeadb5"
329
- style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
330
- pickerFontColor={props.theme.global.fontColor}
330
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
331
+ pickerFontColor={props.theme?.global.fontColor}
331
332
  is12Hours={!is24HourClock}
332
333
  singlePicker={true}
333
334
  amText={I18n.getLang('manage_user_calendar_label_am')}
@@ -353,7 +354,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
353
354
  }}
354
355
  />
355
356
  <Spacer />
356
- <Text style={{ marginHorizontal: cx(24), color: props.theme.global.fontColor }}>
357
+ <Text style={{ marginHorizontal: cx(24), color: props.theme?.global.fontColor }}>
357
358
  {loopText(state.sleepWakeUp.weeks, parseTimer(getEndTime(state.sleepWakeUp) * 60))}
358
359
  </Text>
359
360
  <Spacer />
@@ -366,7 +367,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
366
367
  </Text>
367
368
  <View
368
369
  style={{
369
- backgroundColor: props.theme.container.background,
370
+ backgroundColor: props.theme?.container.background,
370
371
  borderRadius: 4,
371
372
  minHeight: cx(50),
372
373
  flex: 1,
@@ -387,13 +388,13 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
387
388
  flexDirection: 'row',
388
389
  justifyContent: 'space-between',
389
390
  alignItems: 'center',
390
- backgroundColor: props.theme.global.background,
391
+ backgroundColor: props.theme?.global.background,
391
392
  marginBottom: cx(8),
392
393
  }}
393
394
  >
394
395
  <Text
395
396
  style={{
396
- color: props.theme.global.fontColor,
397
+ color: props.theme?.global.fontColor,
397
398
  fontSize: cx(14),
398
399
  marginHorizontal: cx(6),
399
400
  marginVertical: cx(9),
@@ -472,7 +473,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
472
473
  {I18n.getLang('timeschedule_add_schedule_subheadline4_text')}
473
474
  </Text>
474
475
  <Spacer />
475
- <Text style={{color: props.theme.global.secondFontColor}}>
476
+ <Text style={{color: props.theme?.global.secondFontColor}}>
476
477
  {I18n.getLang(
477
478
  params.isSleep
478
479
  ? 'add_sleepschedule_one_source_settings_text'
@@ -495,7 +496,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
495
496
  unit={['h', 'min']}
496
497
  maxHour={3}
497
498
  />
498
- <Text style={{color: props.theme.global.secondFontColor}}>
499
+ <Text style={{color: props.theme?.global.secondFontColor}}>
499
500
  {I18n.formatValue(
500
501
  params.isSleep
501
502
  ? 'add_sleepschedule_one_source_settings_text2'
@@ -509,7 +510,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
509
510
  <LdvSwitch
510
511
  title={I18n.getLang('add_wakeupschedule_settings_text3')}
511
512
  enable={state.sleepWakeUp.duration > 0}
512
- color={props.theme.global.background}
513
+ color={props.theme?.global.background}
513
514
  colorAlpha={1}
514
515
  setEnable={v => {
515
516
  state.sleepWakeUp.duration = v ? 1 : 0;
@@ -519,7 +520,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
519
520
  )}
520
521
  {state.sleepWakeUp.duration > 0 && (
521
522
  <>
522
- <Text style={{ fontSize: cx(14), color: props.theme.global.secondFontColor }}>
523
+ <Text style={{ fontSize: cx(14), color: props.theme?.global.secondFontColor }}>
523
524
  {I18n.getLang('add_wakeupschedule_settings_text4')}
524
525
  </Text>
525
526
  <LdvPickerView
@@ -546,7 +547,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
546
547
  unit={['h', 'min']}
547
548
  maxHour={3}
548
549
  />
549
- <Text style={{color: props.theme.global.secondFontColor}}>
550
+ <Text style={{color: props.theme?.global.secondFontColor}}>
550
551
  {I18n.formatValue(
551
552
  'add_wakeupschedule_settings_text5',
552
553
  `${convertMinutesTo12HourFormat(
@@ -598,7 +599,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
598
599
  style={styles.summaryLeft}
599
600
  />
600
601
  <View style={{ marginLeft: cx(24), flex: 1 }}>
601
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
602
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
602
603
  {I18n.getLang(
603
604
  !params.isSleep ? 'feature_summary_action_txt_11' : 'feature_summary_action_txt_10'
604
605
  )}
@@ -609,7 +610,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
609
610
  </Text>
610
611
  </View>
611
612
  <Spacer height={cx(10)}/>
612
- <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
613
+ <Text style={{ fontSize: cx(12), color: props.theme?.global.fontColor }}>
613
614
  {I18n.getLang(
614
615
  params.isSleep
615
616
  ? 'feature_summary_action_txt_2'
@@ -18,6 +18,7 @@ import Card from "@ledvance/base/src/components/Card";
18
18
  import {useParams} from "@ledvance/base/src/hooks/Hooks";
19
19
  import {ApplyForItem} from "@ledvance/base/src/utils/interface";
20
20
  import {getEndTime, getStartTime, SleepWakeUpItem, useSleepPlan, useWakeUpPlan} from "./SleepWakeUpActions";
21
+ import ThemeType from '@ledvance/base/src/config/themeType'
21
22
 
22
23
  const cx = Utils.RatioUtils.convertX
23
24
  const {parseTimer} = Utils.TimeUtils
@@ -34,7 +35,7 @@ export interface SleepWakeUpPageRouteParams {
34
35
  }
35
36
 
36
37
  const MAX_SCHEDULE = 4
37
- const SleepWakeUpPage = (props: {theme?: any}) => {
38
+ const SleepWakeUpPage = (props: {theme?: ThemeType}) => {
38
39
  const deviceInfo = useDeviceInfo()
39
40
  const navigation = useNavigation()
40
41
  const is24HourClock = useSystemTimeFormate()
@@ -161,7 +162,7 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
161
162
  height: cx(90.5),
162
163
  marginStart: cx(115),
163
164
  marginTop: cx(100),
164
- backgroundColor: props.theme.card.background,
165
+ backgroundColor: props.theme?.card.background,
165
166
  },
166
167
  popoverItem: {
167
168
  width: cx(210),
@@ -185,13 +186,13 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
185
186
  lineHeight: cx(20),
186
187
  textAlign: 'center',
187
188
  fontFamily: 'helvetica_neue_lt_std_roman',
188
- color: props.theme.global.fontColor
189
+ color: props.theme?.global.fontColor
189
190
  },
190
191
  emptyBtnView: {
191
192
  alignItems: 'center'
192
193
  },
193
194
  emptyBtn: {
194
- backgroundColor: props.theme.button.primary,
195
+ backgroundColor: props.theme?.button.primary,
195
196
  borderRadius: cx(5),
196
197
  paddingHorizontal: cx(15),
197
198
  paddingVertical: cx(10)
@@ -216,14 +217,14 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
216
217
  },
217
218
  time: {
218
219
  flex: 1,
219
- color: props.theme.global.fontColor,
220
+ color: props.theme?.global.fontColor,
220
221
  fontSize: cx(16),
221
222
  fontWeight: 'bold',
222
223
  fontFamily: 'helvetica_neue_lt_std_bd',
223
224
  },
224
225
  switchBtn: {},
225
226
  loopText: {
226
- color: props.theme.global.fontColor,
227
+ color: props.theme?.global.fontColor,
227
228
  fontSize: cx(14),
228
229
  fontFamily: 'helvetica_neue_lt_std_roman',
229
230
  height: cx(20)
@@ -232,14 +233,14 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
232
233
  alignSelf: 'flex-start',
233
234
  borderRadius: cx(16),
234
235
  height: cx(16),
235
- backgroundColor: props.theme.tag.background,
236
+ backgroundColor: props.theme?.tag.background,
236
237
  paddingHorizontal: cx(10),
237
238
  },
238
239
  tagTitle: {
239
240
  fontSize: cx(10),
240
241
  textAlign: 'center',
241
242
  fontFamily: 'PingFangSC-Medium',
242
- color: props.theme.tag.fontColor
243
+ color: props.theme?.tag.fontColor
243
244
  },
244
245
  })
245
246
 
@@ -256,16 +257,16 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
256
257
  }}
257
258
  >
258
259
  <View style={{ marginHorizontal: cx(24) }}>
259
- <Text style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>
260
+ <Text style={{ color: props.theme?.global.fontColor, fontSize: cx(12) }}>
260
261
  {I18n.getLang('timeschedule_overview_description_text')}
261
262
  </Text>
262
263
  </View>
263
264
  <Spacer />
264
265
  {!!getTipText() && <View style={{ marginHorizontal: cx(24), marginVertical: cx(10), flexDirection: 'row', alignItems: 'center' }}>
265
- <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }} source={res.ic_warning_amber} />
266
- {getTipText() === "sleep" && <Text style={{fontSize: cx(12), color: props.theme.global.secondFontColor}}>{I18n.getLang('sleepwakeschedule_warning_max_number_sleep_text')}</Text>}
267
- {getTipText() === "wakeup" && <Text style={{fontSize: cx(12), color: props.theme.global.secondFontColor}}>{I18n.getLang('sleepwakeschedule_warning_max_number_wakeup_text')}</Text>}
268
- {getTipText() === "both" && <Text style={{fontSize: cx(12), color: props.theme.global.secondFontColor}}>{I18n.getLang('sleepwakeschedule_warning_max_number_both_text')}</Text>}
266
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }} source={res.ic_warning_amber} />
267
+ {getTipText() === "sleep" && <Text style={{fontSize: cx(12), color: props.theme?.global.secondFontColor}}>{I18n.getLang('sleepwakeschedule_warning_max_number_sleep_text')}</Text>}
268
+ {getTipText() === "wakeup" && <Text style={{fontSize: cx(12), color: props.theme?.global.secondFontColor}}>{I18n.getLang('sleepwakeschedule_warning_max_number_wakeup_text')}</Text>}
269
+ {getTipText() === "both" && <Text style={{fontSize: cx(12), color: props.theme?.global.secondFontColor}}>{I18n.getLang('sleepwakeschedule_warning_max_number_both_text')}</Text>}
269
270
  <Spacer />
270
271
  </View>}
271
272
  {hasScheduleList() && <View style={styles.tagLine}>
@@ -318,7 +319,7 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
318
319
  <View style={styles.emptyText}>
319
320
  <Image
320
321
  source={{ uri: res.device_panel_schedule_alert }}
321
- style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }}
322
+ style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }}
322
323
  />
323
324
  <Text style={styles.emptyNoTime}>
324
325
  {
@@ -333,14 +334,14 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
333
334
  <Spacer />
334
335
  <TextButton
335
336
  style={styles.emptyBtn}
336
- textStyle={isSleepMax ? styles.disableItemText : { color: props.theme.button.fontColor }}
337
+ textStyle={isSleepMax ? styles.disableItemText : { color: props.theme?.button.fontColor }}
337
338
  text={I18n.getLang('sleepwakeschedule_add_button_text1')}
338
339
  onPress={() => onAddScheduleDialogItemClick(true, 'add', getNewSleepWakeUp(true, params))}
339
340
  />
340
341
  <Spacer />
341
342
  <TextButton
342
343
  style={styles.emptyBtn}
343
- textStyle={isWakeUpMax ? styles.disableItemText : { color: props.theme.button.fontColor }}
344
+ textStyle={isWakeUpMax ? styles.disableItemText : { color: props.theme?.button.fontColor }}
344
345
  text={I18n.getLang('sleepwakeschedule_add_button_text2')}
345
346
  onPress={() => onAddScheduleDialogItemClick(false, 'add', getNewSleepWakeUp(false, params))}
346
347
  />