@ledvance/ui-biz-bundle 1.1.58 → 1.1.61

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 (121) hide show
  1. package/package.json +1 -1
  2. package/src/modules/flags/FlagEditPage.tsx +22 -14
  3. package/src/modules/flags/FlagInfo.tsx +5 -5
  4. package/src/modules/flags/FlagPage.tsx +7 -18
  5. package/src/modules/mood/DynamicMoodEditorPage.tsx +12 -14
  6. package/src/modules/mood/FantasyMoodEditPage.tsx +12 -14
  7. package/src/modules/mood/StaticMoodEditorPage.tsx +12 -13
  8. package/src/modules/timer/TimerPage.tsx +58 -56
  9. package/src/newModules/biorhythm/BiorhythmActions.ts +374 -0
  10. package/src/newModules/biorhythm/BiorhythmBean.ts +230 -0
  11. package/src/newModules/biorhythm/BiorhythmEditPage.tsx +267 -0
  12. package/src/newModules/biorhythm/BiorhythmPage.tsx +638 -0
  13. package/src/newModules/biorhythm/IconSelect.tsx +85 -0
  14. package/src/newModules/biorhythm/Router.ts +34 -0
  15. package/src/newModules/biorhythm/circular/ItemIcon.d.ts +22 -0
  16. package/src/newModules/biorhythm/circular/ItemIcon.tsx +173 -0
  17. package/src/newModules/biorhythm/circular/Progress.d.ts +24 -0
  18. package/src/newModules/biorhythm/circular/Progress.tsx +372 -0
  19. package/src/newModules/biorhythm/circular/TimeCircular.d.ts +11 -0
  20. package/src/newModules/biorhythm/circular/TimeCircular.tsx +64 -0
  21. package/src/newModules/biorhythm/circular/biorhythm_plantimer.png +0 -0
  22. package/src/newModules/biorhythm/circular/rhythm_icon.png +0 -0
  23. package/src/newModules/biorhythm/iconListData.ts +30 -0
  24. package/src/newModules/biorhythm/pIdList.ts +36 -0
  25. package/src/newModules/biorhythm/res/BiologicalRes.d.ts +43 -0
  26. package/src/newModules/biorhythm/res/BiologicalRes.ts +42 -0
  27. package/src/newModules/biorhythm/res/Biological_Rhythm.png +0 -0
  28. package/src/newModules/biorhythm/res/Biological_Rhythm_12.png +0 -0
  29. package/src/newModules/biorhythm/res/Biological_Rhythm_new.png +0 -0
  30. package/src/newModules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
  31. package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
  32. package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
  33. package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
  34. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
  35. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
  36. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
  37. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
  38. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
  39. package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
  40. package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
  41. package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
  42. package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
  43. package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
  44. package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
  45. package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
  46. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
  47. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
  48. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
  49. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
  50. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
  51. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
  52. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
  53. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
  54. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
  55. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
  56. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
  57. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
  58. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
  59. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
  60. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
  61. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
  62. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
  63. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
  64. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
  65. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
  66. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
  67. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
  68. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
  69. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
  70. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
  71. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
  72. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
  73. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
  74. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
  75. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
  76. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
  77. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
  78. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
  79. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
  80. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
  81. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
  82. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
  83. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
  84. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
  85. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
  86. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
  87. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
  88. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
  89. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
  90. package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
  91. package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
  92. package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
  93. package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
  94. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
  95. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
  96. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
  97. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
  98. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
  99. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
  100. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
  101. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
  102. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
  103. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
  104. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
  105. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
  106. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
  107. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
  108. package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
  109. package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +84 -83
  110. package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +133 -132
  111. package/src/newModules/energyConsumption/component/EnergyModal.tsx +119 -117
  112. package/src/newModules/energyConsumption/component/Overview.tsx +38 -36
  113. package/src/newModules/mood/AddMoodPage.tsx +37 -21
  114. package/src/newModules/mood/DynamicMoodEditorPage.tsx +7 -2
  115. package/src/newModules/mood/MixDynamicMoodEditor.tsx +8 -2
  116. package/src/newModules/mood/StaticMoodEditorPage.tsx +9 -2
  117. package/src/newModules/timeSchedule/Interface.ts +1 -0
  118. package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +203 -202
  119. package/src/newModules/timeSchedule/TimeSchedulePage.tsx +35 -34
  120. package/src/newModules/timeSchedule/components/ManuaSettings.tsx +11 -10
  121. package/src/newModules/timeSchedule/components/ScheduleCard.tsx +63 -60
