@ledvance/ui-biz-bundle 1.1.93 → 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 +5 -4
- 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
|
@@ -21,6 +21,7 @@ import { EnergyConsumptionChartProps } from "./EnergyConsumptionChart";
|
|
|
21
21
|
import EnergyPopup, { EnergyData, UnitList } from "./component/EnergyModal";
|
|
22
22
|
import { NativeApi } from "@ledvance/base/src/api/native";
|
|
23
23
|
import { carbonDioxideEmission, countryAndRegion } from "./co2Data";
|
|
24
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
24
25
|
|
|
25
26
|
const { convertX: cx } = Utils.RatioUtils
|
|
26
27
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -50,7 +51,7 @@ interface EnergyConsumptionState {
|
|
|
50
51
|
popupType: PopupType
|
|
51
52
|
co2Saved: string
|
|
52
53
|
}
|
|
53
|
-
const EnergyConsumptionPage = (props: {theme?:
|
|
54
|
+
const EnergyConsumptionPage = (props: {theme?: ThemeType}) => {
|
|
54
55
|
const params = useRoute().params as EnergyConsumptionPageProps
|
|
55
56
|
const devId = useDeviceId()
|
|
56
57
|
const navigation = useNavigation()
|
|
@@ -138,7 +139,7 @@ const EnergyConsumptionPage = (props: {theme?: any}) => {
|
|
|
138
139
|
padding: cx(16)
|
|
139
140
|
},
|
|
140
141
|
cardTitle: {
|
|
141
|
-
color: props.theme
|
|
142
|
+
color: props.theme?.global.fontColor,
|
|
142
143
|
fontSize: cx(16),
|
|
143
144
|
fontWeight: 'bold'
|
|
144
145
|
},
|
|
@@ -147,7 +148,7 @@ const EnergyConsumptionPage = (props: {theme?: any}) => {
|
|
|
147
148
|
flexDirection: 'row',
|
|
148
149
|
},
|
|
149
150
|
consumptionNum: {
|
|
150
|
-
color: props.theme
|
|
151
|
+
color: props.theme?.global.secondBrand,
|
|
151
152
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
152
153
|
},
|
|
153
154
|
subContent: {
|
|
@@ -158,19 +159,19 @@ const EnergyConsumptionPage = (props: {theme?: any}) => {
|
|
|
158
159
|
valueText: {
|
|
159
160
|
fontSize: cx(24),
|
|
160
161
|
fontWeight: 'bold',
|
|
161
|
-
color: props.theme
|
|
162
|
+
color: props.theme?.global.secondBrand,
|
|
162
163
|
},
|
|
163
164
|
titleText: {
|
|
164
165
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
165
166
|
fontSize: cx(14),
|
|
166
|
-
color: props.theme
|
|
167
|
+
color: props.theme?.global.secondFontColor,
|
|
167
168
|
textAlign: 'center',
|
|
168
169
|
},
|
|
169
170
|
priceBg: {
|
|
170
171
|
height: cx(40),
|
|
171
172
|
width: cx(40),
|
|
172
173
|
borderRadius: cx(40),
|
|
173
|
-
backgroundColor: props.theme
|
|
174
|
+
backgroundColor: props.theme?.global.thirdBrand,
|
|
174
175
|
justifyContent: 'center',
|
|
175
176
|
alignItems: 'center',
|
|
176
177
|
marginRight: cx(10)
|
|
@@ -183,7 +184,7 @@ const EnergyConsumptionPage = (props: {theme?: any}) => {
|
|
|
183
184
|
paddingHorizontal: cx(10),
|
|
184
185
|
paddingVertical: cx(8),
|
|
185
186
|
marginTop: cx(8),
|
|
186
|
-
backgroundColor: props.theme
|
|
187
|
+
backgroundColor: props.theme?.button.primary,
|
|
187
188
|
alignItems: 'center',
|
|
188
189
|
justifyContent: 'center'
|
|
189
190
|
},
|
|
@@ -290,12 +291,12 @@ const EnergyConsumptionPage = (props: {theme?: any}) => {
|
|
|
290
291
|
<Image
|
|
291
292
|
source={res.energy_consumption_cash}
|
|
292
293
|
resizeMode="contain"
|
|
293
|
-
style={{ height: cx(20), width: cx(20), tintColor: props.theme
|
|
294
|
+
style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.primary }}
|
|
294
295
|
/>
|
|
295
296
|
</View>
|
|
296
297
|
<View style={styles.priceNum}>
|
|
297
298
|
<View style={{ flexDirection: 'row' }}>
|
|
298
|
-
<Text style={{ color: props.theme
|
|
299
|
+
<Text style={{ color: props.theme?.global.secondFontColor, marginRight: cx(5) }}>{I18n.getLang('consumption_data_field3_co2_topic_text')}</Text>
|
|
299
300
|
<TouchableOpacity
|
|
300
301
|
onPress={() => {
|
|
301
302
|
state.showPopup = true
|
|
@@ -305,11 +306,11 @@ const EnergyConsumptionPage = (props: {theme?: any}) => {
|
|
|
305
306
|
<Image
|
|
306
307
|
source={res.co2Icon}
|
|
307
308
|
resizeMode="contain"
|
|
308
|
-
style={{ height: cx(20), width: cx(20), tintColor: props.theme
|
|
309
|
+
style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.primary }}
|
|
309
310
|
/>
|
|
310
311
|
</TouchableOpacity>
|
|
311
312
|
</View>
|
|
312
|
-
<Text style={{ color: props.theme
|
|
313
|
+
<Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>{`${state.co2Saved} kg`}</Text>
|
|
313
314
|
</View>
|
|
314
315
|
</View>
|
|
315
316
|
<Spacer height={cx(10)} />
|
|
@@ -320,20 +321,20 @@ const EnergyConsumptionPage = (props: {theme?: any}) => {
|
|
|
320
321
|
<Image
|
|
321
322
|
source={res.energy_consumption_cash}
|
|
322
323
|
resizeMode="contain"
|
|
323
|
-
style={{ height: cx(20), width: cx(20), tintColor: props.theme
|
|
324
|
+
style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.primary }}
|
|
324
325
|
/>
|
|
325
326
|
</View>
|
|
326
327
|
<View>
|
|
327
328
|
<View style={styles.priceNum}>
|
|
328
|
-
<Text style={{ color: props.theme
|
|
329
|
-
<Text style={{ color: props.theme
|
|
329
|
+
<Text style={{ color: props.theme?.global.secondFontColor }}>{I18n.getLang(isSolarPlug ? 'consumption_data_monthly_overview_field1_text2' : 'consumption_data_field3_value_text2')}</Text>
|
|
330
|
+
<Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>{state.price ? `${localeNumber(Number(state.price ) * Number(state.totalElectricity), 2)} ${state.unit}` : '-'}</Text>
|
|
330
331
|
</View>
|
|
331
332
|
<TouchableOpacity onPress={() => {
|
|
332
333
|
state.showPopup = true
|
|
333
334
|
state.popupType = 'money'
|
|
334
335
|
}}>
|
|
335
336
|
<View style={styles.priceButton}>
|
|
336
|
-
<Text style={{ color: props.theme
|
|
337
|
+
<Text style={{ color: props.theme?.button.fontColor }}>{I18n.getLang('consumption_data_field3_button_text')}</Text>
|
|
337
338
|
</View>
|
|
338
339
|
</TouchableOpacity>
|
|
339
340
|
</View>
|
|
@@ -2,8 +2,21 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import ECharts from '@ledvance/react-native-echarts-pro';
|
|
4
4
|
import I18n from "@ledvance/base/src/i18n";
|
|
5
|
+
import ThemeType from "@ledvance/base/src/config/themeType";
|
|
6
|
+
import {Utils} from "tuya-panel-kit";
|
|
7
|
+
import {OverviewItem} from "../EnergyConsumptionPage";
|
|
5
8
|
|
|
6
|
-
const
|
|
9
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
|
+
|
|
11
|
+
interface BarChartProps {
|
|
12
|
+
theme?: ThemeType
|
|
13
|
+
data: OverviewItem[]
|
|
14
|
+
height: number
|
|
15
|
+
width: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const BarChartWithTouch = (props: BarChartProps) => {
|
|
19
|
+
const { data, height, width } = props
|
|
7
20
|
const dataX = data?.map(item => { return item.chartTitle });
|
|
8
21
|
const dataY = data?.map(item => { return item.value });
|
|
9
22
|
const option = {
|
|
@@ -11,7 +24,7 @@ const BarChartWithTouch = ({ data, height, width }) => {
|
|
|
11
24
|
text: I18n.getLang('consumption_data_annual_bar_chart_text'),
|
|
12
25
|
textStyle: {
|
|
13
26
|
fontSize: 14,
|
|
14
|
-
color:
|
|
27
|
+
color: props.theme?.global.secondFontColor,
|
|
15
28
|
},
|
|
16
29
|
top: 10,
|
|
17
30
|
},
|
|
@@ -30,7 +43,7 @@ const BarChartWithTouch = ({ data, height, width }) => {
|
|
|
30
43
|
},
|
|
31
44
|
axisLabel: {
|
|
32
45
|
show: true,
|
|
33
|
-
color:
|
|
46
|
+
color: props.theme?.global.secondFontColor,
|
|
34
47
|
interval: 0,
|
|
35
48
|
}
|
|
36
49
|
},
|
|
@@ -55,7 +68,7 @@ const BarChartWithTouch = ({ data, height, width }) => {
|
|
|
55
68
|
distance: 10, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
|
|
56
69
|
verticalAlign: 'middle',
|
|
57
70
|
textStyle: { // 数值样式
|
|
58
|
-
color:
|
|
71
|
+
color: props.theme?.global.fontColor,
|
|
59
72
|
fontSize: 12
|
|
60
73
|
},
|
|
61
74
|
},
|
|
@@ -90,4 +103,4 @@ const BarChartWithTouch = ({ data, height, width }) => {
|
|
|
90
103
|
);
|
|
91
104
|
};
|
|
92
105
|
|
|
93
|
-
export default BarChartWithTouch
|
|
106
|
+
export default withTheme(BarChartWithTouch)
|
|
@@ -8,6 +8,7 @@ import { TouchableOpacity, View, Text, TextInput, StyleSheet, Linking, FlatList,
|
|
|
8
8
|
import { Utils, Modal, Popup } from "tuya-panel-kit";
|
|
9
9
|
import { useReactive, useUpdateEffect } from "ahooks";
|
|
10
10
|
import { cloneDeep } from "lodash";
|
|
11
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
11
12
|
|
|
12
13
|
const { convertX: cx, height } = Utils.RatioUtils
|
|
13
14
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -24,7 +25,7 @@ export interface EnergyData {
|
|
|
24
25
|
unit: string
|
|
25
26
|
}
|
|
26
27
|
interface EnergyModalProps {
|
|
27
|
-
theme?:
|
|
28
|
+
theme?: ThemeType
|
|
28
29
|
visible: boolean
|
|
29
30
|
popupType: 'money' | 'co2' | 'unit'
|
|
30
31
|
title: string
|
|
@@ -51,14 +52,14 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
51
52
|
const text = string.split(separators)
|
|
52
53
|
const length = text.length - 1
|
|
53
54
|
return <View>
|
|
54
|
-
<Text style={{ color: props.theme
|
|
55
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{text[length - 6] + '.'}</Text>
|
|
55
56
|
<Spacer />
|
|
56
|
-
<Text style={{ color: props.theme
|
|
57
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{text[length - 5] + '.'}</Text>
|
|
57
58
|
<Spacer />
|
|
58
|
-
<Text style={{ color: props.theme
|
|
59
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{text[length - 4] + text[length - 3] + ':'}</Text>
|
|
59
60
|
<Spacer />
|
|
60
61
|
<Text
|
|
61
|
-
style={{ textDecorationLine: 'underline', color: props.theme
|
|
62
|
+
style={{ textDecorationLine: 'underline', color: props.theme?.button.primary }}
|
|
62
63
|
onPress={() => openLink(`${text[length - 2]}:${text[length - 1]}${text[length]}`)}
|
|
63
64
|
>
|
|
64
65
|
{`${text[length - 2]}:${text[length - 1]}${text[length]}`}
|
|
@@ -73,7 +74,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
73
74
|
const styles = StyleSheet.create({
|
|
74
75
|
popupTip: {
|
|
75
76
|
fontSize: cx(16),
|
|
76
|
-
color: props.theme
|
|
77
|
+
color: props.theme?.global.fontColor,
|
|
77
78
|
fontWeight: 'bold'
|
|
78
79
|
},
|
|
79
80
|
textInput: {
|
|
@@ -82,13 +83,13 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
82
83
|
marginStart: cx(16),
|
|
83
84
|
marginEnd: cx(6),
|
|
84
85
|
fontSize: cx(16),
|
|
85
|
-
color: props.theme
|
|
86
|
+
color: props.theme?.textInput.fontColor,
|
|
86
87
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
87
88
|
},
|
|
88
89
|
textInputGroup: {
|
|
89
90
|
flexDirection: 'row',
|
|
90
91
|
borderRadius: cx(4),
|
|
91
|
-
backgroundColor: props.theme
|
|
92
|
+
backgroundColor: props.theme?.textInput.background,
|
|
92
93
|
alignItems: 'center',
|
|
93
94
|
},
|
|
94
95
|
iconTouchable: {
|
|
@@ -101,7 +102,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
101
102
|
start: cx(4),
|
|
102
103
|
end: cx(4),
|
|
103
104
|
bottom: 0,
|
|
104
|
-
backgroundColor: props.theme
|
|
105
|
+
backgroundColor: props.theme?.textInput.line,
|
|
105
106
|
},
|
|
106
107
|
unitItem: {
|
|
107
108
|
flexDirection: 'row',
|
|
@@ -120,12 +121,12 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
120
121
|
<Spacer />
|
|
121
122
|
<Text style={styles.popupTip}>{I18n.getLang('consumption_data_price_per_kwh_headline_text')}</Text>
|
|
122
123
|
<Spacer height={cx(40)} />
|
|
123
|
-
<Text style={{ fontSize: cx(14), color: props.theme
|
|
124
|
+
<Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>{I18n.getLang('consumption_data_price_per_kwh_description_text')}</Text>
|
|
124
125
|
<Spacer height={cx(15)} />
|
|
125
126
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
126
127
|
<View style={{ flex: 3 }}>
|
|
127
128
|
<Spacer height={cx(4)} />
|
|
128
|
-
<Text style={{ color: props.theme
|
|
129
|
+
<Text style={{ color: props.theme?.global.secondFontColor, marginStart: cx(13), fontFamily: 'helvetica_neue_lt_std_bd' }}>{I18n.getLang('consumption_data_price_per_kwh_headline_text')}</Text>
|
|
129
130
|
<View style={styles.textInputGroup}>
|
|
130
131
|
<TextInput
|
|
131
132
|
value={state.energyData?.price}
|
|
@@ -169,7 +170,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
169
170
|
data={UnitList}
|
|
170
171
|
renderItem={({ item }) => (
|
|
171
172
|
<View style={styles.unitItem}>
|
|
172
|
-
<Text style={{ fontSize: cx(16), color: props.theme
|
|
173
|
+
<Text style={{ fontSize: cx(16), color: props.theme?.global.fontColor }}>{item}</Text>
|
|
173
174
|
{props.energyData && props.energyData.unit === item && <Image
|
|
174
175
|
style={{ width: cx(16), height: cx(16) }}
|
|
175
176
|
source={res.app_music_check}
|
|
@@ -178,7 +179,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
178
179
|
</View>
|
|
179
180
|
)}
|
|
180
181
|
ItemSeparatorComponent={() => (
|
|
181
|
-
<View style={{ flex: 1, height: 1, backgroundColor: props.theme
|
|
182
|
+
<View style={{ flex: 1, height: 1, backgroundColor: props.theme?.card.background }}></View>
|
|
182
183
|
)}
|
|
183
184
|
keyExtractor={item => item}
|
|
184
185
|
/>
|
|
@@ -205,23 +206,23 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
205
206
|
return (
|
|
206
207
|
Popup.custom({
|
|
207
208
|
title: (
|
|
208
|
-
<View style={{ backgroundColor: props.theme
|
|
209
|
+
<View style={{ backgroundColor: props.theme?.card.head, flexDirection: 'row', height: cx(60), justifyContent: 'space-between', alignItems: 'center', borderTopLeftRadius: cx(10), borderTopRightRadius: cx(10), paddingHorizontal: cx(8) }}>
|
|
209
210
|
<TouchableOpacity onPress={() => Popup.close()}>
|
|
210
|
-
<Text style={{ color: props.theme
|
|
211
|
+
<Text style={{ color: props.theme?.global.secondBrand, fontSize: cx(16) }}>{I18n.getLang('auto_scan_system_cancel')}</Text>
|
|
211
212
|
</TouchableOpacity>
|
|
212
213
|
</View>
|
|
213
214
|
),
|
|
214
215
|
wrapperStyle: {
|
|
215
216
|
height: height - cx(40),
|
|
216
|
-
backgroundColor: props.theme
|
|
217
|
+
backgroundColor: props.theme?.global.background
|
|
217
218
|
},
|
|
218
|
-
footer: (<View style={{ backgroundColor: props.theme
|
|
219
|
+
footer: (<View style={{ backgroundColor: props.theme?.global.background}}></View>),
|
|
219
220
|
onMaskPress: () => { },
|
|
220
221
|
motionType: 'none',
|
|
221
222
|
useKeyboardView: true,
|
|
222
223
|
content: (
|
|
223
224
|
<View
|
|
224
|
-
style={{ backgroundColor: props.theme
|
|
225
|
+
style={{ backgroundColor: props.theme?.global.background, paddingHorizontal: cx(16) }}>
|
|
225
226
|
<Spacer />
|
|
226
227
|
<Card>
|
|
227
228
|
<FlatList
|
|
@@ -234,7 +235,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
234
235
|
}}
|
|
235
236
|
>
|
|
236
237
|
<View style={styles.unitItem}>
|
|
237
|
-
<Text style={{ fontSize: cx(16), color: props.theme
|
|
238
|
+
<Text style={{ fontSize: cx(16), color: props.theme?.global.fontColor }}>{item}</Text>
|
|
238
239
|
{energyData && energyData.unit === item && <Image
|
|
239
240
|
style={{ width: cx(16), height: cx(16) }}
|
|
240
241
|
source={res.app_music_check}
|
|
@@ -244,7 +245,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
244
245
|
</TouchableOpacity>
|
|
245
246
|
)}
|
|
246
247
|
ItemSeparatorComponent={() => (
|
|
247
|
-
<View style={{ flex: 1, height: 1, backgroundColor: props.theme
|
|
248
|
+
<View style={{ flex: 1, height: 1, backgroundColor: props.theme?.card.background }}></View>
|
|
248
249
|
)}
|
|
249
250
|
keyExtractor={item => item}
|
|
250
251
|
/>
|
|
@@ -260,20 +261,20 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
260
261
|
visible={props.visible}
|
|
261
262
|
>
|
|
262
263
|
<ScrollView>
|
|
263
|
-
<View style={{ backgroundColor: props.theme
|
|
264
|
+
<View style={{ backgroundColor: props.theme?.card.head, flexDirection: 'row', height: cx(60), justifyContent: 'space-between', alignItems: 'center', borderTopLeftRadius: cx(10), borderTopRightRadius: cx(10), paddingHorizontal: cx(8) }}>
|
|
264
265
|
<TouchableOpacity onPress={() => {
|
|
265
266
|
props.onCancel && props.onCancel()
|
|
266
267
|
}}>
|
|
267
|
-
<Text style={{ color: props.theme
|
|
268
|
+
<Text style={{ color: props.theme?.button.cancel, fontSize: cx(16) }}>{props.cancelText}</Text>
|
|
268
269
|
</TouchableOpacity>
|
|
269
|
-
<Text style={{ color: props.theme
|
|
270
|
+
<Text style={{ color: props.theme?.global.fontColor, fontSize: cx(16), fontWeight: 'bold' }}>{props.title}</Text>
|
|
270
271
|
<TouchableOpacity onPress={() => {
|
|
271
272
|
props.onConfirm && props.onConfirm(state.energyData)
|
|
272
273
|
}}>
|
|
273
|
-
<Text style={{ color: props.theme
|
|
274
|
+
<Text style={{ color: props.theme?.button.primary, fontSize: cx(16) }}>{props.confirmText}</Text>
|
|
274
275
|
</TouchableOpacity>
|
|
275
276
|
</View>
|
|
276
|
-
<View style={{ height: height - cx(100), paddingHorizontal: cx(16), backgroundColor: props.theme
|
|
277
|
+
<View style={{ height: height - cx(100), paddingHorizontal: cx(16), backgroundColor: props.theme?.global.background }}>
|
|
277
278
|
{getContent()}
|
|
278
279
|
</View>
|
|
279
280
|
</ScrollView>
|
|
@@ -8,12 +8,13 @@ import { isEmpty } from "lodash";
|
|
|
8
8
|
import { OverviewItem } from "../EnergyConsumptionPage";
|
|
9
9
|
import { EnergyConsumptionChartProps } from "../EnergyConsumptionChart";
|
|
10
10
|
import { useRoute } from '@react-navigation/core'
|
|
11
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
11
12
|
|
|
12
13
|
const { convertX: cx } = Utils.RatioUtils
|
|
13
14
|
const { withTheme } = Utils.ThemeUtils
|
|
14
15
|
|
|
15
16
|
interface OverViewProps {
|
|
16
|
-
theme?:
|
|
17
|
+
theme?: ThemeType
|
|
17
18
|
style?: StyleProp<ViewStyle>
|
|
18
19
|
headlineText?: string
|
|
19
20
|
headlineClick?: () => void
|
|
@@ -34,22 +35,22 @@ const OverView = (props: OverViewProps) => {
|
|
|
34
35
|
listEmptyTextIcon: {
|
|
35
36
|
width: cx(16),
|
|
36
37
|
height: cx(16),
|
|
37
|
-
tintColor: props.theme
|
|
38
|
+
tintColor: props.theme?.global.fontColor,
|
|
38
39
|
},
|
|
39
40
|
listEmptyText: {
|
|
40
|
-
color: props.theme
|
|
41
|
+
color: props.theme?.global.fontColor,
|
|
41
42
|
fontSize: cx(12),
|
|
42
43
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
43
44
|
},
|
|
44
45
|
overviewItemText: {
|
|
45
|
-
color: props.theme
|
|
46
|
+
color: props.theme?.global.fontColor,
|
|
46
47
|
fontSize: cx(14)
|
|
47
48
|
},
|
|
48
49
|
})
|
|
49
50
|
return (
|
|
50
51
|
<View style={[props.style]}>
|
|
51
52
|
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
52
|
-
<Text style={{ color: props.theme
|
|
53
|
+
<Text style={{ color: props.theme?.global.fontColor, fontWeight: 'bold' }}>{props.headlineText}</Text>
|
|
53
54
|
{!isEmpty(props.overViewList) && <TouchableOpacity
|
|
54
55
|
onPress={() => {
|
|
55
56
|
props.headlineClick && props.headlineClick()
|
|
@@ -71,16 +72,16 @@ const OverView = (props: OverViewProps) => {
|
|
|
71
72
|
props.overviewItemClick && props.overviewItemClick(item)
|
|
72
73
|
}}
|
|
73
74
|
>
|
|
74
|
-
<View style={{ backgroundColor: props.theme
|
|
75
|
+
<View style={{ backgroundColor: props.theme?.card.background, alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', }}>
|
|
75
76
|
<Text style={styles.overviewItemText}>{item.key}</Text>
|
|
76
77
|
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
|
|
77
78
|
<View style={{ flexDirection: 'row' }}>
|
|
78
|
-
<Text style={[styles.overviewItemText, { color: props.theme
|
|
79
|
-
<Text style={[styles.overviewItemText, { color: props.theme
|
|
79
|
+
<Text style={[styles.overviewItemText, { color: props.theme?.global.secondFontColor }]}>{item.value}</Text>
|
|
80
|
+
<Text style={[styles.overviewItemText, { color: props.theme?.global.secondFontColor }]}> kWh</Text>
|
|
80
81
|
</View>
|
|
81
82
|
<Image
|
|
82
83
|
source={res.energy_consumption_right}
|
|
83
|
-
style={{ width: cx(16), height: cx(16), marginLeft: cx(8), tintColor: props.theme
|
|
84
|
+
style={{ width: cx(16), height: cx(16), marginLeft: cx(8), tintColor: props.theme?.global.secondFontColor }}
|
|
84
85
|
/>
|
|
85
86
|
</View>
|
|
86
87
|
</View>
|
|
@@ -22,6 +22,7 @@ import { FixedTimePageParams } from "./FixedTimePage";
|
|
|
22
22
|
import { Result } from "@ledvance/base/src/models/modules/Result";
|
|
23
23
|
import { useSystemTimeFormate } from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
24
24
|
import { useParams } from "@ledvance/base/src/hooks/Hooks";
|
|
25
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
25
26
|
|
|
26
27
|
const { convertX: cx } = Utils.RatioUtils;
|
|
27
28
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -34,7 +35,7 @@ export interface FixedTimeDetailPageParams extends FixedTimePageParams {
|
|
|
34
35
|
onPost: (mode: 'add' | 'edit' | 'del', fixedTime: FixedTimerUiItem) => Promise<Result<any>>
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
const FixedTimeDetailPage = (props: { theme?:
|
|
38
|
+
const FixedTimeDetailPage = (props: { theme?: ThemeType }) => {
|
|
38
39
|
const navigation = useNavigation()
|
|
39
40
|
const params = useParams<FixedTimeDetailPageParams>()
|
|
40
41
|
const is24Hour = useSystemTimeFormate()
|
|
@@ -83,13 +84,13 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
83
84
|
marginHorizontal: cx(24)
|
|
84
85
|
},
|
|
85
86
|
itemTitle: {
|
|
86
|
-
color: props.theme
|
|
87
|
+
color: props.theme?.global.fontColor,
|
|
87
88
|
fontSize: cx(16),
|
|
88
89
|
fontWeight: 'bold',
|
|
89
90
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
90
91
|
},
|
|
91
92
|
applyContent: {
|
|
92
|
-
backgroundColor: props.theme
|
|
93
|
+
backgroundColor: props.theme?.container.background,
|
|
93
94
|
borderRadius: 4,
|
|
94
95
|
minHeight: cx(55),
|
|
95
96
|
flex: 1,
|
|
@@ -102,11 +103,11 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
102
103
|
flexDirection: 'row',
|
|
103
104
|
justifyContent: 'space-between',
|
|
104
105
|
alignItems: 'center',
|
|
105
|
-
backgroundColor: props.theme
|
|
106
|
+
backgroundColor: props.theme?.global.background,
|
|
106
107
|
height: cx(35),
|
|
107
108
|
},
|
|
108
109
|
summaryTag: {
|
|
109
|
-
backgroundColor: props.theme
|
|
110
|
+
backgroundColor: props.theme?.tag.background,
|
|
110
111
|
borderRadius: cx(16),
|
|
111
112
|
paddingHorizontal: cx(12),
|
|
112
113
|
alignSelf: 'flex-start'
|
|
@@ -160,8 +161,8 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
160
161
|
{/* pick */}
|
|
161
162
|
<TimerPicker
|
|
162
163
|
itemTextColor='#aeadb5'
|
|
163
|
-
style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme
|
|
164
|
-
pickerFontColor={props.theme
|
|
164
|
+
style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme?.global.background }}
|
|
165
|
+
pickerFontColor={props.theme?.global.fontColor}
|
|
165
166
|
is12Hours={!is24Hour}
|
|
166
167
|
startTime={state.fixedTime.startTime}
|
|
167
168
|
endTime={state.fixedTime.endTime}
|
|
@@ -177,7 +178,7 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
177
178
|
state.fixedTime.weeks[rawIndex] = state.fixedTime.weeks[rawIndex] === 1 ? 0 : 1
|
|
178
179
|
}} />
|
|
179
180
|
<Spacer />
|
|
180
|
-
<Text style={{ ...styles.cardContainer, color: props.theme
|
|
181
|
+
<Text style={{ ...styles.cardContainer, color: props.theme?.global.fontColor, fontSize: cx(14) }}>
|
|
181
182
|
{loopText(state.fixedTime.weeks, parseTimer(state.fixedTime.endTime * 60))}
|
|
182
183
|
</Text>
|
|
183
184
|
<Spacer />
|
|
@@ -187,15 +188,15 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
187
188
|
<Spacer height={cx(10)} />
|
|
188
189
|
<View style={[styles.applyContent, { paddingTop: state.fixedTime.channel === undefined ? 0 : cx(10) }]}>
|
|
189
190
|
{state.fixedTime.channel === undefined ?
|
|
190
|
-
<Text style={{color: props.theme
|
|
191
|
+
<Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text> :
|
|
191
192
|
<View style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}>
|
|
192
|
-
<Text style={{ color: props.theme
|
|
193
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{params.applyForList[params.isPlug ? state.fixedTime.channel : 0]?.key}</Text>
|
|
193
194
|
{params.applyForList.length > 1 && <TouchableOpacity
|
|
194
195
|
onPress={() => {
|
|
195
196
|
state.fixedTime.channel = undefined
|
|
196
197
|
}}
|
|
197
198
|
style={{ paddingHorizontal: cx(5) }}>
|
|
198
|
-
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme
|
|
199
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }} source={res.ic_arrows_nav_clear} />
|
|
199
200
|
</TouchableOpacity>}
|
|
200
201
|
</View>
|
|
201
202
|
}
|
|
@@ -209,8 +210,8 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
209
210
|
onPress={() => {
|
|
210
211
|
state.fixedTime.channel = params.isPlug ? index : 1
|
|
211
212
|
}}>
|
|
212
|
-
<Text style={{ color: props.theme
|
|
213
|
-
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme
|
|
213
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{item.key}</Text>
|
|
214
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor }} source={res.device_panel_timer_add} />
|
|
214
215
|
</TouchableOpacity>
|
|
215
216
|
)
|
|
216
217
|
})}
|
|
@@ -223,7 +224,7 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
223
224
|
<Card>
|
|
224
225
|
<LdvSwitch
|
|
225
226
|
title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
|
|
226
|
-
color={props.theme
|
|
227
|
+
color={props.theme?.card.background}
|
|
227
228
|
colorAlpha={1}
|
|
228
229
|
enable={true}
|
|
229
230
|
setEnable={() => { }}
|
|
@@ -270,11 +271,11 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
270
271
|
<Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline4_text')}</Text>
|
|
271
272
|
<Spacer height={cx(10)} />
|
|
272
273
|
{!inRangeTime && <View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
273
|
-
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme
|
|
274
|
-
<Text style={{ fontSize: cx(12), color: props.theme
|
|
274
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }} source={res.ic_warning_amber} />
|
|
275
|
+
<Text style={{ fontSize: cx(12), color: props.theme?.global.warning }}>{I18n.getLang('addTimeCycle_warning_text')}</Text>
|
|
275
276
|
</View>}
|
|
276
277
|
<View >
|
|
277
|
-
<Text style={{ color: props.theme
|
|
278
|
+
<Text style={{ color: props.theme?.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text')}</Text>
|
|
278
279
|
<LdvPickerView
|
|
279
280
|
hour={toFixedString(Math.trunc(state.fixedTime.openTime / 60), 2)}
|
|
280
281
|
minute={toFixedString(state.fixedTime.openTime % 60, 2)}
|
|
@@ -288,7 +289,7 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
288
289
|
/>
|
|
289
290
|
</View>
|
|
290
291
|
<View>
|
|
291
|
-
<Text style={{ color: props.theme
|
|
292
|
+
<Text style={{ color: props.theme?.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text2')}</Text>
|
|
292
293
|
<LdvPickerView
|
|
293
294
|
hour={toFixedString(Math.trunc(state.fixedTime.closeTime / 60), 2)}
|
|
294
295
|
minute={toFixedString(state.fixedTime.closeTime % 60, 2)}
|
|
@@ -309,14 +310,14 @@ const FixedTimeDetailPage = (props: { theme?: any }) => {
|
|
|
309
310
|
time={`${convertMinutesTo12HourFormat(state.fixedTime.startTime, is24Hour)} - ${convertMinutesTo12HourFormat(state.fixedTime.endTime, is24Hour)}`}
|
|
310
311
|
actions={(
|
|
311
312
|
<View style={{ flexDirection: 'column' }}>
|
|
312
|
-
<Text style={{ color: props.theme
|
|
313
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{I18n.formatValue('feature_summary_action_txt_4', `${Math.trunc(state.fixedTime.openTime / 60)}`, `${state.fixedTime.openTime % 60}`)}</Text>
|
|
313
314
|
<View style={styles.summaryTag}>
|
|
314
|
-
<Text style={{ color: props.theme
|
|
315
|
+
<Text style={{ color: props.theme?.tag.fontColor }}>{params.applyForList[params.isPlug ? (state.fixedTime.channel ?? 0) : 0]?.key}</Text>
|
|
315
316
|
</View>
|
|
316
317
|
<Spacer height={cx(5)} />
|
|
317
|
-
<Text style={{ color: props.theme
|
|
318
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{I18n.formatValue('feature_summary_action_txt_6', `${Math.trunc(state.fixedTime.closeTime / 60)}`, `${state.fixedTime.closeTime % 60}`)}</Text>
|
|
318
319
|
<View style={styles.summaryTag}>
|
|
319
|
-
<Text style={{ color: props.theme
|
|
320
|
+
<Text style={{ color: props.theme?.tag.fontColor }}>{params.applyForList[params.isPlug ? (state.fixedTime.channel ?? 0) : 0]?.key}</Text>
|
|
320
321
|
</View>
|
|
321
322
|
</View>
|
|
322
323
|
)}
|
|
@@ -15,10 +15,11 @@ import Card from "@ledvance/base/src/components/Card";
|
|
|
15
15
|
import { convertMinutesTo12HourFormat, loopText } from "@ledvance/base/src/utils/common";
|
|
16
16
|
import { cloneDeep } from "lodash";
|
|
17
17
|
import dayjs from "dayjs";
|
|
18
|
-
import { ApplyForItem } from "@ledvance/
|
|
18
|
+
import { ApplyForItem } from "@ledvance/base/src/utils/interface";
|
|
19
19
|
import { useParams } from "@ledvance/base/src/hooks/Hooks";
|
|
20
20
|
import Tag from "@ledvance/base/src/components/Tag";
|
|
21
21
|
import InfoText from "@ledvance/base/src/components/InfoText";
|
|
22
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
22
23
|
|
|
23
24
|
const { convertX: cx } = Utils.RatioUtils
|
|
24
25
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -39,7 +40,7 @@ export interface FixedTimePageParams {
|
|
|
39
40
|
isSupportBrightness?: boolean
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
const FixedTimePage = (props: { theme?:
|
|
43
|
+
const FixedTimePage = (props: { theme?: ThemeType }) => {
|
|
43
44
|
const navigation = useNavigation()
|
|
44
45
|
const devInfo = useDeviceInfo()
|
|
45
46
|
const params = useParams<FixedTimePageParams>()
|
|
@@ -105,14 +106,14 @@ const FixedTimePage = (props: { theme?: any }) => {
|
|
|
105
106
|
},
|
|
106
107
|
time: {
|
|
107
108
|
flex: 1,
|
|
108
|
-
color: props.theme
|
|
109
|
+
color: props.theme?.global.fontColor,
|
|
109
110
|
fontSize: cx(16),
|
|
110
111
|
fontWeight: 'bold',
|
|
111
112
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
112
113
|
},
|
|
113
114
|
switchBtn: {},
|
|
114
115
|
loopText: {
|
|
115
|
-
color: props.theme
|
|
116
|
+
color: props.theme?.global.fontColor,
|
|
116
117
|
fontSize: cx(14),
|
|
117
118
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
118
119
|
},
|
|
@@ -130,7 +131,7 @@ const FixedTimePage = (props: { theme?: any }) => {
|
|
|
130
131
|
tag: {
|
|
131
132
|
borderRadius: cx(16),
|
|
132
133
|
height: cx(16),
|
|
133
|
-
backgroundColor: props.theme
|
|
134
|
+
backgroundColor: props.theme?.tag.background,
|
|
134
135
|
marginRight: cx(10),
|
|
135
136
|
paddingHorizontal: cx(12)
|
|
136
137
|
},
|
|
@@ -138,7 +139,7 @@ const FixedTimePage = (props: { theme?: any }) => {
|
|
|
138
139
|
fontSize: cx(10),
|
|
139
140
|
textAlign: 'center',
|
|
140
141
|
fontFamily: 'PingFangSC-Medium',
|
|
141
|
-
color: props.theme
|
|
142
|
+
color: props.theme?.tag.fontColor,
|
|
142
143
|
},
|
|
143
144
|
})
|
|
144
145
|
|
|
@@ -172,7 +173,7 @@ const FixedTimePage = (props: { theme?: any }) => {
|
|
|
172
173
|
>
|
|
173
174
|
<ScrollView nestedScrollEnabled={true}>
|
|
174
175
|
<Text style={{
|
|
175
|
-
color: props.theme
|
|
176
|
+
color: props.theme?.global.fontColor,
|
|
176
177
|
marginLeft: cx(24),
|
|
177
178
|
fontSize: cx(12)
|
|
178
179
|
}}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
|
|
@@ -222,19 +223,19 @@ const FixedTimePage = (props: { theme?: any }) => {
|
|
|
222
223
|
icon={res.device_panel_schedule_alert}
|
|
223
224
|
text={I18n.getLang(!state.originList.length ? 'fixedTimeCycle_information_text' : 'fixedTimeCycle_empty_filtering_information_text')}
|
|
224
225
|
style={{ width: 'auto', alignItems: 'center' }}
|
|
225
|
-
textStyle={{ color: props.theme
|
|
226
|
-
iconStyle={{ width: cx(16), height: cx(16), tintColor: props.theme
|
|
226
|
+
textStyle={{ color: props.theme?.global.fontColor, fontSize: cx(12), flex: undefined }}
|
|
227
|
+
iconStyle={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.fontColor, }}
|
|
227
228
|
/>
|
|
228
229
|
<Spacer />
|
|
229
230
|
{!state.originList.length && <TextButton
|
|
230
231
|
text={I18n.getLang('fixedTimeCycle_bttn_text')}
|
|
231
232
|
style={{
|
|
232
|
-
backgroundColor: props.theme
|
|
233
|
+
backgroundColor: props.theme?.button.primary,
|
|
233
234
|
borderRadius: cx(6),
|
|
234
235
|
paddingVertical: cx(12),
|
|
235
236
|
paddingHorizontal: cx(24),
|
|
236
237
|
}}
|
|
237
|
-
textStyle={{ color: props.theme
|
|
238
|
+
textStyle={{ color: props.theme?.button.fontColor, }}
|
|
238
239
|
onPress={() => {
|
|
239
240
|
navigateToEdit('add', newFixedTime(!!params.isPlug))
|
|
240
241
|
}} />}
|