@ledvance/group-ui-biz-bundle 1.0.135 → 1.0.136

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/group-ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.0.135",
7
+ "version": "1.0.136",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -333,23 +333,6 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
333
333
  </Text>
334
334
  </View>
335
335
  <Spacer />
336
- {/* Today */}
337
- <Card style={styles.cardContainer}>
338
- <Text style={styles.cardTitle}>
339
- {I18n.getLang('consumption_data_field1_headline_text')}
340
- </Text>
341
- <Spacer height={cx(15)} />
342
- <View style={{ flexDirection: 'row', alignItems: 'flex-end' }}>
343
- <Text style={[styles.consumptionNum, { fontSize: cx(38), marginRight: cx(8) }]}>
344
- {localeNumber(state.isSolarMode ? state.solarTodayElectricity : state.wifiTodayElectricity)}
345
- </Text>
346
- <Text style={[styles.consumptionNum, { fontSize: cx(22), marginBottom: cx(4) }]}>
347
- kWh
348
- </Text>
349
- </View>
350
- <Spacer height={cx(10)} />
351
- </Card>
352
- <Spacer />
353
336
  <Card
354
337
  style={styles.cardContainer}
355
338
  onPress={() => {
@@ -365,9 +348,17 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
365
348
  } as EnergyConsumptionChartProps)
366
349
  }}
367
350
  >
368
- <Text style={styles.cardTitle}>
369
- {I18n.getLang('consumption_data_field2_headline_text')}
370
- </Text>
351
+ <View style={{
352
+ flexDirection: 'row',
353
+ justifyContent: 'space-between',
354
+ alignItems: 'center',
355
+ }}>
356
+ <Text style={styles.cardTitle}>{I18n.getLang('consumption_data_field2_headline_text')}</Text>
357
+ <Image
358
+ source={{ uri: res.energy_consumption_chart}}
359
+ style={{ width: cx(16), height: cx(16), marginLeft: cx(8) }}
360
+ />
361
+ </View>
371
362
  <Spacer height={cx(15)} />
372
363
  <View style={styles.consumedEnergyContent}>
373
364
  <ConsumedEnergyItem
@@ -383,17 +374,23 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
383
374
  <Spacer />
384
375
  {/* 365 day */}
385
376
  <Card style={styles.cardContainer}>
386
- <Text style={styles.cardTitle}>
387
- {I18n.getLang('consumption_data_field3_headline_text')}
388
- </Text>
389
- <Spacer height={cx(15)} />
390
- <View style={{ flexDirection: 'row', alignItems: 'flex-end' }}>
391
- <Text style={[styles.consumptionNum, { fontSize: cx(38), marginRight: cx(8) }]}>
392
- {localeNumber(state.isSolarMode ? state.solarTotalElectricity : state.wifiTotalElectricity)}
393
- </Text>
394
- <Text style={[styles.consumptionNum, { fontSize: cx(22), marginBottom: cx(4) }]}>
395
- kWh
396
- </Text>
377
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
378
+ <Text style={styles.cardTitle}>{I18n.getLang('consumption_data_field1_headline_text')}</Text>
379
+ <View style={{ flexDirection: 'row', alignItems: 'flex-end', marginLeft: cx(10) }}>
380
+ <Text style={[styles.consumptionNum, { fontSize: cx(30), marginRight: cx(8) }]}>
381
+ {localeNumber(state.isSolarMode ? state.solarTodayElectricity : state.wifiTodayElectricity)}
382
+ </Text>
383
+ <Text style={[styles.consumptionNum, { fontSize: cx(20), marginBottom: cx(4) }]}>kWh</Text>
384
+ </View>
385
+ </View>
386
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
387
+ <Text style={styles.cardTitle}>{I18n.getLang('consumption_data_field3_headline_text')}</Text>
388
+ <View style={{ flexDirection: 'row', alignItems: 'flex-end', marginLeft: cx(10) }}>
389
+ <Text style={[styles.consumptionNum, { fontSize: cx(30), marginRight: cx(8) }]}>
390
+ {localeNumber(state.isSolarMode ? state.solarTotalElectricity : state.wifiTotalElectricity)}
391
+ </Text>
392
+ <Text style={[styles.consumptionNum, { fontSize: cx(20), marginBottom: cx(4) }]}>kWh</Text>
393
+ </View>
397
394
  </View>
398
395
  <Spacer />
399
396
  {/* CO2 */}
@@ -1,10 +1,11 @@
1
- import { StyleSheet, View, Text, ViewStyle, Image } from 'react-native'
1
+ import { StyleSheet, View, Text, ViewStyle, Image, TouchableOpacity } from 'react-native'
2
2
  import React from 'react'
3
3
  import Card from '@ledvance/base/src/components/Card'
4
- import { SwitchButton, Utils } from 'tuya-panel-kit'
4
+ import { Utils } from 'tuya-panel-kit'
5
5
  import MoodColorsLine from '@ledvance/base/src/components/MoodColorsLine'
