@ledvance/group-ui-biz-bundle 1.0.11 → 1.0.12
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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import I18n from "@ledvance/base/src/i18n";
|
|
2
|
+
import res from "@ledvance/base/src/res";
|
|
2
3
|
import { SceneNodeTransitionMode } from "../mood/SceneInfo";
|
|
3
4
|
|
|
4
5
|
type HSV = {
|
|
@@ -19,8 +20,7 @@ export interface FlagItemInfo {
|
|
|
19
20
|
speed: number
|
|
20
21
|
colors: HSV[]
|
|
21
22
|
whiteColors: BT []
|
|
22
|
-
|
|
23
|
-
fanSpeed?: number
|
|
23
|
+
icon?: number | string
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface FlagUiInfo extends FlagItemInfo{
|
|
@@ -301,6 +301,7 @@ export const defFlagList: FlagUiInfo[] = [
|
|
|
301
301
|
mode: SceneNodeTransitionMode.Jump,
|
|
302
302
|
speed: 70,
|
|
303
303
|
name: I18n.getLang('flag_leverkusen'),
|
|
304
|
+
icon: res.leverkusen_icon,
|
|
304
305
|
whiteColors: [
|
|
305
306
|
{ brightness: 100, colorTemp: 0},
|
|
306
307
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StyleSheet, View, Text, ViewStyle } from 'react-native'
|
|
1
|
+
import { StyleSheet, View, Text, ViewStyle, Image } from 'react-native'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import Card from '@ledvance/base/src/components/Card'
|
|
4
4
|
import { SwitchButton, Utils } from 'tuya-panel-kit'
|
|
@@ -11,12 +11,15 @@ interface RecommendMoodItemProps {
|
|
|
11
11
|
enable: boolean
|
|
12
12
|
title: string
|
|
13
13
|
colors: string[]
|
|
14
|
+
icon?: number | string
|
|
14
15
|
style?: ViewStyle
|
|
15
16
|
onPress?: () => void
|
|
16
17
|
onSwitch: (enable: boolean) => void
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export default function FlagItem(props: RecommendMoodItemProps) {
|
|
21
|
+
const icon = typeof props.icon === 'number' ? props.icon : { uri: props.icon }
|
|
22
|
+
|
|
20
23
|
return (
|
|
21
24
|
<Card
|
|
22
25
|
style={[styles.card, props.style]}
|
|
@@ -24,7 +27,10 @@ export default function FlagItem(props: RecommendMoodItemProps) {
|
|
|
24
27
|
<View>
|
|
25
28
|
<Spacer height={cx(16)} />
|
|
26
29
|
<View style={styles.headline}>
|
|
27
|
-
<
|
|
30
|
+
<View style={{ flexDirection: 'row', flex: 1, paddingRight: cx(5), justifyContent: 'flex-start' }}>
|
|
31
|
+
<Text style={styles.headText}>{props.title}</Text>
|
|
32
|
+
{props.icon && <Image source={icon} style={{ width: cx(60), aspectRatio: 2.14, marginRight: cx(10) }} />}
|
|
33
|
+
</View>
|
|
28
34
|
<SwitchButton
|
|
29
35
|
thumbStyle={{ elevation: 0 }}
|
|
30
36
|
value={props.enable}
|
|
@@ -50,13 +56,14 @@ const styles = StyleSheet.create({
|
|
|
50
56
|
headline: {
|
|
51
57
|
flexDirection: 'row',
|
|
52
58
|
marginHorizontal: cx(16),
|
|
59
|
+
justifyContent: 'space-between',
|
|
53
60
|
},
|
|
54
61
|
headText: {
|
|
55
|
-
flex: 1,
|
|
56
62
|
color: '#000',
|
|
57
63
|
fontSize: cx(16),
|
|
58
64
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
59
65
|
lineHeight: cx(20),
|
|
66
|
+
flex: 1
|
|
60
67
|
},
|
|
61
68
|
gradientItem: {
|
|
62
69
|
alignItems: 'center',
|
|
@@ -193,6 +193,7 @@ const FlagPage = () => {
|
|
|
193
193
|
renderItem={({ item }) => <FlagItem
|
|
194
194
|
enable={flagState?.workMode === (params.isStripLight ? WorkMode.Colour : WorkMode.Scene) && flagId === item.id}
|
|
195
195
|
title={item.name}
|
|
196
|
+
icon={item.icon}
|
|
196
197
|
colors={item.colors.map(item => hsv2Hex(item.h, item.s, item.v))}
|
|
197
198
|
onSwitch={async (enable) => {
|
|
198
199
|
if (enable) {
|