@ledvance/group-ui-biz-bundle 1.0.76 → 1.0.78

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.
@@ -12,11 +12,13 @@ import {RandomTimingItem, RandomTimingParam, useRandomTiming} from "./RandomTimi
12
12
  import Spacer from "@ledvance/base/src/components/Spacer";
13
13
  import ItemCard from "./ItemCard";
14
14
  import {cloneDeep} from "lodash";
15
+ import InfoText from "@ledvance/base/src/components/InfoText";
15
16
 
16
17
  const {convertX: cx, topBarHeight} = Utils.RatioUtils;
18
+ const { withTheme } = Utils.ThemeUtils
17
19
  const MAX_NUM = 4
18
20
 
19
- const RandomTimeForLightPage = () => {
21
+ const RandomTimeForLightPage = (props: { theme?: any}) => {
20
22
  const devInfo = useDeviceInfo()
21
23
  const navigation = useNavigation()
22
24
  const params = useRoute().params as RandomTimingParam
@@ -58,17 +60,59 @@ const RandomTimeForLightPage = () => {
58
60
  }
59
61
  }, [randomTimingList])
60
62
 
63
+ const styles = StyleSheet.create({
64
+ bg: {
65
+ marginTop: topBarHeight,
66
+ flex: 1,
67
+ },
68
+ emptyListCon: {
69
+ justifyContent: 'center',
70
+ alignItems: 'center',
71
+ marginTop: cx(30),
72
+ },
73
+ emptyImage: {
74
+ width: cx(225),
75
+ height: cx(198)
76
+ },
77
+ emptyNoTime: {
78
+ fontSize: cx(12),
79
+ color: props.theme.global.fontColor,
80
+ },
81
+ maxImg: {
82
+ width: cx(16),
83
+ height: cx(16),
84
+ tintColor: props.theme.global.warning
85
+ },
86
+ maxTip: {
87
+ color: props.theme.global.secondFontColor,
88
+ },
89
+ addButton: {
90
+ height: cx(36),
91
+ width: cx(150),
92
+ marginVertical: cx(25),
93
+ marginHorizontal: cx(24),
94
+ borderRadius: cx(6),
95
+ backgroundColor: props.theme.button.primary,
96
+ },
97
+ addButtonText: {
98
+ fontSize: cx(12),
99
+ fontWeight: 'bold',
100
+ color: props.theme.button.fontColor,
101
+ textAlign: 'center'
102
+ }
103
+ })
104
+
61
105
  const renderList = () => {
62
106
  return (
63
107
  <ScrollView nestedScrollEnabled={true}>
64
108
  <Text style={{
65
- color: '#000',
109
+ color: props.theme.global.fontColor,
66
110
  marginLeft: cx(24),
67
111
  }}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
68
112
  <Spacer height={cx(10)}/>
69
113
  {isMaxNum && <View style={{marginHorizontal: cx(24), flexDirection: 'row'}}>
70
- <Image style={{width: cx(16), height: cx(16), tintColor: '#ff9500'}} source={res.ic_warning_amber}/>
71
- <Text>{I18n.getLang('fixedtimecycle_warning_max_number_text')}</Text>
114
+ <Image style={styles.maxImg} source={res.ic_warning_amber}/>
115
+ <Text style={styles.maxTip}>{I18n.getLang('fixedtimecycle_warning_max_number_text')}</Text>
72
116
  </View>}
73
117
  <FlatList
74
118
  data={randomTimingList}
@@ -103,30 +147,15 @@ const RandomTimeForLightPage = () => {
103
147
  style={styles.emptyImage}
104
148
  source={{uri: res.ldv_timer_empty}}
105
149
  resizeMode="contain"/>
150
+ <InfoText
151
+ style={{width: 'auto', alignItems: 'center'}}
152
+ icon={res.device_panel_schedule_alert}
153
+ text={I18n.getLang('randomtimecycle_empty_information_text')}
154
+ textStyle={{flex: undefined}}
155
+ contentColor={props.theme.global.secondFontColor}
156
+ />
106
157
  <View
107
- style={{
108
- marginHorizontal: cx(24),
109
- marginTop: cx(30),
110
- flexDirection: 'row',
111
- alignItems: 'center',
112
- }}
113
- >
114
- <Image
115
- source={{uri: res.device_panel_schedule_alert}}
116
- style={{width: cx(16), height: cx(16)}}
117
- />
118
- <Text style={styles.emptyNoTime}>{I18n.getLang('randomtimecycle_empty_information_text')}</Text>
119
- </View>
120
- <View
121
- style={{
122
- height: cx(36),
123
- width: cx(150),
124
- marginVertical: cx(25),
125
- marginHorizontal: cx(24),
126
- borderRadius: cx(6),
127
- backgroundColor: '#f60',
128
- }}
129
- >
158
+ style={styles.addButton}>
130
159
  <TouchableOpacity
131
160
  style={{
132
161
  flex: 1,
@@ -135,7 +164,7 @@ const RandomTimeForLightPage = () => {
135
164
  }}
136
165
  onPress={() => onAddOrEditItem('add')}
137
166
  >
138
- <Text style={{fontSize: cx(12), fontWeight: 'bold', color: '#fff', textAlign: 'center'}}>
167
+ <Text style={styles.addButtonText}>
139
168
  {I18n.getLang('randomtimecycle_empty_bttn_text')}
140
169
  </Text>
141
170
  </TouchableOpacity>
@@ -156,38 +185,4 @@ const RandomTimeForLightPage = () => {
156
185
  )
157
186
  }
158
187
 
159
- const styles = StyleSheet.create({
160
- bg: {
161
- marginTop: topBarHeight,
162
- flex: 1,
163
- },
164
- emptyListCon: {
165
- justifyContent: 'center',
166
- alignItems: 'center',
167
- marginTop: cx(30),
168
- },
169
- emptyImage: {
170
- width: cx(225),
171
- height: cx(198)
172
- },
173
- emptyNoTime: {
174
- fontSize: cx(12),
175
- color: '#000'
176
- },
177
- emptyTimeTip: {
178
- fontSize: cx(12),
179
- lineHeight: cx(17),
180
- marginTop: cx(6),
181
- width: '76%',
182
- textAlign: 'center'
183
- },
184
- listContainer: {
185
- bottom: cx(74)
186
- },
187
- categoryList: {
188
- marginHorizontal: cx(24),
189
- marginBottom: cx(12),
190
- },
191
- })
192
-
193
- export default RandomTimeForLightPage
188
+ export default withTheme(RandomTimeForLightPage)
@@ -6,8 +6,10 @@ import { Utils } from "tuya-panel-kit";
6
6
  import Spacer from "@ledvance/base/src/components/Spacer";
7
7
 
8
8
  const { convertX: cx } = Utils.RatioUtils;
9
+ const { withTheme } = Utils.ThemeUtils
9
10
 
10
11
  interface SummaryProps {
12
+ theme?: any
11
13
  style?: ViewStyle
12
14
  frequency?: string | ReactElement
13
15
  time?: string | ReactElement
@@ -16,6 +18,53 @@ interface SummaryProps {
16
18
  }
17
19
 
18
20
  const Summary = (props: SummaryProps) => {
21
+
22
+ const styles = StyleSheet.create({
23
+ cardContainer: {
24
+ marginHorizontal: cx(24),
25
+ },
26
+ itemTitle: {
27
+ color: props.theme.global.fontColor,
28
+ fontSize: cx(16),
29
+ fontWeight: 'bold',
30
+ fontFamily: 'helvetica_neue_lt_std_bd',
31
+ },
32
+ summaryContainer: {
33
+ flex: 1,
34
+ flexDirection: 'row',
35
+ marginBottom: cx(10),
36
+ },
37
+ summaryLeft: {
38
+ flexDirection: 'row',
39
+ alignItems: 'center',
40
+ minWidth: cx(100)
41
+ },
42
+ summaryImg: {
43
+ tintColor: props.theme.global.fontColor,
44
+ width: cx(12),
45
+ height: cx(12),
46
+ marginRight: cx(6)
47
+ },
48
+ leftTitle: {
49
+ fontSize: cx(14),
50
+ color: props.theme.global.fontColor,
51
+ },
52
+ summaryRight: {
53
+ flex: 1,
54
+ flexDirection: 'column',
55
+ marginLeft: cx(15),
56
+ },
57
+ rightWrap: {
58
+ borderRadius: cx(16),
59
+ paddingHorizontal: cx(12),
60
+ alignSelf: 'flex-start',
61
+ backgroundColor: props.theme.tag.background,
62
+ },
63
+ rightItem: {
64
+ color: props.theme.tag.fontColor,
65
+ },
66
+ })
67
+
19
68
  return (
20
69
  <View style={styles.cardContainer}>
21
70
  <Text style={styles.itemTitle}>{I18n.getLang('add_randomtimecycle_subheadline_text')}</Text>
@@ -56,68 +105,23 @@ const Summary = (props: SummaryProps) => {
56
105
  </View>
57
106
  </View>
58
107
  {!props.hideActions && <View style={[styles.summaryContainer, { alignItems: 'flex-start' }]}>
59
- <View style={styles.summaryLeft}>
60
- <Image
61
- source={res.summary_icon3}
62
- resizeMode="contain"
63
- style={styles.summaryImg}
64
- />
65
- <View>
66
- <Text style={styles.leftTitle}>{I18n.getLang('motion_detection_add_time_schedule_actions_text1')}</Text>
108
+ <View style={styles.summaryLeft}>
109
+ <Image
110
+ source={res.summary_icon3}
111
+ resizeMode="contain"
112
+ style={styles.summaryImg}
113
+ />
114
+ <View>
115
+ <Text style={styles.leftTitle}>{I18n.getLang('motion_detection_add_time_schedule_actions_text1')}</Text>
116
+ </View>
117
+ </View>
118
+ <View style={styles.summaryRight}>
119
+ {props.actions}
67
120
  </View>
68
- </View>
69
- <View style={styles.summaryRight}>
70
- {props.actions}
71
- </View>
72
121
  </View>}
73
122
  </View>
74
123
  </View>
75
124
  )
76
125
  }
77
126
 
78
- const styles = StyleSheet.create({
79
- cardContainer: {
80
- marginHorizontal: cx(24),
81
- },
82
- itemTitle: {
83
- color: '#000',
84
- fontSize: cx(16),
85
- fontWeight: 'bold',
86
- fontFamily: 'helvetica_neue_lt_std_bd',
87
- },
88
- summaryContainer: {
89
- flex: 1,
90
- flexDirection: 'row',
91
- marginBottom: cx(10),
92
- },
93
- summaryLeft: {
94
- flexDirection: 'row',
95
- alignItems: 'center',
96
- minWidth: cx(100)
97
- },
98
- summaryImg: {
99
- width: cx(12),
100
- height: cx(12),
101
- marginRight: cx(6)
102
- },
103
- leftTitle: {
104
- fontSize: cx(14),
105
- color: '#000'
106
- },
107
- summaryRight: {
108
- flex: 1,
109
- flexDirection: 'column',
110
- marginLeft: cx(15),
111
- },
112
- rightWrap: {
113
- borderRadius: cx(16),
114
- paddingHorizontal: cx(12),
115
- alignSelf: 'flex-start',
116
- backgroundColor: '#cbcbcb',
117
- },
118
- rightItem: {
119
- color: '#000',
120
- },
121
- })
122
-
123
- export default memo(Summary)
127
+ export default memo(withTheme(Summary))
@@ -8,6 +8,7 @@ import Card from '@ledvance/base/src/components/Card'
8
8
  import res from '@ledvance/base/src/res'
9
9
 
10
10
  const cx = Utils.RatioUtils.convertX
11
+ const { withTheme } = Utils.ThemeUtils
11
12
 
12
13
  export interface SelectPageData<T> {
13
14
  text: string
@@ -21,9 +22,71 @@ export interface SelectPageParams<T> {
21
22
  onSelect: (selectPageData: SelectPageData<T>) => void
22
23
  }
23
24
 
24
- const SelectPage = () => {
25
+ const SelectPage = (props: { theme?: any }) => {
25
26
  const params = useRoute().params as SelectPageParams<any>
26
27
  const navigation = useNavigation()
28
+
29
+ const styles = StyleSheet.create({
30
+ root: {
31
+ flex: 1,
32
+ },
33
+ topBar: {
34
+ height: cx(91),
35
+ backgroundColor: props.theme.card.head,
36
+ },
37
+ line: {
38
+ height: cx(1),
39
+ backgroundColor: props.theme.container.divider,
40
+ },
41
+ topContent: {
42
+ height: cx(45),
43
+ flexDirection: 'row',
44
+ alignItems: 'center',
45
+ },
46
+ cancel: {
47
+ marginStart: cx(16),
48
+ color: props.theme.button.cancel,
49
+ fontSize: cx(17),
50
+ fontFamily: 'helvetica_neue_lt_std_roman',
51
+ },
52
+ title: {
53
+ width: '100%',
54
+ position: 'absolute',
55
+ start: 0,
56
+ textAlign: 'center',
57
+ color: props.theme.global.fontColor,
58
+ fontSize: cx(17),
59
+ fontFamily: 'helvetica_neue_lt_std_bd',
60
+ },
61
+ card: {
62
+ backgroundColor: props.theme.card.background,
63
+ marginHorizontal: cx(16),
64
+ },
65
+ item: {
66
+ height: cx(44),
67
+ flexDirection: 'row',
68
+ alignItems: 'center',
69
+ },
70
+ itemText: {
71
+ flex: 1,
72
+ marginStart: cx(13),
73
+ color: props.theme.global.fontColor,
74
+ fontSize: cx(17),
75
+ fontFamily: 'helvetica_neue_lt_std_roman',
76
+ },
77
+ itemLine: {
78
+ height: cx(1),
79
+ marginStart: cx(13),
80
+ backgroundColor: props.theme.container.divider,
81
+ },
82
+ itemIcon: {
83
+ width: cx(30),
84
+ height: cx(30),
85
+ marginEnd: cx(13),
86
+ tintColor: props.theme.icon.primary,
87
+ },
88
+ })
89
+
27
90
  return (
28
91
  <View style={styles.root}>
29
92
  <View style={styles.topBar}>
@@ -76,64 +139,4 @@ const SelectPage = () => {
76
139
  )
77
140
  }
78
141
 
79
- const styles = StyleSheet.create({
80
- root: {
81
- flex: 1,
82
- },
83
- topBar: {
84
- height: cx(91),
85
- backgroundColor: '#eaeaea',
86
- },
87
- line: {
88
- height: cx(1),
89
- backgroundColor: '#d9d9d9',
90
- },
91
- topContent: {
92
- height: cx(45),
93
- flexDirection: 'row',
94
- alignItems: 'center',
95
- },
96
- cancel: {
97
- marginStart: cx(16),
98
- color: '#f60',
99
- fontSize: cx(17),
100
- fontFamily: 'helvetica_neue_lt_std_roman',
101
- },
102
- title: {
103
- width: '100%',
104
- position: 'absolute',
105
- start: 0,
106
- textAlign: 'center',
107
- color: '#000',
108
- fontSize: cx(17),
109
- fontFamily: 'helvetica_neue_lt_std_bd',
110
- },
111
- card: {
112
- marginHorizontal: cx(16),
113
- },
114
- item: {
115
- height: cx(44),
116
- flexDirection: 'row',
117
- alignItems: 'center',
118
- },
119
- itemText: {
120
- flex: 1,
121
- marginStart: cx(13),
122
- color: '#000',
123
- fontSize: cx(17),
124
- fontFamily: 'helvetica_neue_lt_std_roman',
125
- },
126
- itemLine: {
127
- height: cx(1),
128
- marginStart: cx(13),
129
- backgroundColor: '#ccc',
130
- },
131
- itemIcon: {
132
- width: cx(30),
133
- height: cx(30),
134
- marginEnd: cx(13),
135
- tintColor: '#f60',
136
- },
137
- })
138
-
139
- export default SelectPage
142
+ export default withTheme(SelectPage)
@@ -362,7 +362,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
362
362
  </Text>
363
363
  <View
364
364
  style={{
365
- backgroundColor: props.theme.card.board,
365
+ backgroundColor: props.theme.card.border,
366
366
  borderRadius: 4,
367
367
  minHeight: cx(50),
368
368
  flex: 1,
@@ -13,8 +13,9 @@ import Spacer from "@ledvance/base/src/components/Spacer";
13
13
  import Stepper from '@ledvance/base/src/components/Stepper'
14
14
 
15
15
  const {convertX: cx} = Utils.RatioUtils
16
+ const { withTheme } = Utils.ThemeUtils
16
17
 
17
- const SwitchGradientPage = () => {
18
+ const SwitchGradientPage = (props: { theme?: any }) => {
18
19
  const devInfo = useDeviceInfo()
19
20
  const navigation = useNavigation()
20
21
  const [
@@ -34,6 +35,27 @@ const SwitchGradientPage = () => {
34
35
  state.switchOffDuration = switchOffDuration
35
36
  }, [switchOnDuration, switchOffDuration])
36
37
 
38
+
39
+ const styles = StyleSheet.create({
40
+ stepCard: {
41
+ marginHorizontal: cx(24),
42
+ paddingHorizontal: cx(16),
43
+ },
44
+ stepTitle: {
45
+ color: props.theme.global.fontColor,
46
+ fontSize: cx(14),
47
+ },
48
+ stepGroup: {
49
+ flexDirection: 'row',
50
+ alignItems: 'center',
51
+ },
52
+ stepText: {
53
+ flex: 1,
54
+ color: props.theme.global.fontColor,
55
+ fontSize: cx(16),
56
+ },
57
+ })
58
+
37
59
  return (
38
60
  <Page
39
61
  backText={devInfo.name}
@@ -92,24 +114,4 @@ const SwitchGradientPage = () => {
92
114
  )
93
115
  }
94
116
 
95
- const styles = StyleSheet.create({
96
- stepCard: {
97
- marginHorizontal: cx(24),
98
- paddingHorizontal: cx(16),
99
- },
100
- stepTitle: {
101
- color: '#000',
102
- fontSize: cx(14),
103
- },
104
- stepGroup: {
105
- flexDirection: 'row',
106
- alignItems: 'center',
107
- },
108
- stepText: {
109
- flex: 1,
110
- color: '#000',
111
- fontSize: cx(16),
112
- },
113
- })
114
-
115
- export default SwitchGradientPage
117
+ export default withTheme(SwitchGradientPage)