@@ -37,16 +37,16 @@ import { Result } from '@ledvance/base/src/models/modules/Result';
37
37
  import DeleteButton from '@ledvance/base/src/components/DeleteButton';
38
38
  import InfoText from '@ledvance/base/src/components/InfoText';
39
39
  import SegmentControl from '@ledvance/base/src/components/segmentControl';
40
- // import { SceneMode } from "../mood/SceneInfo";
41
40
  import { useParams } from '@ledvance/base/src/hooks/Hooks';
42
41
  import ManualSettings from './components/ManuaSettings';
43
42
  import { defDeviceData, defMixDeviceData, defStripDeviceData } from './TimeScheduleActions';
44
43
  import MoodItem from '../mood/MoodItem';
45
44
  import { getRemoteMoodList } from '../mood/MoodActions';
46
- // import LoadingView from "@ledvance/base/src/components/LoadingView";
47
45
 
48
46
  const { convertX: cx } = Utils.RatioUtils;
49
47
  const { toFixedString } = Utils.NumberUtils;
48
+ const { withTheme } = Utils.ThemeUtils
49
+
50
50
  interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
51
51
  mode: 'add' | 'update';
52
52
  timeSchedule: Timer;
@@ -54,15 +54,15 @@ interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
54
54
  refreshFn: () => void;
55
55
  }
56
56
 
