@ledvance/ui-biz-bundle 1.1.92 → 1.1.94
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.
- package/package.json +1 -1
- package/src/modules/flags/FlagEditPage.tsx +13 -12
- package/src/modules/flags/FlagItem.tsx +4 -3
- package/src/modules/flags/FlagPage.tsx +59 -41
- package/src/modules/history/HistoryPage.tsx +11 -10
- package/src/modules/mood/MixMood/AddMixMoodPage.tsx +2 -2
- package/src/modules/mood/MixMood/MixMoodEditPage.tsx +4 -4
- package/src/modules/mood/MixMood/MixMoodPage.tsx +4 -4
- package/src/modules/music/MusicPage.tsx +10 -8
- package/src/modules/sleepWakeup/DeviceState.tsx +4 -4
- package/src/modules/sleepWakeup/SleepWakeUpPage.tsx +2 -2
- package/src/modules/timer/TimerPage.tsx +18 -17
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +13 -12
- package/src/newModules/biorhythm/BiorhythmPage.tsx +23 -22
- package/src/newModules/biorhythm/IconSelect.tsx +7 -5
- package/src/newModules/childLock/ChildLockPage.tsx +7 -6
- package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +3 -2
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +16 -15
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +16 -15
- package/src/newModules/energyConsumption/component/BarChart.tsx +18 -5
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +26 -25
- package/src/newModules/energyConsumption/component/Overview.tsx +10 -9
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +23 -22
- package/src/newModules/fixedTime/FixedTimePage.tsx +12 -11
- package/src/newModules/lightMode/LightModePage.tsx +9 -8
- package/src/newModules/mood/AddMoodPage.tsx +3 -2
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +13 -12
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +19 -18
- package/src/newModules/mood/MoodActions.ts +17 -4
- package/src/newModules/mood/MoodInfo.ts +0 -7
- package/src/newModules/mood/MoodItem.tsx +5 -4
- package/src/newModules/mood/MoodPage.tsx +9 -4
- package/src/newModules/mood/RecommendMoodItem.tsx +4 -3
- package/src/newModules/mood/StaticMoodEditorPage.tsx +5 -4
- package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +6 -5
- package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +10 -9
- package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +8 -7
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +15 -14
- package/src/newModules/randomTime/RandomTimePage.tsx +12 -11
- package/src/newModules/randomTime/Summary.tsx +7 -6
- package/src/newModules/remoteControl/RemoteControlPage.tsx +3 -2
- package/src/newModules/select/SelectPage.tsx +10 -9
- package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +24 -23
- package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +15 -14
- package/src/newModules/switchGradient/SwitchGradientPage.tsx +4 -3
- package/src/newModules/swithInching/SwithInching.tsx +7 -6
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +20 -19
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +8 -7
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +9 -9
- package/src/newModules/timeSchedule/components/ScheduleCard.tsx +6 -4
|
@@ -10,6 +10,7 @@ import res from '@ledvance/base/src/res'
|
|
|
10
10
|
import { useReactive, useUpdateEffect } from 'ahooks'
|
|
11
11
|
import { useParams } from '@ledvance/base/src/hooks/Hooks'
|
|
12
12
|
import {Result} from "@ledvance/base/src/models/modules/Result";
|
|
13
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
13
14
|
|
|
14
15
|
const { convertX: cx } = Utils.RatioUtils
|
|
15
16
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -29,7 +30,7 @@ export const useLightMode = (code: string): [LightMode, (v: LightMode) => Promis
|
|
|
29
30
|
return useDp(code)
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
const LightModePage = (props: { theme?:
|
|
33
|
+
const LightModePage = (props: { theme?: ThemeType }) => {
|
|
33
34
|
const params = useParams<LightModePageParams>()
|
|
34
35
|
const deviceInfo = useDeviceInfo()
|
|
35
36
|
const [lightMode, setLightMode] = useLightMode(params.lightModeCode)
|
|
@@ -49,25 +50,25 @@ const LightModePage = (props: { theme?: any }) => {
|
|
|
49
50
|
},
|
|
50
51
|
desc: {
|
|
51
52
|
marginHorizontal: cx(24),
|
|
52
|
-
color: props.theme
|
|
53
|
+
color: props.theme?.global.fontColor,
|
|
53
54
|
fontSize: cx(14),
|
|
54
55
|
fontWeight: 'bold',
|
|
55
56
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
56
57
|
},
|
|
57
58
|
tipText: {
|
|
58
59
|
marginHorizontal: cx(24),
|
|
59
|
-
color: props.theme
|
|
60
|
+
color: props.theme?.global.fontColor,
|
|
60
61
|
fontSize: cx(14),
|
|
61
62
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
62
63
|
},
|
|
63
64
|
modeSelectGroup: {
|
|
64
65
|
marginHorizontal: cx(24),
|
|
65
|
-
backgroundColor: props.theme
|
|
66
|
+
backgroundColor: props.theme?.container.background,
|
|
66
67
|
borderRadius: cx(4),
|
|
67
68
|
},
|
|
68
69
|
modeTip: {
|
|
69
70
|
marginHorizontal: cx(8),
|
|
70
|
-
color: props.theme
|
|
71
|
+
color: props.theme?.global.fontColor,
|
|
71
72
|
fontSize: cx(14),
|
|
72
73
|
fontWeight: 'bold',
|
|
73
74
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
@@ -78,7 +79,7 @@ const LightModePage = (props: { theme?: any }) => {
|
|
|
78
79
|
line: {
|
|
79
80
|
height: cx(1),
|
|
80
81
|
marginHorizontal: cx(12),
|
|
81
|
-
backgroundColor: props.theme
|
|
82
|
+
backgroundColor: props.theme?.container.divider,
|
|
82
83
|
},
|
|
83
84
|
itemRoot: {
|
|
84
85
|
flexDirection: 'row',
|
|
@@ -92,12 +93,12 @@ const LightModePage = (props: { theme?: any }) => {
|
|
|
92
93
|
justifyContent: 'center',
|
|
93
94
|
},
|
|
94
95
|
itemTitle: {
|
|
95
|
-
color: props.theme
|
|
96
|
+
color: props.theme?.global.fontColor,
|
|
96
97
|
fontSize: cx(14),
|
|
97
98
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
98
99
|
},
|
|
99
100
|
itemContent: {
|
|
100
|
-
color: props.theme
|
|
101
|
+
color: props.theme?.global.secondFontColor,
|
|
101
102
|
fontSize: cx(14),
|
|
102
103
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
103
104
|
},
|
|
@@ -17,6 +17,7 @@ import { Result } from '@ledvance/base/src/models/modules/Result';
|
|
|
17
17
|
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
18
18
|
import { difference, head, range } from 'lodash';
|
|
19
19
|
import { RecommendMood, getRecommendMixMoods, getRecommendMoods } from './MoodInfo';
|
|
20
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
20
21
|
|
|
21
22
|
const cx = Utils.RatioUtils.convertX;
|
|
22
23
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -33,7 +34,7 @@ interface AddMoodPageState {
|
|
|
33
34
|
data: RecommendMood[];
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
const AddMoodPage = (props: { theme?:
|
|
37
|
+
const AddMoodPage = (props: { theme?: ThemeType }) => {
|
|
37
38
|
const navigation = useNavigation();
|
|
38
39
|
const routeParams = useRoute().params as AddMoodPageParams;
|
|
39
40
|
const moduleParams = routeParams.moduleParams;
|
|
@@ -85,7 +86,7 @@ const AddMoodPage = (props: { theme?: any }) => {
|
|
|
85
86
|
flexDirection: 'column',
|
|
86
87
|
},
|
|
87
88
|
desc: {
|
|
88
|
-
color: props.theme
|
|
89
|
+
color: props.theme?.global.fontColor,
|
|
89
90
|
fontSize: cx(16),
|
|
90
91
|
marginHorizontal: cx(24),
|
|
91
92
|
marginTop: cx(12),
|
|
@@ -36,11 +36,12 @@ import {
|
|
|
36
36
|
import TextFieldStyleButton from '@ledvance/base/src/components/TextFieldStyleButton';
|
|
37
37
|
import FanAdjustView from '@ledvance/base/src/components/FanAdjustView';
|
|
38
38
|
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
39
|
-
import { SelectPageParams } from '
|
|
39
|
+
import { SelectPageParams } from '../select/SelectPage';
|
|
40
40
|
import I18n from '@ledvance/base/src/i18n';
|
|
41
41
|
import Segmented from '@ledvance/base/src/components/Segmented';
|
|
42
42
|
import { MoodNodeInfo } from './Interface';
|
|
43
43
|
import { showDialog } from '@ledvance/base/src/utils/common';
|
|
44
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
44
45
|
|
|
45
46
|
const cx = Utils.RatioUtils.convertX;
|
|
46
47
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -52,7 +53,7 @@ interface DynamicMoodEditorPageState {
|
|
|
52
53
|
sceneMode: StripLightMoodMode;
|
|
53
54
|
loading: boolean;
|
|
54
55
|
}
|
|
55
|
-
const DynamicMoodEditorPage = (props: { theme?:
|
|
56
|
+
const DynamicMoodEditorPage = (props: { theme?: ThemeType }) => {
|
|
56
57
|
const navigation = useNavigation();
|
|
57
58
|
const routeParams = useRoute().params as StaticMoodEditorPageParams;
|
|
58
59
|
const params = cloneDeep(routeParams);
|
|
@@ -155,7 +156,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
155
156
|
marginHorizontal: cx(16),
|
|
156
157
|
},
|
|
157
158
|
light: {
|
|
158
|
-
color: props.theme
|
|
159
|
+
color: props.theme?.global.fontColor,
|
|
159
160
|
fontSize: cx(18),
|
|
160
161
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
161
162
|
},
|
|
@@ -211,17 +212,17 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
211
212
|
borderRadius: cx(8),
|
|
212
213
|
borderWidth: cx(1),
|
|
213
214
|
borderStyle: 'dashed',
|
|
214
|
-
borderColor: props.theme
|
|
215
|
-
backgroundColor: props.theme
|
|
215
|
+
borderColor: props.theme?.addNode.border,
|
|
216
|
+
backgroundColor: props.theme?.addNode.background,
|
|
216
217
|
},
|
|
217
218
|
deleteBtn: {
|
|
218
219
|
width: '100%',
|
|
219
220
|
height: cx(50),
|
|
220
|
-
backgroundColor: props.theme
|
|
221
|
+
backgroundColor: props.theme?.button.delete,
|
|
221
222
|
borderRadius: cx(8),
|
|
222
223
|
},
|
|
223
224
|
deleteBtnText: {
|
|
224
|
-
color: props.theme
|
|
225
|
+
color: props.theme?.button.fontColor,
|
|
225
226
|
fontSize: cx(16),
|
|
226
227
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
227
228
|
},
|
|
@@ -265,7 +266,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
265
266
|
}}
|
|
266
267
|
maxLength={33}
|
|
267
268
|
showError={state.mood.name.length > 32 || nameRepeat}
|
|
268
|
-
tipColor={nameRepeat ? props.theme
|
|
269
|
+
tipColor={nameRepeat ? props.theme?.global.error : undefined}
|
|
269
270
|
tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
|
|
270
271
|
errorText={Strings.getLang(
|
|
271
272
|
nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text'
|
|
@@ -382,7 +383,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
382
383
|
<Image
|
|
383
384
|
style={[
|
|
384
385
|
styles.adjustButton,
|
|
385
|
-
{ tintColor: state.mainBucketSelected ? props.theme
|
|
386
|
+
{ tintColor: state.mainBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal },
|
|
386
387
|
]}
|
|
387
388
|
source={res.ic_paint_bucket}
|
|
388
389
|
/>
|
|
@@ -395,7 +396,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
395
396
|
<Image
|
|
396
397
|
style={[
|
|
397
398
|
styles.adjustButton,
|
|
398
|
-
{ tintColor: state.mainBucketSelected ? props.theme
|
|
399
|
+
{ tintColor: state.mainBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary },
|
|
399
400
|
]}
|
|
400
401
|
source={res.ic_colorize}
|
|
401
402
|
/>
|
|
@@ -430,7 +431,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
430
431
|
style={[
|
|
431
432
|
styles.nodeDeleteIcon,
|
|
432
433
|
{
|
|
433
|
-
tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme
|
|
434
|
+
tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
|
|
434
435
|
},
|
|
435
436
|
]}
|
|
436
437
|
source={res.ic_mood_del}
|
|
@@ -462,7 +463,7 @@ const DynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
462
463
|
style={{
|
|
463
464
|
width: cx(18),
|
|
464
465
|
height: cx(18),
|
|
465
|
-
tintColor: props.theme
|
|
466
|
+
tintColor: props.theme?.global.fontColor,
|
|
466
467
|
}}
|
|
467
468
|
source={{ uri: res.add }}
|
|
468
469
|
/>
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
} from './Interface';
|
|
33
33
|
import TextFieldStyleButton from '@ledvance/base/src/components/TextFieldStyleButton';
|
|
34
34
|
import {ui_biz_routerKey} from '../../navigation/Routers'
|
|
35
|
-
import { SelectPageParams } from '
|
|
35
|
+
import { SelectPageParams } from '../select/SelectPage';
|
|
36
36
|
import I18n from '@ledvance/base/src/i18n';
|
|
37
37
|
import Segmented from '@ledvance/base/src/components/Segmented';
|
|
38
38
|
import { MoodNodeInfo } from './Interface';
|
|
@@ -40,6 +40,7 @@ import ColorAdjustView from '@ledvance/base/src/components/ColorAdjustView';
|
|
|
40
40
|
import LdvSwitch from '@ledvance/base/src/components/ldvSwitch';
|
|
41
41
|
import ColorTempAdjustView from '@ledvance/base/src/components/ColorTempAdjustView';
|
|
42
42
|
import { showDialog } from '@ledvance/base/src/utils/common';
|
|
43
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
43
44
|
|
|
44
45
|
const cx = Utils.RatioUtils.convertX;
|
|
45
46
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -51,7 +52,7 @@ interface MixDynamicMoodEditorPageState extends StaticMoodEditorPageState {
|
|
|
51
52
|
sceneMode: StripLightMoodMode;
|
|
52
53
|
mainSceneMode: any
|
|
53
54
|
}
|
|
54
|
-
const MixDynamicMoodEditorPage = (props: { theme?:
|
|
55
|
+
const MixDynamicMoodEditorPage = (props: { theme?: ThemeType }) => {
|
|
55
56
|
const navigation = useNavigation();
|
|
56
57
|
const routeParams = useRoute().params as StaticMoodEditorPageParams;
|
|
57
58
|
const params = cloneDeep(routeParams);
|
|
@@ -167,7 +168,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
167
168
|
marginHorizontal: cx(16),
|
|
168
169
|
},
|
|
169
170
|
light: {
|
|
170
|
-
color: props.theme
|
|
171
|
+
color: props.theme?.global.fontColor,
|
|
171
172
|
fontSize: cx(18),
|
|
172
173
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
173
174
|
},
|
|
@@ -223,17 +224,17 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
223
224
|
borderRadius: cx(8),
|
|
224
225
|
borderWidth: cx(1),
|
|
225
226
|
borderStyle: 'dashed',
|
|
226
|
-
borderColor: props.theme
|
|
227
|
-
backgroundColor: props.theme
|
|
227
|
+
borderColor: props.theme?.addNode.border,
|
|
228
|
+
backgroundColor: props.theme?.addNode.background,
|
|
228
229
|
},
|
|
229
230
|
deleteBtn: {
|
|
230
231
|
width: '100%',
|
|
231
232
|
height: cx(50),
|
|
232
|
-
backgroundColor: props.theme
|
|
233
|
+
backgroundColor: props.theme?.button.delete,
|
|
233
234
|
borderRadius: cx(8),
|
|
234
235
|
},
|
|
235
236
|
deleteBtnText: {
|
|
236
|
-
color: props.theme
|
|
237
|
+
color: props.theme?.button.fontColor,
|
|
237
238
|
fontSize: cx(16),
|
|
238
239
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
239
240
|
},
|
|
@@ -289,7 +290,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
289
290
|
}}
|
|
290
291
|
maxLength={33}
|
|
291
292
|
showError={state.mood.name.length > 32 || nameRepeat}
|
|
292
|
-
tipColor={nameRepeat ? props.theme
|
|
293
|
+
tipColor={nameRepeat ? props.theme?.global.error : undefined}
|
|
293
294
|
tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
|
|
294
295
|
errorText={Strings.getLang(
|
|
295
296
|
nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text'
|
|
@@ -298,7 +299,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
298
299
|
<Card style={styles.adjustCard}>
|
|
299
300
|
<LdvSwitch
|
|
300
301
|
title={I18n.getLang('light_sources_tile_main_lighting_headline')}
|
|
301
|
-
color={props.theme
|
|
302
|
+
color={props.theme?.card.background}
|
|
302
303
|
colorAlpha={1}
|
|
303
304
|
enable={!!state.mood.mainLamp.enable}
|
|
304
305
|
setEnable={v => {
|
|
@@ -368,7 +369,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
368
369
|
<Image
|
|
369
370
|
style={[
|
|
370
371
|
styles.adjustButton,
|
|
371
|
-
{ tintColor: state.mainBucketSelected ? props.theme
|
|
372
|
+
{ tintColor: state.mainBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal },
|
|
372
373
|
]}
|
|
373
374
|
source={res.ic_paint_bucket}
|
|
374
375
|
/>
|
|
@@ -381,7 +382,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
381
382
|
<Image
|
|
382
383
|
style={[
|
|
383
384
|
styles.adjustButton,
|
|
384
|
-
{ tintColor: state.mainBucketSelected ? props.theme
|
|
385
|
+
{ tintColor: state.mainBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary },
|
|
385
386
|
]}
|
|
386
387
|
source={res.ic_colorize}
|
|
387
388
|
/>
|
|
@@ -417,7 +418,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
417
418
|
style={[
|
|
418
419
|
styles.nodeDeleteIcon,
|
|
419
420
|
{
|
|
420
|
-
tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme
|
|
421
|
+
tintColor: state.mood.mainLamp.nodes.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
|
|
421
422
|
},
|
|
422
423
|
]}
|
|
423
424
|
source={res.ic_mood_del}
|
|
@@ -449,7 +450,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
449
450
|
style={{
|
|
450
451
|
width: cx(18),
|
|
451
452
|
height: cx(18),
|
|
452
|
-
tintColor: props.theme
|
|
453
|
+
tintColor: props.theme?.addNode.fontColor,
|
|
453
454
|
}}
|
|
454
455
|
source={{ uri: res.add }}
|
|
455
456
|
/>
|
|
@@ -493,7 +494,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
493
494
|
<Card style={styles.adjustCard}>
|
|
494
495
|
<LdvSwitch
|
|
495
496
|
title={I18n.getLang('light_sources_tile_sec_lighting_headline')}
|
|
496
|
-
color={props.theme
|
|
497
|
+
color={props.theme?.card.background}
|
|
497
498
|
colorAlpha={1}
|
|
498
499
|
enable={!!state.mood.secondaryLamp.enable}
|
|
499
500
|
setEnable={v => {
|
|
@@ -633,7 +634,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
633
634
|
<Image
|
|
634
635
|
style={[
|
|
635
636
|
styles.adjustButton,
|
|
636
|
-
{ tintColor: state.secondaryBucketSelected ? props.theme
|
|
637
|
+
{ tintColor: state.secondaryBucketSelected ? props.theme?.icon.primary : props.theme?.icon.normal },
|
|
637
638
|
]}
|
|
638
639
|
source={res.ic_paint_bucket}
|
|
639
640
|
/>
|
|
@@ -646,7 +647,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
646
647
|
<Image
|
|
647
648
|
style={[
|
|
648
649
|
styles.adjustButton,
|
|
649
|
-
{ tintColor: state.secondaryBucketSelected ? props.theme
|
|
650
|
+
{ tintColor: state.secondaryBucketSelected ? props.theme?.icon.normal : props.theme?.icon.primary },
|
|
650
651
|
]}
|
|
651
652
|
source={res.ic_colorize}
|
|
652
653
|
/>
|
|
@@ -682,7 +683,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
682
683
|
styles.nodeDeleteIcon,
|
|
683
684
|
{
|
|
684
685
|
tintColor:
|
|
685
|
-
state.mood.secondaryLamp.nodes.length < 3 ? props.theme
|
|
686
|
+
state.mood.secondaryLamp.nodes.length < 3 ? props.theme?.icon.disable : props.theme?.icon.normal,
|
|
686
687
|
},
|
|
687
688
|
]}
|
|
688
689
|
source={res.ic_mood_del}
|
|
@@ -714,7 +715,7 @@ const MixDynamicMoodEditorPage = (props: { theme?: any }) => {
|
|
|
714
715
|
style={{
|
|
715
716
|
width: cx(18),
|
|
716
717
|
height: cx(18),
|
|
717
|
-
tintColor: props.theme
|
|
718
|
+
tintColor: props.theme?.addNode.fontColor,
|
|
718
719
|
}}
|
|
719
720
|
source={{ uri: res.add }}
|
|
720
721
|
/>
|
|
@@ -128,9 +128,17 @@ export const getRemoteMoodList = async (
|
|
|
128
128
|
data: result.data.map((item, index) => remoteMoodInfo2MoodUIState(item, index, option)),
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
+
const moodUIData = res.data.map((item, index) => remoteMoodInfo2MoodUIState(item, index, option)).filter(item => {
|
|
132
|
+
if (!option.isSupportTemperature) {
|
|
133
|
+
const isContainTemperature = item.mainLamp?.nodes?.some(node => !node.isColorNode && node.colorTemp > 0) || false
|
|
134
|
+
return !isContainTemperature;
|
|
135
|
+
} else {
|
|
136
|
+
return true
|
|
137
|
+
}
|
|
138
|
+
});
|
|
131
139
|
return {
|
|
132
140
|
success: true,
|
|
133
|
-
data:
|
|
141
|
+
data: moodUIData,
|
|
134
142
|
};
|
|
135
143
|
} else {
|
|
136
144
|
const res = await NativeApi.getJson(devId, moodFeatureId);
|
|
@@ -249,7 +257,12 @@ export const saveMoodList = (
|
|
|
249
257
|
return setRemoteMoodList(devId, isFeature, remoteMoods, moodFeatureId);
|
|
250
258
|
};
|
|
251
259
|
|
|
252
|
-
|
|
260
|
+
interface SceneStatusParams {
|
|
261
|
+
isSupportSceneStatus?: boolean
|
|
262
|
+
sceneStatusType: SceneStatusType
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function useSceneStatusId(params: SceneStatusParams): [number, (moodId: number) => Promise<any>] {
|
|
253
266
|
const devId = useDeviceId();
|
|
254
267
|
const [sceneStatusId, setSceneStatusId] = useState(-1);
|
|
255
268
|
if (!params.isSupportSceneStatus) {
|
|
@@ -262,14 +275,14 @@ export function useSceneStatusId(params: MoodPageParams): [number, (moodId: numb
|
|
|
262
275
|
}
|
|
263
276
|
useEffect(() => {
|
|
264
277
|
getFeature(devId, "SceneStatus").then((res) => {
|
|
265
|
-
if (res.data && res.data.type ===
|
|
278
|
+
if (res.data && res.data.type === params.sceneStatusType) {
|
|
266
279
|
setSceneStatusId(res.data.id)
|
|
267
280
|
}
|
|
268
281
|
})
|
|
269
282
|
}, [])
|
|
270
283
|
const setSceneStatusIdRemote = useCallback((moodId: number) => {
|
|
271
284
|
return new Promise<any>((resolve, _reject) => {
|
|
272
|
-
putFeature(devId, "SceneStatus", {type:
|
|
285
|
+
putFeature(devId, "SceneStatus", {type: params.sceneStatusType, id: moodId}).then((res) => {
|
|
273
286
|
setSceneStatusId(moodId);
|
|
274
287
|
resolve(res);
|
|
275
288
|
})
|
|
@@ -206,13 +206,6 @@ function getOnlyRGBDefSceneList(): RemoteMoodInfo[] {
|
|
|
206
206
|
t: 0,
|
|
207
207
|
e: false,
|
|
208
208
|
},
|
|
209
|
-
{
|
|
210
|
-
n: I18n.getLang('mesh_device_detail_lighting_white_mode'),
|
|
211
|
-
i: '0646460100000000000003e8000046460100000000000003e8019046460100000000000003e803e8',
|
|
212
|
-
s: '',
|
|
213
|
-
t: 0,
|
|
214
|
-
e: false,
|
|
215
|
-
},
|
|
216
209
|
...defColorSceneList,
|
|
217
210
|
];
|
|
218
211
|
}
|
|
@@ -10,6 +10,7 @@ import MoodColorsLine from '@ledvance/base/src/components/MoodColorsLine';
|
|
|
10
10
|
import { MoodJumpGradientMode, MoodLampInfo, MoodUIInfo } from './Interface';
|
|
11
11
|
import I18n from '@ledvance/base/src/i18n';
|
|
12
12
|
import res from '@ledvance/base/src/res';
|
|
13
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
13
14
|
|
|
14
15
|
const cx = Utils.RatioUtils.convertX;
|
|
15
16
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -22,7 +23,7 @@ interface LightCategory {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
interface MoodItemProps extends ViewProps {
|
|
25
|
-
theme?:
|
|
26
|
+
theme?: ThemeType
|
|
26
27
|
enable: boolean;
|
|
27
28
|
isMix: boolean;
|
|
28
29
|
mood: MoodUIInfo;
|
|
@@ -53,7 +54,7 @@ const MoodItem = (props: MoodItemProps) => {
|
|
|
53
54
|
},
|
|
54
55
|
headText: {
|
|
55
56
|
flex: 1,
|
|
56
|
-
color: props.theme
|
|
57
|
+
color: props.theme?.global.fontColor,
|
|
57
58
|
fontSize: cx(16),
|
|
58
59
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
59
60
|
lineHeight: cx(20),
|
|
@@ -64,12 +65,12 @@ const MoodItem = (props: MoodItemProps) => {
|
|
|
64
65
|
moodTypeLabel: {
|
|
65
66
|
marginStart: cx(16),
|
|
66
67
|
paddingHorizontal: cx(12.5),
|
|
67
|
-
backgroundColor: props.theme
|
|
68
|
+
backgroundColor: props.theme?.tag.background,
|
|
68
69
|
borderRadius: cx(8),
|
|
69
70
|
},
|
|
70
71
|
moodTypeLabelText: {
|
|
71
72
|
height: cx(16),
|
|
72
|
-
color: props.theme
|
|
73
|
+
color: props.theme?.tag.fontColor,
|
|
73
74
|
fontSize: cx(10),
|
|
74
75
|
textAlignVertical: 'center',
|
|
75
76
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
@@ -24,16 +24,18 @@ import { useParams } from '@ledvance/base/src/hooks/Hooks';
|
|
|
24
24
|
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
25
25
|
import { cloneDeep, filter, map } from 'lodash';
|
|
26
26
|
import { saveFlagMode } from '@ledvance/ui-biz-bundle/src/modules/flags/FlagActions';
|
|
27
|
-
import { WorkMode } from '@ledvance/base/src/utils/interface';
|
|
27
|
+
import { SceneStatusType, WorkMode } from '@ledvance/base/src/utils/interface';
|
|
28
28
|
import { showDialog } from '@ledvance/base/src/utils/common';
|
|
29
29
|
import I18n from '@ledvance/base/src/i18n';
|
|
30
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
31
|
+
|
|
30
32
|
|
|
31
33
|
const cx = Utils.RatioUtils.convertX;
|
|
32
34
|
const { withTheme } = Utils.ThemeUtils
|
|
33
35
|
|
|
34
36
|
const MAX_MOOD_COUNT = 255;
|
|
35
37
|
|
|
36
|
-
const MoodPage = (props: { theme?:
|
|
38
|
+
const MoodPage = (props: { theme?: ThemeType }) => {
|
|
37
39
|
const params = useParams<MoodPageParams>();
|
|
38
40
|
const deviceInfo = useDeviceInfo();
|
|
39
41
|
const devId = useDeviceId();
|
|
@@ -44,7 +46,10 @@ const MoodPage = (props: { theme?: any }) => {
|
|
|
44
46
|
const [secondaryWork, setSecondaryWork] = useWorkMode(params.secondaryWorkMode!);
|
|
45
47
|
const [switchLed] = useSwitchLed(params.switchLedDp)
|
|
46
48
|
const [flagMode, setFlagMode] = useFlagMode();
|
|
47
|
-
const [sceneStatusId, setSceneStatusId] = useSceneStatusId(
|
|
49
|
+
const [sceneStatusId, setSceneStatusId] = useSceneStatusId({
|
|
50
|
+
isSupportSceneStatus: params.isSupportSceneStatus,
|
|
51
|
+
sceneStatusType: SceneStatusType.Mood
|
|
52
|
+
});
|
|
48
53
|
|
|
49
54
|
const state = useReactive<MoodPageState>({
|
|
50
55
|
currentMood: undefined,
|
|
@@ -369,7 +374,7 @@ const MoodPage = (props: { theme?: any }) => {
|
|
|
369
374
|
<InfoText
|
|
370
375
|
icon={res.ic_warning_amber}
|
|
371
376
|
text={Strings.getLang('mood_overview_warning_max_number_text')}
|
|
372
|
-
contentColor={props.theme
|
|
377
|
+
contentColor={props.theme?.global.warning}
|
|
373
378
|
/>
|
|
374
379
|
<Spacer height={cx(6)} />
|
|
375
380
|
</View>
|
|
@@ -6,6 +6,7 @@ import { StyleSheet, View } from 'react-native';
|
|
|
6
6
|
import Spacer from '@ledvance/base/src/components/Spacer';
|
|
7
7
|
import { MoodJumpGradientMode, MoodUIInfo } from './Interface';
|
|
8
8
|
import { MixMoodColorsLine } from './MoodItem';
|
|
9
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
9
10
|
|
|
10
11
|
const cx = Utils.RatioUtils.convertX;
|
|
11
12
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -18,7 +19,7 @@ interface LightCategory {
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
interface RecommendMixMoodItemProps {
|
|
21
|
-
theme?:
|
|
22
|
+
theme?: ThemeType
|
|
22
23
|
title: string;
|
|
23
24
|
isMix: boolean;
|
|
24
25
|
mood: MoodUIInfo;
|
|
@@ -46,7 +47,7 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
|
|
|
46
47
|
width: cx(295)
|
|
47
48
|
},
|
|
48
49
|
title: {
|
|
49
|
-
color: props.theme
|
|
50
|
+
color: props.theme?.global.fontColor,
|
|
50
51
|
fontSize: cx(16),
|
|
51
52
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
52
53
|
},
|
|
@@ -63,7 +64,7 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
|
|
|
63
64
|
style={styles.content}
|
|
64
65
|
titleStyle={styles.title}
|
|
65
66
|
iconStyle={{
|
|
66
|
-
color: props.theme
|
|
67
|
+
color: props.theme?.global.fontColor,
|
|
67
68
|
size: cx(16),
|
|
68
69
|
}}
|
|
69
70
|
/>
|
|
@@ -23,6 +23,7 @@ import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
|
23
23
|
import LdvSwitch from '@ledvance/base/src/components/ldvSwitch';
|
|
24
24
|
import { showDialog } from '@ledvance/base/src/utils/common';
|
|
25
25
|
import ColorAdjustView from '@ledvance/base/src/components/ColorAdjustView';
|
|
26
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
26
27
|
|
|
27
28
|
const cx = Utils.RatioUtils.convertX;
|
|
28
29
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -43,7 +44,7 @@ export interface StaticMoodEditorPageState {
|
|
|
43
44
|
loading: boolean;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
const StaticMoodEditorPage = (props: { theme?:
|
|
47
|
+
const StaticMoodEditorPage = (props: { theme?: ThemeType }) => {
|
|
47
48
|
const navigation = useNavigation();
|
|
48
49
|
const routeParams = useParams<StaticMoodEditorPageParams>();
|
|
49
50
|
const params = cloneDeep(routeParams);
|
|
@@ -142,11 +143,11 @@ const StaticMoodEditorPage = (props: { theme?: any }) => {
|
|
|
142
143
|
deleteBtn: {
|
|
143
144
|
width: '100%',
|
|
144
145
|
height: cx(50),
|
|
145
|
-
backgroundColor: props.theme
|
|
146
|
+
backgroundColor: props.theme?.button.delete,
|
|
146
147
|
borderRadius: cx(8),
|
|
147
148
|
},
|
|
148
149
|
deleteBtnText: {
|
|
149
|
-
color: props.theme
|
|
150
|
+
color: props.theme?.button.fontColor,
|
|
150
151
|
fontSize: cx(16),
|
|
151
152
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
152
153
|
},
|
|
@@ -182,7 +183,7 @@ const StaticMoodEditorPage = (props: { theme?: any }) => {
|
|
|
182
183
|
}}
|
|
183
184
|
maxLength={33}
|
|
184
185
|
showError={state.mood.name.length > 32 || nameRepeat}
|
|
185
|
-
tipColor={nameRepeat ? props.theme
|
|
186
|
+
tipColor={nameRepeat ? props.theme?.global.error : undefined}
|
|
186
187
|
tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
|
|
187
188
|
errorText={I18n.getLang(
|
|
188
189
|
nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text'
|
|
@@ -8,6 +8,7 @@ import Spacer from "@ledvance/base/src/components/Spacer";
|
|
|
8
8
|
import {StyleSheet, Text, View} from "react-native";
|
|
9
9
|
import {Result} from "@ledvance/base/src/models/modules/Result";
|
|
10
10
|
import {useParams} from "@ledvance/base/src/hooks/Hooks";
|
|
11
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
11
12
|
|
|
12
13
|
const { convertX: cx } = Utils.RatioUtils
|
|
13
14
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -20,7 +21,7 @@ export function useOverchargeSwitch(overchargeSwitchCode: string): [boolean, (v:
|
|
|
20
21
|
return useDp(overchargeSwitchCode)
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
const OverchargeSwitchPage = (props: { theme?:
|
|
24
|
+
const OverchargeSwitchPage = (props: { theme?: ThemeType }) => {
|
|
24
25
|
const params = useParams<OverchargeSwitchPageParams>()
|
|
25
26
|
const devInfo = useDeviceInfo()
|
|
26
27
|
const [overchargeSwitch, setOverchargeSwitch] = useOverchargeSwitch(params.overchargeSwitchCode)
|
|
@@ -37,16 +38,16 @@ const OverchargeSwitchPage = (props: { theme?: any }) => {
|
|
|
37
38
|
marginTop: cx(30)
|
|
38
39
|
},
|
|
39
40
|
title: {
|
|
40
|
-
color: props.theme
|
|
41
|
+
color: props.theme?.global.fontColor,
|
|
41
42
|
fontSize: cx(14),
|
|
42
43
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
43
44
|
paddingVertical: cx(16),
|
|
44
45
|
},
|
|
45
46
|
desc: {
|
|
46
|
-
color: props.theme
|
|
47
|
+
color: props.theme?.global.fontColor,
|
|
47
48
|
},
|
|
48
49
|
shadow: {
|
|
49
|
-
shadowColor: props.theme
|
|
50
|
+
shadowColor: props.theme?.card.shadowColor,
|
|
50
51
|
shadowOpacity: 0.2,
|
|
51
52
|
shadowRadius: 8,
|
|
52
53
|
elevation:8,
|
|
@@ -54,7 +55,7 @@ const OverchargeSwitchPage = (props: { theme?: any }) => {
|
|
|
54
55
|
width: 0,
|
|
55
56
|
height: 4,
|
|
56
57
|
},
|
|
57
|
-
backgroundColor: props.theme
|
|
58
|
+
backgroundColor: props.theme?.card.background,
|
|
58
59
|
borderRadius: 8,
|
|
59
60
|
},
|
|
60
61
|
})
|