@ledvance/base 1.2.77 → 1.2.79
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/localazy.json +4 -1
- package/package.json +1 -1
- package/src/api/nativeEventEmitter.ts +2 -2
- package/src/components/AdvanceCard.tsx +10 -10
- package/src/components/Card.tsx +8 -4
- package/src/components/DeleteButton.tsx +5 -3
- package/src/components/FanAdjustView.tsx +3 -2
- package/src/components/Page.tsx +6 -3
- package/src/components/TextField.tsx +54 -52
- package/src/components/TextFieldStyleButton.tsx +64 -61
- package/src/components/ldvPickerView.tsx +27 -24
- package/src/components/ldvSwitch.tsx +4 -3
- package/src/components/ldvTopBar.tsx +5 -3
- package/src/components/ldvTopName.tsx +15 -13
- package/src/components/weekSelect.tsx +8 -5
- package/src/composeLayout.tsx +36 -14
- package/src/config/dark-theme.ts +60 -0
- package/src/config/light-theme.ts +60 -0
- package/src/i18n/strings.ts +105 -18
- package/src/main.tsx +3 -3
- package/src/res/device_panel_schedule_add.png +0 -0
- package/src/res/device_panel_schedule_alert.png +0 -0
- package/src/res/index.ts +2 -2
package/localazy.json
CHANGED
|
@@ -830,7 +830,10 @@
|
|
|
830
830
|
"MATCH:country_sy",
|
|
831
831
|
"MATCH:country_pe",
|
|
832
832
|
"MATCH:flag_resetbutton",
|
|
833
|
-
"MATCH:flag_resetdescription"
|
|
833
|
+
"MATCH:flag_resetdescription",
|
|
834
|
+
"MATCH:device_menu_camera_thirdbox_text1",
|
|
835
|
+
"MATCH:camera_human_private_mode",
|
|
836
|
+
"MATCH:camera_human_body_filtering"
|
|
834
837
|
],
|
|
835
838
|
"replacements": {
|
|
836
839
|
"REGEX:% %1\\$s.*?\\)%": "{0}",
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import Card from 'components/Card'
|
|
|
5
5
|
import Spacer from 'components/Spacer'
|
|
6
6
|
|
|
7
7
|
const { convertX: cx } = Utils.RatioUtils
|
|
8
|
+
const { withTheme } = Utils.ThemeUtils
|
|
8
9
|
|
|
9
10
|
export interface AdvancedData {
|
|
10
11
|
title: string
|
|
@@ -37,6 +38,7 @@ export function getAdvancedStatusColor(status: AdvancedStatus): string {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export interface AdvanceCardProps extends PropsWithChildren<ViewProps> {
|
|
41
|
+
theme?: any
|
|
40
42
|
data: AdvancedData
|
|
41
43
|
onPress: () => void
|
|
42
44
|
}
|
|
@@ -49,21 +51,21 @@ const AdvanceCard = (props: AdvanceCardProps) => {
|
|
|
49
51
|
containerStyle={styles.itemContent}
|
|
50
52
|
onPress={props.onPress}>
|
|
51
53
|
{!!statusColor && <View style={styles.dotBg}>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
<View
|
|
55
|
+
style={[
|
|
56
|
+
styles.dot,
|
|
57
|
+
{backgroundColor: props.data.statusColor},
|
|
58
|
+
]}/>
|
|
57
59
|
</View>}
|
|
58
60
|
{
|
|
59
61
|
props.children ?
|
|
60
62
|
props.children :
|
|
61
63
|
<View style={styles.titleBg}>
|
|
62
|
-
<Text style={styles.title}>{props.data.title}</Text>
|
|
64
|
+
<Text style={{...styles.title, color: props.theme.global.fontColor}}>{props.data.title}</Text>
|
|
63
65
|
<Spacer height={cx(8)} />
|
|
64
66
|
{
|
|
65
67
|
(!!props.data.subtitles) && props.data.subtitles.map((subtitle, index) => (
|
|
66
|
-
<Text style={styles.subtitle} key={`${subtitle}_${index}`}>{subtitle}</Text>
|
|
68
|
+
<Text style={{...styles.subtitle, color: props.theme.global.secondFontColor}} key={`${subtitle}_${index}`}>{subtitle}</Text>
|
|
67
69
|
))
|
|
68
70
|
}
|
|
69
71
|
</View>
|
|
@@ -85,13 +87,11 @@ const styles = StyleSheet.create({
|
|
|
85
87
|
},
|
|
86
88
|
title: {
|
|
87
89
|
marginHorizontal: cx(16),
|
|
88
|
-
color: '#000',
|
|
89
90
|
fontSize: cx(14),
|
|
90
91
|
textAlign: 'center',
|
|
91
92
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
92
93
|
},
|
|
93
94
|
subtitle: {
|
|
94
|
-
color: '#666',
|
|
95
95
|
fontSize: cx(10),
|
|
96
96
|
textAlign: 'center',
|
|
97
97
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
@@ -114,4 +114,4 @@ const styles = StyleSheet.create({
|
|
|
114
114
|
},
|
|
115
115
|
})
|
|
116
116
|
|
|
117
|
-
export default AdvanceCard
|
|
117
|
+
export default withTheme(AdvanceCard)
|
package/src/components/Card.tsx
CHANGED
|
@@ -3,23 +3,25 @@ import React, {PropsWithChildren} from 'react'
|
|
|
3
3
|
import {Utils} from 'tuya-panel-kit'
|
|
4
4
|
|
|
5
5
|
const cx = Utils.RatioUtils.convertX
|
|
6
|
+
const { withTheme } = Utils.ThemeUtils
|
|
6
7
|
|
|
7
8
|
interface CardProps extends PropsWithChildren<ViewProps> {
|
|
9
|
+
theme?: any
|
|
8
10
|
shadowHeight?: number | undefined
|
|
9
11
|
onPress?: () => void
|
|
10
12
|
onLongPress?: () => void
|
|
11
13
|
containerStyle?: StyleProp<ViewStyle>
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
const Card = (props: CardProps) => {
|
|
15
17
|
const shadowHeight = props.shadowHeight || cx(7)
|
|
16
18
|
return (
|
|
17
19
|
<View
|
|
18
20
|
style={[{
|
|
19
21
|
overflow: Platform.OS === 'ios' ? undefined : 'hidden',
|
|
20
|
-
backgroundColor:
|
|
22
|
+
backgroundColor: props.theme.card.background,
|
|
21
23
|
elevation: shadowHeight,
|
|
22
|
-
shadowColor:
|
|
24
|
+
shadowColor: props.theme.card.shadowColor,
|
|
23
25
|
shadowOpacity: 0.2,
|
|
24
26
|
shadowRadius: shadowHeight,
|
|
25
27
|
shadowOffset: {
|
|
@@ -33,4 +35,6 @@ export default function Card(props: CardProps) {
|
|
|
33
35
|
</TouchableOpacity>
|
|
34
36
|
</View>
|
|
35
37
|
)
|
|
36
|
-
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default withTheme(Card)
|
|
@@ -3,8 +3,10 @@ import { StyleProp, Text, TextStyle, TouchableOpacity, ViewStyle } from 'react-n
|
|
|
3
3
|
import { Utils } from 'tuya-panel-kit'
|
|
4
4
|
|
|
5
5
|
const cx = Utils.RatioUtils.convertX
|
|
6
|
+
const { withTheme } = Utils.ThemeUtils
|
|
6
7
|
|
|
7
8
|
interface DeleteButtonProps {
|
|
9
|
+
theme?: any
|
|
8
10
|
text: string,
|
|
9
11
|
onPress: () => void,
|
|
10
12
|
style?: StyleProp<ViewStyle>,
|
|
@@ -21,13 +23,13 @@ const DeleteButton = (props: DeleteButtonProps) => {
|
|
|
21
23
|
style={[{
|
|
22
24
|
width: '100%',
|
|
23
25
|
height: cx(50),
|
|
24
|
-
backgroundColor:
|
|
26
|
+
backgroundColor: props.theme.button.disabled,
|
|
25
27
|
alignItems: 'center',
|
|
26
28
|
justifyContent: 'center',
|
|
27
29
|
borderRadius: cx(8),
|
|
28
30
|
}, style]}>
|
|
29
31
|
<Text style={[{
|
|
30
|
-
color:
|
|
32
|
+
color: props.theme.button.fontColor,
|
|
31
33
|
fontSize: cx(16),
|
|
32
34
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
33
35
|
}, textStyle]}>{text}</Text>
|
|
@@ -35,4 +37,4 @@ const DeleteButton = (props: DeleteButtonProps) => {
|
|
|
35
37
|
)
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
export default DeleteButton
|
|
40
|
+
export default withTheme(DeleteButton)
|
|
@@ -13,6 +13,7 @@ import Popup from './Popup'
|
|
|
13
13
|
const {convertX: cx} = Utils.RatioUtils
|
|
14
14
|
|
|
15
15
|
interface FanAdjustViewProps extends ViewProps {
|
|
16
|
+
hideEnable?: boolean
|
|
16
17
|
fanEnable: boolean
|
|
17
18
|
fanSpeed: number
|
|
18
19
|
maxFanSpeed?: number
|
|
@@ -43,12 +44,12 @@ const FanAdjustView = (props: FanAdjustViewProps) => {
|
|
|
43
44
|
export function FanAdjustViewContent(props: FanAdjustViewProps) {
|
|
44
45
|
return (
|
|
45
46
|
<View>
|
|
46
|
-
<LdvSwitch
|
|
47
|
+
{!props.hideEnable && <LdvSwitch
|
|
47
48
|
title={I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_headline')}
|
|
48
49
|
enable={props.fanEnable}
|
|
49
50
|
setEnable={props.onFanSwitch}
|
|
50
51
|
color={''}
|
|
51
|
-
colorAlpha={1}/>
|
|
52
|
+
colorAlpha={1}/>}
|
|
52
53
|
{props.fanEnable && (
|
|
53
54
|
<View>
|
|
54
55
|
<LdvSlider
|
package/src/components/Page.tsx
CHANGED
|
@@ -2,11 +2,14 @@ import React, { PropsWithChildren, useCallback, useEffect } from 'react'
|
|
|
2
2
|
import { BackHandler, View, ViewProps } from 'react-native'
|
|
3
3
|
import LDVTopBar from './ldvTopBar'
|
|
4
4
|
import { useNavigation } from '@react-navigation/native'
|
|
5
|
-
import {
|
|
5
|
+
import {Dialog, Toast, Utils} from 'tuya-panel-kit'
|
|
6
6
|
import I18n from '@i18n'
|
|
7
7
|
import LdvTopName from './ldvTopName'
|
|
8
8
|
|
|
9
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
|
+
|
|
9
11
|
interface PageProps extends PropsWithChildren<ViewProps> {
|
|
12
|
+
theme?: any
|
|
10
13
|
rightButtonDisabled?: boolean
|
|
11
14
|
backText: string
|
|
12
15
|
onBackClick?: () => void
|
|
@@ -64,7 +67,7 @@ const Page = (props: PageProps) => {
|
|
|
64
67
|
|
|
65
68
|
return (
|
|
66
69
|
<>
|
|
67
|
-
<View style={[{ flex: 1, position: 'relative' }, props.style]}>
|
|
70
|
+
<View style={[{ flex: 1, position: 'relative', backgroundColor: props.theme.global.backgroud }, props.style]}>
|
|
68
71
|
<LDVTopBar
|
|
69
72
|
title={props.backText}
|
|
70
73
|
onBackPress={
|
|
@@ -98,4 +101,4 @@ const Page = (props: PageProps) => {
|
|
|
98
101
|
)
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
export default Page
|
|
104
|
+
export default withTheme(Page)
|
|
@@ -4,17 +4,65 @@ import {Utils} from 'tuya-panel-kit'
|
|
|
4
4
|
import res from '../res'
|
|
5
5
|
|
|
6
6
|
const cx = Utils.RatioUtils.convertX
|
|
7
|
+
const { withTheme } = Utils.ThemeUtils
|
|
7
8
|
|
|
8
9
|
interface TextFieldProps extends TextInputProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
theme?: any
|
|
11
|
+
showError?: boolean
|
|
12
|
+
errorText?: string
|
|
13
|
+
tipIcon?: ImageSourcePropType
|
|
14
|
+
tipColor?: string
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
const TextField = (props: TextFieldProps) => {
|
|
16
18
|
const icon = props.tipIcon || res.ic_warning_amber
|
|
17
|
-
const color = props.tipColor ||
|
|
19
|
+
const color = props.tipColor || props.theme.global.warning
|
|
20
|
+
|
|
21
|
+
const styles = StyleSheet.create({
|
|
22
|
+
topTip: {
|
|
23
|
+
marginTop: cx(5),
|
|
24
|
+
fontSize: cx(12),
|
|
25
|
+
marginStart: cx(13),
|
|
26
|
+
color: props.theme.global.secondFontColor,
|
|
27
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
28
|
+
},
|
|
29
|
+
textInputGroup: {
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
borderRadius: cx(4),
|
|
32
|
+
backgroundColor: props.theme.textInput.background,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
},
|
|
35
|
+
textInput: {
|
|
36
|
+
flex: 1,
|
|
37
|
+
height: cx(44),
|
|
38
|
+
marginStart: cx(16),
|
|
39
|
+
marginEnd: cx(6),
|
|
40
|
+
fontSize: cx(16),
|
|
41
|
+
color: props.theme.textInput.fontColor,
|
|
42
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
43
|
+
},
|
|
44
|
+
iconTouchable: {
|
|
45
|
+
marginEnd: cx(18),
|
|
46
|
+
padding: cx(4),
|
|
47
|
+
},
|
|
48
|
+
icon: {
|
|
49
|
+
width: cx(16),
|
|
50
|
+
height: cx(16),
|
|
51
|
+
},
|
|
52
|
+
line: {
|
|
53
|
+
height: 1,
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
start: cx(4),
|
|
56
|
+
end: cx(4),
|
|
57
|
+
bottom: 0,
|
|
58
|
+
backgroundColor: props.theme.textInput.line,
|
|
59
|
+
},
|
|
60
|
+
errorContainer: {
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
marginStart: cx(13),
|
|
64
|
+
},
|
|
65
|
+
})
|
|
18
66
|
return (
|
|
19
67
|
<View style={props.style}>
|
|
20
68
|
<Text style={[styles.topTip, { opacity: (!!props.value) ? 1 : 0 }]}>{props.placeholder}</Text>
|
|
@@ -41,50 +89,4 @@ const TextField = (props: TextFieldProps) => {
|
|
|
41
89
|
)
|
|
42
90
|
}
|
|
43
91
|
|
|
44
|
-
|
|
45
|
-
topTip: {
|
|
46
|
-
marginTop: cx(5),
|
|
47
|
-
fontSize: cx(12),
|
|
48
|
-
marginStart: cx(13),
|
|
49
|
-
color: '#666',
|
|
50
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
51
|
-
},
|
|
52
|
-
textInputGroup: {
|
|
53
|
-
flexDirection: 'row',
|
|
54
|
-
borderRadius: cx(4),
|
|
55
|
-
backgroundColor: '#f6f6f6',
|
|
56
|
-
alignItems: 'center',
|
|
57
|
-
},
|
|
58
|
-
textInput: {
|
|
59
|
-
flex: 1,
|
|
60
|
-
height: cx(44),
|
|
61
|
-
marginStart: cx(16),
|
|
62
|
-
marginEnd: cx(6),
|
|
63
|
-
fontSize: cx(16),
|
|
64
|
-
color: '#000',
|
|
65
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
66
|
-
},
|
|
67
|
-
iconTouchable: {
|
|
68
|
-
marginEnd: cx(18),
|
|
69
|
-
padding: cx(4),
|
|
70
|
-
},
|
|
71
|
-
icon: {
|
|
72
|
-
width: cx(16),
|
|
73
|
-
height: cx(16),
|
|
74
|
-
},
|
|
75
|
-
line: {
|
|
76
|
-
height: 1,
|
|
77
|
-
position: 'absolute',
|
|
78
|
-
start: cx(4),
|
|
79
|
-
end: cx(4),
|
|
80
|
-
bottom: 0,
|
|
81
|
-
backgroundColor: '#cbcbcb',
|
|
82
|
-
},
|
|
83
|
-
errorContainer: {
|
|
84
|
-
flexDirection: 'row',
|
|
85
|
-
alignItems: 'center',
|
|
86
|
-
marginStart: cx(13),
|
|
87
|
-
},
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
export default TextField
|
|
92
|
+
export default withTheme(TextField)
|
|
@@ -4,8 +4,10 @@ import React from 'react'
|
|
|
4
4
|
import res from "../res/index";
|
|
5
5
|
|
|
6
6
|
const cx = Utils.RatioUtils.convertX
|
|
7
|
+
const { withTheme } = Utils.ThemeUtils
|
|
7
8
|
|
|
8
9
|
interface TextFieldStyleButtonProps extends ViewProps {
|
|
10
|
+
theme?: any
|
|
9
11
|
placeholder: string
|
|
10
12
|
text: string
|
|
11
13
|
onPress: () => void,
|
|
@@ -14,69 +16,70 @@ interface TextFieldStyleButtonProps extends ViewProps {
|
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
const TextFieldStyleButton = (props: TextFieldStyleButtonProps) => {
|
|
19
|
+
const styles = StyleSheet.create({
|
|
20
|
+
topTip: {
|
|
21
|
+
marginTop: cx(5),
|
|
22
|
+
fontSize: cx(12),
|
|
23
|
+
marginStart: cx(13),
|
|
24
|
+
color: props.theme.global.secondFontColor,
|
|
25
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
26
|
+
},
|
|
27
|
+
textGroup: {
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
borderRadius: cx(4),
|
|
30
|
+
backgroundColor: props.theme.textInput.background,
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
},
|
|
33
|
+
textParent: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
height: cx(44),
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
},
|
|
38
|
+
text: {
|
|
39
|
+
marginStart: cx(16),
|
|
40
|
+
marginEnd: cx(6),
|
|
41
|
+
fontSize: cx(16),
|
|
42
|
+
color: props.theme.textInput.fontColor,
|
|
43
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
44
|
+
},
|
|
45
|
+
line: {
|
|
46
|
+
height: 1,
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
start: cx(4),
|
|
49
|
+
end: cx(4),
|
|
50
|
+
bottom: 0,
|
|
51
|
+
backgroundColor: props.theme.textInput.line,
|
|
52
|
+
},
|
|
53
|
+
tipParent: {
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
},
|
|
57
|
+
tipIcon: {
|
|
58
|
+
width: cx(16),
|
|
59
|
+
height: cx(16),
|
|
60
|
+
marginStart: cx(4),
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
|
|
17
64
|
return (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
65
|
+
<View style={props.style}>
|
|
66
|
+
<View style={styles.tipParent}>
|
|
67
|
+
<Text style={styles.topTip}>{props.placeholder}</Text>
|
|
68
|
+
{props.showTipIcon && <TouchableOpacity onPress={props.onTipIconPress}>
|
|
69
|
+
<Image source={res.ic_info} style={styles.tipIcon}/>
|
|
70
|
+
</TouchableOpacity>}
|
|
71
|
+
</View>
|
|
72
|
+
<TouchableOpacity onPress={props.onPress}>
|
|
73
|
+
<View style={styles.textGroup}>
|
|
74
|
+
<View style={styles.textParent}>
|
|
75
|
+
<Text style={styles.text}>{props.text}</Text>
|
|
76
|
+
</View>
|
|
77
|
+
<View style={styles.line} />
|
|
78
|
+
</View>
|
|
79
|
+
</TouchableOpacity>
|
|
80
|
+
</View>
|
|
34
81
|
)
|
|
35
82
|
}
|
|
36
83
|
|
|
37
|
-
const styles = StyleSheet.create({
|
|
38
|
-
topTip: {
|
|
39
|
-
marginTop: cx(5),
|
|
40
|
-
fontSize: cx(12),
|
|
41
|
-
marginStart: cx(13),
|
|
42
|
-
color: '#666',
|
|
43
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
44
|
-
},
|
|
45
|
-
textGroup: {
|
|
46
|
-
flexDirection: 'row',
|
|
47
|
-
borderRadius: cx(4),
|
|
48
|
-
backgroundColor: '#f6f6f6',
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
},
|
|
51
|
-
textParent: {
|
|
52
|
-
flex: 1,
|
|
53
|
-
height: cx(44),
|
|
54
|
-
justifyContent: 'center',
|
|
55
|
-
},
|
|
56
|
-
text: {
|
|
57
|
-
marginStart: cx(16),
|
|
58
|
-
marginEnd: cx(6),
|
|
59
|
-
fontSize: cx(16),
|
|
60
|
-
color: '#000',
|
|
61
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
62
|
-
},
|
|
63
|
-
line: {
|
|
64
|
-
height: 1,
|
|
65
|
-
position: 'absolute',
|
|
66
|
-
start: cx(4),
|
|
67
|
-
end: cx(4),
|
|
68
|
-
bottom: 0,
|
|
69
|
-
backgroundColor: '#cbcbcb',
|
|
70
|
-
},
|
|
71
|
-
tipParent: {
|
|
72
|
-
flexDirection: 'row',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
},
|
|
75
|
-
tipIcon: {
|
|
76
|
-
width: cx(16),
|
|
77
|
-
height: cx(16),
|
|
78
|
-
marginStart: cx(4),
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
84
|
|
|
82
|
-
export default TextFieldStyleButton
|
|
85
|
+
export default withTheme(TextFieldStyleButton)
|
|
@@ -4,12 +4,14 @@ import {Picker, Utils} from 'tuya-panel-kit'
|
|
|
4
4
|
import _ from 'lodash'
|
|
5
5
|
|
|
6
6
|
const {convertX} = Utils.RatioUtils
|
|
7
|
+
const { withTheme } = Utils.ThemeUtils
|
|
7
8
|
|
|
8
9
|
const pickerTheme = {
|
|
9
10
|
fontSize: 20,
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
interface LdvPickerViewProps {
|
|
14
|
+
theme?: any
|
|
13
15
|
hour: string,
|
|
14
16
|
minute: string,
|
|
15
17
|
setHour: (string) => void,
|
|
@@ -25,6 +27,28 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
25
27
|
const {hour, minute, unit, setHour, setMinute, minutesStep = 1, maxHour = 24} = props
|
|
26
28
|
const hours = useMemo(() => _.times(maxHour, (n) => _.padStart(n.toString(), 2, '0')), [])
|
|
27
29
|
const minutes = useMemo(() => _.times(60 / minutesStep, (n) => _.padStart((n * minutesStep).toString(), 2, '0')) , [props.minutesStep])
|
|
30
|
+
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
pickerContainer: {
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
},
|
|
36
|
+
picker: {
|
|
37
|
+
flex: 1,
|
|
38
|
+
backgroundColor: props.theme.card.background,
|
|
39
|
+
},
|
|
40
|
+
pickerLeft: {},
|
|
41
|
+
pickerItem: {},
|
|
42
|
+
picContainer: {
|
|
43
|
+
flex: 1,
|
|
44
|
+
position: 'relative',
|
|
45
|
+
},
|
|
46
|
+
pickerUnit: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
right: convertX(20),
|
|
49
|
+
top: '44%',
|
|
50
|
+
},
|
|
51
|
+
})
|
|
28
52
|
return (
|
|
29
53
|
<View style={[styles.pickerContainer, props.style]}>
|
|
30
54
|
<View style={styles.picContainer}>
|
|
@@ -42,7 +66,7 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
42
66
|
))}
|
|
43
67
|
</Picker>
|
|
44
68
|
{unit ? <View style={styles.pickerUnit}>
|
|
45
|
-
<Text style={{color:
|
|
69
|
+
<Text style={{color: props.theme.global.fontColor, fontSize: convertX(18)}}>
|
|
46
70
|
{unit[0]}
|
|
47
71
|
</Text>
|
|
48
72
|
</View> : null}
|
|
@@ -61,7 +85,7 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
61
85
|
))}
|
|
62
86
|
</Picker>
|
|
63
87
|
{unit ? <View style={styles.pickerUnit}>
|
|
64
|
-
<Text style={{color:
|
|
88
|
+
<Text style={{color: props.theme.global.fontColor, fontSize: convertX(18)}}>
|
|
65
89
|
{unit[1]}
|
|
66
90
|
</Text>
|
|
67
91
|
</View> : null}
|
|
@@ -70,25 +94,4 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
70
94
|
)
|
|
71
95
|
}
|
|
72
96
|
|
|
73
|
-
|
|
74
|
-
pickerContainer: {
|
|
75
|
-
flexDirection: 'row',
|
|
76
|
-
alignItems: 'center',
|
|
77
|
-
},
|
|
78
|
-
picker: {
|
|
79
|
-
flex: 1,
|
|
80
|
-
},
|
|
81
|
-
pickerLeft: {},
|
|
82
|
-
pickerItem: {},
|
|
83
|
-
picContainer: {
|
|
84
|
-
flex: 1,
|
|
85
|
-
position: 'relative',
|
|
86
|
-
},
|
|
87
|
-
pickerUnit: {
|
|
88
|
-
position: 'absolute',
|
|
89
|
-
right: convertX(20),
|
|
90
|
-
top: '44%',
|
|
91
|
-
},
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
export default LdvPickerView
|
|
97
|
+
export default withTheme(LdvPickerView)
|
|
@@ -4,8 +4,10 @@ import {SwitchButton, Utils} from 'tuya-panel-kit'
|
|
|
4
4
|
import Spacer from './Spacer'
|
|
5
5
|
|
|
6
6
|
const {convertX: cx} = Utils.RatioUtils
|
|
7
|
+
const { withTheme } = Utils.ThemeUtils
|
|
7
8
|
|
|
8
9
|
interface Prop {
|
|
10
|
+
theme?: any
|
|
9
11
|
title: string
|
|
10
12
|
color: string
|
|
11
13
|
colorAlpha: number
|
|
@@ -18,7 +20,7 @@ const LdvSwitch = (props: Prop) => {
|
|
|
18
20
|
const {title, color, colorAlpha, enable, setEnable, showSwitch = true} = props
|
|
19
21
|
return (
|
|
20
22
|
<View style={styles.titleBGView}>
|
|
21
|
-
<Text style={styles.title}>{title}</Text>
|
|
23
|
+
<Text style={{...styles.title, color: props.theme.global.fontColor}}>{title}</Text>
|
|
22
24
|
<View style={[styles.colorBlock, {backgroundColor: color, opacity: colorAlpha}]}/>
|
|
23
25
|
<Spacer style={{flex: 1}} height={0} width={0}/>
|
|
24
26
|
{showSwitch && <SwitchButton value={enable} onValueChange={setEnable}/>}
|
|
@@ -39,7 +41,6 @@ const styles = StyleSheet.create({
|
|
|
39
41
|
borderRadius: cx(4),
|
|
40
42
|
},
|
|
41
43
|
title: {
|
|
42
|
-
color: '#000',
|
|
43
44
|
fontSize: cx(16),
|
|
44
45
|
// fontFamily: 'helvetica_neue_lt_std_bd',
|
|
45
46
|
fontWeight: 'bold',
|
|
@@ -48,4 +49,4 @@ const styles = StyleSheet.create({
|
|
|
48
49
|
},
|
|
49
50
|
})
|
|
50
51
|
|
|
51
|
-
export default LdvSwitch
|
|
52
|
+
export default withTheme(LdvSwitch)
|
|
@@ -5,8 +5,10 @@ import {IconFont, Utils} from 'tuya-panel-kit'
|
|
|
5
5
|
const backIcon = Platform.OS === 'ios' ? 'backIos' : 'backAndroid'
|
|
6
6
|
|
|
7
7
|
const cx = Utils.RatioUtils.convertX
|
|
8
|
+
const { withTheme } = Utils.ThemeUtils
|
|
8
9
|
|
|
9
10
|
interface TopBarProps {
|
|
11
|
+
theme?: any
|
|
10
12
|
title: string
|
|
11
13
|
onBackPress: () => void
|
|
12
14
|
rightButtonIcon?: any | {}
|
|
@@ -35,13 +37,13 @@ const LDVTopBar = (props: TopBarProps) => {
|
|
|
35
37
|
alignItems: 'center',
|
|
36
38
|
flex: 1,
|
|
37
39
|
}}>
|
|
38
|
-
<IconFont size={cx(16)} color={
|
|
40
|
+
<IconFont size={cx(16)} color={props.theme.global.brand} name={backIcon}/>
|
|
39
41
|
<View style={{width: cx(10)}}/>
|
|
40
42
|
<Text
|
|
41
43
|
numberOfLines={1}
|
|
42
44
|
style={{
|
|
43
45
|
maxWidth: cx(290),
|
|
44
|
-
color:
|
|
46
|
+
color: props.theme.global.brand,
|
|
45
47
|
fontSize: cx(16),
|
|
46
48
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
47
49
|
}}>{props.title}</Text>
|
|
@@ -71,4 +73,4 @@ const LDVTopBar = (props: TopBarProps) => {
|
|
|
71
73
|
)
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
export default LDVTopBar
|
|
76
|
+
export default withTheme(LDVTopBar)
|