57
- const TimeScheduleDetailPage = () => {
57
+ const TimeScheduleDetailPage = (props: {theme?: any}) => {
58
58
  const is24HourClock = useSystemTimeFormate();
59
- const props = useParams<TimeScheduleDetailPageParams>();
59
+ const params = useParams<TimeScheduleDetailPageParams>();
60
60
  const navigation = useNavigation();
61
61
  const devId = useDeviceId();
62
62
  const [moods, setMoods] = useMoods();
63
63
  const state = useReactive<TimeScheduleDetailState>({
64
- timeSchedule: props.mode === 'add' ? newTimeSchedule() : cloneDeep(props.timeSchedule),
65
- dps: props.mode === 'add' ? {} : props.timeSchedule.dps,
64
+ timeSchedule: params.mode === 'add' ? newTimeSchedule() : cloneDeep(params.timeSchedule),
65
+ dps: params.mode === 'add' ? {} : params.timeSchedule.dps,
66
66
  isManual: true, // manual ,mood
67
67
  initSelectedSkill: [] as ApplyForItem[],
68
68
  selectedSkill: [] as ApplyForItem[],
@@ -70,9 +70,9 @@ const TimeScheduleDetailPage = () => {
70
70
  loading: false,
71
71
  moodLoading: false,
72
72
  manualData:
73
- props.mode === 'add'
74
- ? getDefaultManual(props)
75
- : props.manualDataDp2Obj(props.timeSchedule.dps).deviceData,
73
+ params.mode === 'add'
74
+ ? getDefaultManual(params)
75
+ : params.manualDataDp2Obj(params.timeSchedule.dps).deviceData,
76
76
  mood: undefined,
77
77
  moods: cloneDeep(moods),
78
78
  timerId: undefined,
@@ -80,29 +80,29 @@ const TimeScheduleDetailPage = () => {
80
80
  });
81
81
 
82
82
  useEffect(() => {
83
- const { applyForDisabled, timeSchedule, applyForList, mode } = props;
83
+ const { applyForDisabled, timeSchedule, applyForList, mode } = params;
84
84
  const cannotChoose = applyForDisabled || applyForList.length === 1;
85
85
  const cloneApplyList =
86
86
  mode === 'add'
87
87
  ? cloneDeep(applyForList)
88
88
  : cloneDeep(applyForList).map(item => {
89
- if (props.isMixLight && state.manualData.type === DeviceType.MixLight) {
90
- return {
91
- ...item,
92
- enable:
93
- item.type === 'mainLight'
94
- ? state.manualData.deviceData.whiteLightSwitch
95
- : state.manualData.deviceData.colorLightSwitch,
96
- };
97
- }
98
- if (timeSchedule?.dps?.hasOwnProperty(item.dp)) {
99
- return {
100
- ...item,
101
- enable: timeSchedule?.dps[item.dp],
102
- };
103
- }
104
- return item;
105
- });
89
+ if (params.isMixLight && state.manualData.type === DeviceType.MixLight) {
90
+ return {
91
+ ...item,
92
+ enable:
93
+ item.type === 'mainLight'
94
+ ? state.manualData.deviceData.whiteLightSwitch
95
+ : state.manualData.deviceData.colorLightSwitch,
96
+ };
97
+ }
98
+ if (timeSchedule?.dps?.hasOwnProperty(item.dp)) {
99
+ return {
100
+ ...item,
101
+ enable: timeSchedule?.dps[item.dp],
102
+ };
103
+ }
104
+ return item;
105
+ });
106
106
 
107
107
  if (cannotChoose) {
108
108
  state.selectedSkill = cloneApplyList;
@@ -117,8 +117,8 @@ const TimeScheduleDetailPage = () => {
117
117
  state.selectedSkill = mode === 'add' ? [] : selectedList;
118
118
  state.unSelectedSkill = mode === 'add' ? cloneApplyList : unSelectedList;
119
119
  }
120
- if (props.mode === 'update' && props.manualDataDp2Obj) {
121
- const { isManual, mood } = props.manualDataDp2Obj(props.timeSchedule.dps);
120
+ if (params.mode === 'update' && params.manualDataDp2Obj) {
121
+ const { isManual, mood } = params.manualDataDp2Obj(params.timeSchedule.dps);
122
122
  state.isManual = isManual;
123
123
  state.mood = mood;
124
124
  }
@@ -127,7 +127,7 @@ const TimeScheduleDetailPage = () => {
127
127
 
128
128
  if (!(Array.isArray(moods) && moods.length)) {
129
129
  state.timerId = setTimeout(() => {
130
- getRemoteMoodList(devId, props, props.featureId).then(res => {
130
+ getRemoteMoodList(devId, params, params.featureId).then(res => {
131
131
  if (res.success && Array.isArray(res.data)) {
132
132
  state.moods = cloneDeep(res.data);
133
133
  setMoods(cloneDeep(res.data));
@@ -147,9 +147,9 @@ const TimeScheduleDetailPage = () => {
147
147
  if (state.moods?.length) {
148
148
  state.moodName =
149
149
  state.moods.find(m =>
150
- props.isCeilingLight
150
+ params.isCeilingLight
151
151
  ? m.mainLamp.id === state.mood?.mainLamp.id &&
152
- m.secondaryLamp.id === state.mood?.secondaryLamp.id
152
+ m.secondaryLamp.id === state.mood?.secondaryLamp.id
153
153
  : m.id === state.mood?.id
154
154
  )?.name || '';
155
155
  }
@@ -167,18 +167,18 @@ const TimeScheduleDetailPage = () => {
167
167
  }, []);
168
168
 
169
169
  const isModify = useMemo(() => {
170
- if (props.mode === 'add') {
170
+ if (params.mode === 'add') {
171
171
  return true
172
172
  }
173
173
 
174
- const schedule = props.timeSchedule;
175
- const manual = props.manualDataDp2Obj(props.timeSchedule?.dps).deviceData;
174
+ const schedule = params.timeSchedule;
175
+ const manual = params.manualDataDp2Obj(params.timeSchedule?.dps).deviceData;
176
176
  const before = {
177
177
  ...schedule,
178
178
  selectedSkill: state.initSelectedSkill,
179
179
  dps: manual,
180
- isManual: props.manualDataDp2Obj(props.timeSchedule.dps).isManual,
181
- mood: props.manualDataDp2Obj(props.timeSchedule?.dps).mood,
180
+ isManual: params.manualDataDp2Obj(params.timeSchedule.dps).isManual,
181
+ mood: params.manualDataDp2Obj(params.timeSchedule?.dps).mood,
182
182
  id: 1,
183
183
  };
184
184
 
@@ -203,14 +203,87 @@ const TimeScheduleDetailPage = () => {
203
203
  }, [state.timeSchedule.name, state.selectedSkill, isModify, state.isManual, state.mood]);
204
204
 
205
205
  const showSelectedIcon = useMemo(() => {
206
- return state.selectedSkill.length !== 1 && !props.applyForDisabled;
207
- }, [state.selectedSkill.length, props.applyForDisabled]);
206
+ return state.selectedSkill.length !== 1 && !params.applyForDisabled;
207
+ }, [state.selectedSkill.length, params.applyForDisabled]);
208
+
209
+ const styles = StyleSheet.create({
210
+ cardContainer: {
211
+ marginHorizontal: cx(24),
212
+ },
213
+ itemTitle: {
214
+ color: props.theme.global.fontColor,
215
+ fontSize: cx(16),
216
+ fontWeight: 'bold',
217
+ fontFamily: 'helvetica_neue_lt_std_bd',
218
+ },
219
+ applyContent: {
220
+ backgroundColor: props.theme.card.background,
221
+ borderRadius: 4,
222
+ minHeight: cx(55),
223
+ flex: 1,
224
+ justifyContent: 'center',
225
+ paddingHorizontal: cx(10),
226
+ paddingTop: cx(10),
227
+ },
228
+ applyItem: {
229
+ paddingLeft: cx(5),
230
+ flexDirection: 'row',
231
+ justifyContent: 'space-between',
232
+ alignItems: 'center',
233
+ backgroundColor: props.theme.global.background,
234
+ height: cx(35),
235
+ },
236
+ moodScrollView: {
237
+ maxHeight: cx(500),
238
+ },
239
+ summaryContainer: {
240
+ flexDirection: 'row',
241
+ justifyContent: 'flex-start',
242
+ marginBottom: cx(10),
243
+ marginHorizontal: cx(24),
244
+ },
245
+ summaryImg: {
246
+ height: cx(12),
247
+ width: cx(12),
248
+ tintColor: props.theme.global.fontColor,
249
+ },
250
+ summaryLeft: {
251
+ flexDirection: 'row',
252
+ alignItems: 'center',
253
+ minWidth: cx(90),
254
+ },
255
+ leftTitle: {
256
+ fontSize: cx(14),
257
+ color: props.theme.global.fontColor,
258
+ marginTop: 0,
259
+ },
260
+ summaryRight: {
261
+ flexDirection: 'column',
262
+ marginLeft: cx(21),
263
+ backgroundColor: props.theme.card.background,
264
+ borderRadius: cx(16),
265
+ alignItems: 'center'
266
+ },
267
+ rightItem: {
268
+ paddingHorizontal: cx(12),
269
+ color: props.theme.global.fontColor,
270
+ },
271
+ switchButton: {
272
+ flexDirection: 'row',
273
+ alignItems: 'center',
274
+ justifyContent: 'space-between',
275
+ marginBottom: cx(10),
276
+ },
277
+ text: {
278
+ color: props.theme.global.fontColor,
279
+ },
280
+ });
208
281
 
209
282
  return (
210
283
  <Page
211
284
  backText={I18n.getLang('motion_detection_add_time_schedule_system_back_text')}
212
285
  headlineText={I18n.getLang(
213
- props.mode === 'add'
286
+ params.mode === 'add'
214
287
  ? 'motion_detection_add_time_schedule_headline_text'
215
288
  : 'edit_timeschedule_headline_text'
216
289
  )}
@@ -218,10 +291,10 @@ const TimeScheduleDetailPage = () => {
218
291
  rightButtonIconClick={async () => {
219
292
  if (!allowSubmit || state.loading) return;
220
293
  state.loading = true;
221
- const res = await props.modDeleteTimeSchedule(props.mode, {
294
+ const res = await params.modDeleteTimeSchedule(params.mode, {
222
295
  ...state.timeSchedule,
223
296
  enable: true,
224
- dps: props.manualDataObj2Dp(
297
+ dps: params.manualDataObj2Dp(
225
298
  {
226
299
  deviceData: state.manualData,
227
300
  isManual: state.isManual,
@@ -257,7 +330,8 @@ const TimeScheduleDetailPage = () => {
257
330
  {/* pick */}
258
331
  <TimerPicker
259
332
  itemTextColor="#aeadb5"
260
- style={{ paddingVertical: cx(0), marginVertical: cx(0) }}
333
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
334
+ pickerFontColor={props.theme.global.fontColor}
261
335
  is12Hours={!is24HourClock}
262
336
  singlePicker={true}
263
337
  amText={I18n.getLang('manage_user_calendar_label_am')}
@@ -280,7 +354,7 @@ const TimeScheduleDetailPage = () => {
280
354
  }}
281
355
  />
282
356
  <Spacer />
283
- <Text style={styles.cardContainer}>{loopText(state.timeSchedule.loops.split(''))}</Text>
357
+ <Text style={{...styles.cardContainer, color: props.theme.global.fontColor}}>{loopText(state.timeSchedule.loops.split(''))}</Text>
284
358
  <Spacer height={cx(30)} />
285
359
 
286
360
  {/* Apply for */}
@@ -290,7 +364,7 @@ const TimeScheduleDetailPage = () => {
290
364
  </Text>
291
365
  <Spacer height={cx(10)} />
292
366
  <View style={styles.applyContent}>
293
- {props.applyForList.length === 0 ? (
367
+ {params.applyForList.length === 0 ? (
294
368
  <Text>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text>
295
369
  ) : (
296
370
  state.selectedSkill.map(skill => (
@@ -298,7 +372,7 @@ const TimeScheduleDetailPage = () => {
298
372
  style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}
299
373
  key={skill.dp}
300
374
  >
301
- <Text style={{ color: '#000' }}>{skill.key}</Text>
375
+ <Text style={{ color: props.theme.global.fontColor }}>{skill.key}</Text>
302
376
  {showSelectedIcon && (
303
377
  <TouchableOpacity
304
378
  onPress={() => {
@@ -327,7 +401,7 @@ const TimeScheduleDetailPage = () => {
327
401
  state.unSelectedSkill = state.unSelectedSkill.filter(s => item.dp !== s.dp);
328
402
  }}
329
403
  >
330
- <Text style={{ color: '#000' }}>{item.key}</Text>
404
+ <Text style={{ color: props.theme.global.fontColor }}>{item.key}</Text>
331
405
  <Image
332
406
  style={{ width: cx(16), height: cx(16) }}
333
407
  source={res.device_panel_timer_add}
@@ -343,7 +417,7 @@ const TimeScheduleDetailPage = () => {
343
417
  {I18n.getLang('timeschedule_add_schedule_subheadline2_text')}
344
418
  </Text>
345
419
  <Spacer height={cx(10)} />
346
- {props.isSupportMood && (
420
+ {params.isSupportMood && (
347
421
  <>
348
422
  <SegmentControl
349
423
  title1={I18n.getLang('timeschedule_add_schedule_switch_tab_manual_text')}
@@ -359,10 +433,10 @@ const TimeScheduleDetailPage = () => {
359
433
  <ManualSettings
360
434
  dps={state.dps}
361
435
  applyForList={state.selectedSkill}
362
- isSupportColor={props.isSupportColor}
363
- isSupportBrightness={props.isSupportBrightness}
364
- isSupportTemperature={props.isSupportTemperature}
365
- isStripLight={props.isStripLight}
436
+ isSupportColor={params.isSupportColor}
437
+ isSupportBrightness={params.isSupportBrightness}
438
+ isSupportTemperature={params.isSupportTemperature}
439
+ isStripLight={params.isStripLight}
366
440
  manualData={state.manualData}
367
441
  onManualChange={manual => {
368
442
  // @ts-ignore
@@ -377,24 +451,24 @@ const TimeScheduleDetailPage = () => {
377
451
  />
378
452
  ) : (
379
453
  <FlatList
380
- data={state.moods}
381
- renderItem={({ item }) => {
382
- return (
383
- <MoodItem
384
- enable={state.mood?.id === item.id}
385
- mood={item}
386
- isMix={!!(props.isMixLight || props.isCeilingLight)}
387
- onSwitch={_ => {
388
- state.mood = item;
389
- }}
390
- />
391
- );
392
- }}
393
- ListHeaderComponent={() => <Spacer height={cx(10)} />}
394
- ItemSeparatorComponent={() => <Spacer />}
395
- ListFooterComponent={() => <Spacer />}
396
- keyExtractor={item => `${item.name}`}
397
- />
454
+ data={state.moods}
455
+ renderItem={({ item }) => {
456
+ return (
457
+ <MoodItem
458
+ enable={state.mood?.id === item.id}
459
+ mood={item}
460
+ isMix={!!(params.isMixLight || params.isCeilingLight)}
461
+ onSwitch={_ => {
462
+ state.mood = item;
463
+ }}
464
+ />
465
+ );
466
+ }}
467
+ ListHeaderComponent={() => <Spacer height={cx(10)} />}
468
+ ItemSeparatorComponent={() => <Spacer />}
469
+ ListFooterComponent={() => <Spacer />}
470
+ keyExtractor={item => `${item.name}`}
471
+ />
398
472
  // <ScrollView style={styles.moodScrollView} nestedScrollEnabled={true}>
399
473
 
400
474
  // </ScrollView>
@@ -462,67 +536,67 @@ const TimeScheduleDetailPage = () => {
462
536
  <View style={{ marginLeft: cx(16), flex: 1 }}>
463
537
  {state.isManual
464
538
  ? !!state.selectedSkill.length && (
539
+ <>
540
+ {!!state.selectedSkill.filter(skill => skill.enable).length && (
465
541
  <>
466
- {!!state.selectedSkill.filter(skill => skill.enable).length && (
467
- <>
468
- <Text style={{ marginLeft: cx(5) }}>
469
- {I18n.getLang('feature_summary_action_txt_1')}
470
- </Text>
471
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
472
- {state.selectedSkill
473
- .filter(skill => skill.enable)
474
- .map(item => (
475
- <View
476
- style={[
477
- styles.summaryRight,
478
- { marginLeft: cx(5), marginBottom: cx(5) },
479
- ]}
480
- key={item.dp}
481
- >
482
- <Text style={[styles.rightItem]}>{item.key}</Text>
483
- </View>
484
- ))}
485
- </View>
486
- </>
487
- )}
488
-
489
- {!!state.selectedSkill.filter(skill => !skill.enable).length && (
490
- <>
491
- <Text style={{ marginLeft: cx(5) }}>
492
- {I18n.getLang('feature_summary_action_txt_2')}
493
- </Text>
494
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
495
- {state.selectedSkill
496
- .filter(skill => !skill.enable)
497
- .map(item => (
498
- <View
499
- style={[
500
- styles.summaryRight,
501
- { marginLeft: cx(5), marginBottom: cx(5) },
502
- ]}
503
- key={item.dp}
504
- >
505
- <Text style={[styles.rightItem]}>{item.key}</Text>
506
- </View>
507
- ))}
508
- </View>
509
- </>
510
- )}
542
+ <Text style={{ marginLeft: cx(5), color: props.theme.global.fontColor }}>
543
+ {I18n.getLang('feature_summary_action_txt_1')}
544
+ </Text>
545
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
546
+ {state.selectedSkill
547
+ .filter(skill => skill.enable)
548
+ .map(item => (
549
+ <View
550
+ style={[
551
+ styles.summaryRight,
552
+ { marginLeft: cx(5), marginBottom: cx(5) },
553
+ ]}
554
+ key={item.dp}
555
+ >
556
+ <Text style={[styles.rightItem]}>{item.key}</Text>
557
+ </View>
558
+ ))}
559
+ </View>
511
560
  </>
512
- )
513
- : !!state.moodName && (
514
- <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
515
- <View style={[styles.summaryRight, { marginLeft: cx(5) }]}>
516
- <Text style={styles.rightItem}>{state.moodName}</Text>
561
+ )}
562
+
563
+ {!!state.selectedSkill.filter(skill => !skill.enable).length && (
564
+ <>
565
+ <Text style={{ marginLeft: cx(5), color: props.theme.global.fontColor }}>
566
+ {I18n.getLang('feature_summary_action_txt_2')}
567
+ </Text>
568
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
569
+ {state.selectedSkill
570
+ .filter(skill => !skill.enable)
571
+ .map(item => (
572
+ <View
573
+ style={[
574
+ styles.summaryRight,
575
+ { marginLeft: cx(5), marginBottom: cx(5) },
576
+ ]}
577
+ key={item.dp}
578
+ >
579
+ <Text style={[styles.rightItem]}>{item.key}</Text>
580
+ </View>
581
+ ))}
517
582
  </View>
518
- </View>
583
+ </>
519
584
  )}
585
+ </>
586
+ )
587
+ : !!state.moodName && (
588
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
589
+ <View style={[styles.summaryRight, { marginLeft: cx(5) }]}>
590
+ <Text style={styles.rightItem}>{state.moodName}</Text>
591
+ </View>
592
+ </View>
593
+ )}
520
594
  </View>
521
595
  </View>
522
596
  <Spacer height={cx(30)} />
523
597
 
524
598
  {/* delete */}
525
- {props.mode === 'update' && (
599
+ {params.mode === 'update' && (
526
600
  <View style={{ marginHorizontal: cx(24) }}>
527
601
  <DeleteButton
528
602
  text={I18n.getLang('edit_timeschedule_bttn_text')}
@@ -534,7 +608,7 @@ const TimeScheduleDetailPage = () => {
534
608
  onConfirm: async (_, { close }) => {
535
609
  state.loading = true;
536
610
  close();
537
- const res = await props.modDeleteTimeSchedule('delete', state.timeSchedule);
611
+ const res = await params.modDeleteTimeSchedule('delete', state.timeSchedule);
538
612
  state.loading = false;
539
613
  if (res.success) {
540
614
  navigation.goBack();
@@ -568,95 +642,22 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
568
642
  props.isStripLight || props.isCeilingLight
569
643
  ? DeviceType.StripLight
570
644
  : props.isMixLight
571
- ? DeviceType.MixLight
572
- : DeviceType.LightSource;
645
+ ? DeviceType.MixLight
646
+ : DeviceType.LightSource;
573
647
  const deviceData =
574
648
  deviceType === DeviceType.StripLight
575
649
  ? defStripDeviceData
576
650
  : deviceType === DeviceType.MixLight
577
- ? defMixDeviceData
578
- : defDeviceData;
651
+ ? defMixDeviceData
652
+ : defDeviceData;
579
653
  // @ts-ignore
580
654
  return {
581
655
  type: deviceType,
582
656
  deviceData: {
583
657
  ...deviceData,
584
- isColorMode: props.isSupportColor ? true : false,
658
+ isColorMode: props.isSupportColor,
585
659
  },
586
660
  };
587
661
  };
588
662
 
589
- const styles = StyleSheet.create({
590
- cardContainer: {
591
- marginHorizontal: cx(24),
592
- },
593
- itemTitle: {
594
- color: '#000',
595
- fontSize: cx(16),
596
- fontWeight: 'bold',
597
- fontFamily: 'helvetica_neue_lt_std_bd',
598
- },
599
- applyContent: {
600
- backgroundColor: '#f6f6f6',
601
- borderRadius: 4,
602
- minHeight: cx(55),
603
- flex: 1,
604
- justifyContent: 'center',
605
- paddingHorizontal: cx(10),
606
- paddingTop: cx(10),
607
- },
608
- applyItem: {
609
- paddingLeft: cx(5),
610
- flexDirection: 'row',
611
- justifyContent: 'space-between',
612
- alignItems: 'center',
613
- backgroundColor: '#fff',
614
- height: cx(35),
615
- },
616
- moodScrollView: {
617
- maxHeight: cx(500),
618
- },
619
- summaryContainer: {
620
- flexDirection: 'row',
621
- justifyContent: 'flex-start',
622
- marginBottom: cx(10),
623
- marginHorizontal: cx(24),
624
- },
625
- summaryImg: {
626
- height: cx(12),
627
- width: cx(12),
628
- tintColor: '#000',
629
- },
630
- summaryLeft: {
631
- flexDirection: 'row',
632
- alignItems: 'center',
633
- minWidth: cx(90),
634
- },
635
- leftTitle: {
636
- fontSize: cx(14),
637
- color: '#000',
638
- marginTop: 0,
639
- },
640
- summaryRight: {
641
- flexDirection: 'column',
642
- marginLeft: cx(21),
643
- backgroundColor: '#cbcbcb',
644
- borderRadius: cx(16),
645
- alignItems: 'center'
646
- },
647
- rightItem: {
648
- paddingHorizontal: cx(12),
649
- color: '#000',
650
- },
651
- switchButton: {
652
- flexDirection: 'row',
653
- alignItems: 'center',
654
- justifyContent: 'space-between',
655
- marginBottom: cx(10),
656
- },
657
- text: {
658
- color: '#000',
659
- },
660
- });
661
-
662
- export default TimeScheduleDetailPage;
663
+ export default withTheme(TimeScheduleDetailPage)