6
6
  import Spacer from '@ledvance/base/src/components/Spacer'
7
7
  import ThemeType from '@ledvance/base/src/config/themeType'
8
+ import res from "@ledvance/base/src/res"
8
9
 
9
10
  const cx = Utils.RatioUtils.convertX
10
11
  const { withTheme } = Utils.ThemeUtils
@@ -31,6 +32,7 @@ const FlagItem = (props: RecommendMoodItemProps) => {
31
32
  flexDirection: 'row',
32
33
  marginHorizontal: cx(16),
33
34
  justifyContent: 'space-between',
35
+ alignItems: 'center',
34
36
  },
35
37
  headText: {
36
38
  color: props.theme?.global.fontColor,
@@ -39,6 +41,13 @@ const FlagItem = (props: RecommendMoodItemProps) => {
39
41
  lineHeight: cx(20),
40
42
  flex: 1
41
43
  },
44
+ checkbox: {
45
+ width: cx(45),
46
+ height: cx(45),
47
+ marginTop: cx(-5),
48
+ marginBottom: cx(-10),
49
+ fontWeight: 'bold',
50
+ },
42
51
  gradientItem: {
43
52
  alignItems: 'center',
44
53
  },
@@ -58,10 +67,9 @@ const FlagItem = (props: RecommendMoodItemProps) => {
58
67
  {props.title ? <Text style={styles.headText}>{props.title}</Text> : undefined}
59
68
  {props.icon ? <Image source={icon} style={{ width: cx(60), aspectRatio: 2.14, marginRight: cx(10) }} /> : undefined}
60
69
  </View>
61
- <SwitchButton
62
- thumbStyle={{ elevation: 0 }}
63
- value={props.enable}
64
- onValueChange={props.onSwitch} />
70
+ <TouchableOpacity style={styles.checkbox} onPress={() => props.onSwitch(!props.enable)}>
71
+ <Image source={{ uri: res.ic_check}} width={cx(44)} height={cx(44)} style={[styles.checkbox, { tintColor: props.enable ? props.theme?.icon.primary : props.theme?.icon.disable}]} />
72
+ </TouchableOpacity>
65
73
  </View>
66
74
  <Spacer />
67
75
  <View style={styles.gradientItem}>
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
- import { StyleSheet, Text, View, ViewProps, ViewStyle, Image } from 'react-native';
3
- import { SwitchButton, Utils } from 'tuya-panel-kit';
2
+ import { StyleSheet, Text, View, ViewProps, ViewStyle, Image, TouchableOpacity } from 'react-native';
3
+ import { Utils } from 'tuya-panel-kit';
4
4
  import { hsv2Hex } from '@ledvance/base/src/utils';
5
5
  import { cctToColor } from '@ledvance/base/src/utils/cctUtils';
6
6
  import { mapFloatToRange } from '@ledvance/base/src/utils';
@@ -50,6 +50,7 @@ const MoodItem = (props: MoodItemProps) => {
50
50
  headline: {
51
51
  flexDirection: 'row',
52
52
  marginHorizontal: cx(16),
53
+ alignItems: 'center',
53
54
  },
54
55
  headText: {
55
56
  flex: 1,
@@ -58,6 +59,13 @@ const MoodItem = (props: MoodItemProps) => {
58
59
  fontFamily: 'helvetica_neue_lt_std_bd',
59
60
  lineHeight: cx(20),
60
61
  },
62
+ checkbox: {
63
+ width: cx(45),
64
+ height: cx(45),
65
+ marginTop: cx(-5),
66
+ marginBottom: cx(-10),
67
+ fontWeight: 'bold',
68
+ },
61
69
  moodTypeItem: {
62
70
  flexDirection: 'row',
63
71
  },
@@ -83,11 +91,9 @@ const MoodItem = (props: MoodItemProps) => {
83
91
  <Spacer height={cx(16)} />
84
92
  <View style={styles.headline}>
85
93
  <Text style={styles.headText}>{mood.name}</Text>
86
- <SwitchButton
87
- thumbStyle={{ elevation: 0 }}
88
- value={props.enable}
89
- onValueChange={props.onSwitch}
90
- />
94
+ <TouchableOpacity style={styles.checkbox} onPress={() => props.onSwitch(!props.enable)}>
95
+ <Image source={{ uri: res.ic_check}} width={cx(44)} height={cx(44)} style={[styles.checkbox, { tintColor: props.enable ? props.theme?.icon.primary : props.theme?.icon.disable}]} />
96
+ </TouchableOpacity>
91
97
  </View>
92
98
  <Spacer />
93
99
  <MixMoodColorsLine mixSubLight={mood.mainLamp} isMix={isMix} type={mood.mainLamp.mode === gradientMode ? 'gradient' : 'separate'}/>