@ledvance/ui-biz-bundle 1.1.70 → 1.1.71

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.
@@ -1,81 +1,81 @@
1
- import React, { useMemo } from 'react';
2
- import { Utils } from 'tuya-panel-kit';
3
- import Card from '@ledvance/base/src/components/Card';
4
- import { CellContent } from '@ledvance/base/src/components/Cell';
5
- import { StyleSheet, View } from 'react-native';
6
- import Spacer from '@ledvance/base/src/components/Spacer';
7
- import { MoodJumpGradientMode, MoodUIInfo } from './Interface';
8
- import { MixMoodColorsLine } from './MoodItem';
9
-
10
- const cx = Utils.RatioUtils.convertX;
11
-
12
- interface LightCategory {
13
- isMixLight?: boolean
14
- isStripLight?: boolean
15
- isStringLight?: boolean
16
- isCeilingLight?: boolean
17
- }
18
-
19
- interface RecommendMixMoodItemProps {
20
- title: string;
21
- isMix: boolean;
22
- mood: MoodUIInfo;
23
- deviceTypeOption?: LightCategory
24
- onPress: () => void;
25
- }
26
-
27
- const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
28
- const { mood, isMix, deviceTypeOption } = props;
29
-
30
- const gradientMode = useMemo(() => (
31
- deviceTypeOption?.isStringLight ? MoodJumpGradientMode.StringGradient : (deviceTypeOption?.isStripLight || deviceTypeOption?.isCeilingLight) ? MoodJumpGradientMode.StripGradient : MoodJumpGradientMode.SourceGradient
32
- ), [MoodJumpGradientMode, deviceTypeOption])
33
-
34
- return (
35
- <Card style={styles.root} onPress={props.onPress}>
36
- <CellContent
37
- title={props.title}
38
- value={''}
39
- style={styles.content}
40
- titleStyle={styles.title}
41
- iconStyle={{
42
- color: '#000',
43
- size: cx(16),
44
- }}
45
- />
46
- {!!(mood.mainLamp) && (
47
- <>
48
- <View style={styles.lineStyle}>
49
- <MixMoodColorsLine mixSubLight={mood?.mainLamp} isMix={isMix} type={mood.mainLamp.mode === gradientMode ? 'gradient' : 'separate'}/>
50
- <Spacer height={cx(7)} />
51
- {(isMix && !!mood.secondaryLamp.nodes.length) && <MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode === gradientMode ? 'gradient' : 'separate'}/>}
52
- </View>
53
- <Spacer height={cx(24)} />
54
- </>
55
- )}
56
- </Card>
57
- );
58
- };
59
-
60
- const styles = StyleSheet.create({
61
- root: {
62
- flexDirection: 'row',
63
- alignItems: 'center',
64
- marginHorizontal: cx(24),
65
- },
66
- content: {
67
- height: cx(56),
68
- marginHorizontal: cx(16),
69
- width: cx(295)
70
- },
71
- title: {
72
- color: '#000',
73
- fontSize: cx(16),
74
- fontFamily: 'helvetica_neue_lt_std_bd',
75
- },
76
- lineStyle: {
77
- alignItems: 'center',
78
- },
79
- });
80
-
81
- export default RecommendMixMoodItem;
1
+ import React, { useMemo } from 'react';
2
+ import { Utils } from 'tuya-panel-kit';
3
+ import Card from '@ledvance/base/src/components/Card';
4
+ import { CellContent } from '@ledvance/base/src/components/Cell';
5
+ import { StyleSheet, View } from 'react-native';
6
+ import Spacer from '@ledvance/base/src/components/Spacer';
7
+ import { MoodJumpGradientMode, MoodUIInfo } from './Interface';
8
+ import { MixMoodColorsLine } from './MoodItem';
9
+
10
+ const cx = Utils.RatioUtils.convertX;
11
+
12
+ interface LightCategory {
13
+ isMixLight?: boolean
14
+ isStripLight?: boolean
15
+ isStringLight?: boolean
16
+ isCeilingLight?: boolean
17
+ }
18
+
19
+ interface RecommendMixMoodItemProps {
20
+ title: string;
21
+ isMix: boolean;
22
+ mood: MoodUIInfo;
23
+ deviceTypeOption?: LightCategory
24
+ onPress: () => void;
25
+ }
26
+
27
+ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
28
+ const { mood, isMix, deviceTypeOption } = props;
29
+
30
+ const gradientMode = useMemo(() => (
31
+ deviceTypeOption?.isStringLight ? MoodJumpGradientMode.StringGradient : deviceTypeOption?.isStripLight ? MoodJumpGradientMode.StripGradient : MoodJumpGradientMode.SourceGradient
32
+ ), [MoodJumpGradientMode, deviceTypeOption])
33
+
34
+ return (
35
+ <Card style={styles.root} onPress={props.onPress}>
36
+ <CellContent
37
+ title={props.title}
38
+ value={''}
39
+ style={styles.content}
40
+ titleStyle={styles.title}
41
+ iconStyle={{
42
+ color: '#000',
43
+ size: cx(16),
44
+ }}
45
+ />
46
+ {!!(mood.mainLamp) && (
47
+ <>
48
+ <View style={styles.lineStyle}>
49
+ <MixMoodColorsLine mixSubLight={mood?.mainLamp} isMix={isMix} type={(mood.mainLamp.mode === gradientMode && !deviceTypeOption?.isCeilingLight) ? 'gradient' : 'separate'}/>
50
+ <Spacer height={cx(7)} />
51
+ {(isMix && !!mood.secondaryLamp.nodes.length) && <MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode === (deviceTypeOption?.isMixLight ? MoodJumpGradientMode.SourceGradient : MoodJumpGradientMode.StripGradient) ? 'gradient' : 'separate'}/>}
52
+ </View>
53
+ <Spacer height={cx(24)} />
54
+ </>
55
+ )}
56
+ </Card>
57
+ );
58
+ };
59
+
60
+ const styles = StyleSheet.create({
61
+ root: {
62
+ flexDirection: 'row',
63
+ alignItems: 'center',
64
+ marginHorizontal: cx(24),
65
+ },
66
+ content: {
67
+ height: cx(56),
68
+ marginHorizontal: cx(16),
69
+ width: cx(295)
70
+ },
71
+ title: {
72
+ color: '#000',
73
+ fontSize: cx(16),
74
+ fontFamily: 'helvetica_neue_lt_std_bd',
75
+ },
76
+ lineStyle: {
77
+ alignItems: 'center',
78
+ },
79
+ });
80
+
81
+ export default RecommendMixMoodItem;
@@ -1,43 +1,52 @@
1
- import {NavigationRoute} from "tuya-panel-kit";
2
- import DynamicMoodEditorPage from "./DynamicMoodEditorPage";
3
- import StaticMoodEditorPage from "./StaticMoodEditorPage";
4
- import AddMoodPage from "./AddMoodPage";
5
- import MoodPage from "./MoodPage";
6
- import {ui_biz_routerKey} from "../../navigation/Routers";
7
-
8
- const MoodPageRouters: NavigationRoute[] = [
9
- {
10
- name: ui_biz_routerKey.ui_biz_dynamic_mood_edit,
11
- component: DynamicMoodEditorPage,
12
- options: {
13
- hideTopbar: true,
14
- showOfflineView: false,
15
- },
16
- },
17
- {
18
- name: ui_biz_routerKey.ui_biz_static_mood_edit,
19
- component: StaticMoodEditorPage,
20
- options: {
21
- hideTopbar: true,
22
- showOfflineView: false,
23
- },
24
- },
25
- {
26
- name: ui_biz_routerKey.ui_biz_mood_add,
27
- component: AddMoodPage,
28
- options: {
29
- hideTopbar: true,
30
- showOfflineView: false,
31
- },
32
- },
33
- {
34
- name: ui_biz_routerKey.ui_biz_mood,
35
- component: MoodPage,
36
- options: {
37
- hideTopbar: true,
38
- showOfflineView: false,
39
- },
40
- }
41
- ]
42
-
43
- export default MoodPageRouters
1
+ import {NavigationRoute} from "tuya-panel-kit";
2
+ import DynamicMoodEditorPage from "./DynamicMoodEditorPage";
3
+ import StaticMoodEditorPage from "./StaticMoodEditorPage";
4
+ import AddMoodPage from "./AddMoodPage";
5
+ import MoodPage from "./MoodPage";
6
+ import {ui_biz_routerKey} from "../../navigation/Routers";
7
+ import MixDynamicMoodEditorPage from "./MixDynamicMoodEditor";
8
+
9
+ const MoodPageRouters: NavigationRoute[] = [
10
+ {
11
+ name: ui_biz_routerKey.ui_biz_dynamic_mood_edit,
12
+ component: DynamicMoodEditorPage,
13
+ options: {
14
+ hideTopbar: true,
15
+ showOfflineView: false,
16
+ },
17
+ },
18
+ {
19
+ name: ui_biz_routerKey.ui_biz_dynamic_mix_mood_edit,
20
+ component: MixDynamicMoodEditorPage,
21
+ options: {
22
+ hideTopbar: true,
23
+ showOfflineView: false,
24
+ },
25
+ },
26
+ {
27
+ name: ui_biz_routerKey.ui_biz_static_mood_edit,
28
+ component: StaticMoodEditorPage,
29
+ options: {
30
+ hideTopbar: true,
31
+ showOfflineView: false,
32
+ },
33
+ },
34
+ {
35
+ name: ui_biz_routerKey.ui_biz_mood_add,
36
+ component: AddMoodPage,
37
+ options: {
38
+ hideTopbar: true,
39
+ showOfflineView: false,
40
+ },
41
+ },
42
+ {
43
+ name: ui_biz_routerKey.ui_biz_mood,
44
+ component: MoodPage,
45
+ options: {
46
+ hideTopbar: true,
47
+ showOfflineView: false,
48
+ },
49
+ }
50
+ ]
51
+
52
+ export default MoodPageRouters