@ledvance/base 1.3.4 → 1.3.6
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.keys.json +4 -3
- package/package.json +1 -1
- package/src/components/DrawToolView.tsx +136 -132
- package/src/components/FanAdjustView.tsx +22 -20
- package/src/components/Popup.tsx +7 -10
- package/src/components/Segmented.tsx +36 -35
- package/src/components/Stepper.tsx +40 -32
- package/src/components/StripAdjustView.tsx +68 -66
- package/src/components/StripLightView.tsx +6 -2
- package/src/components/Summary.tsx +64 -61
- package/src/components/TextFieldStyleButton.tsx +1 -0
- package/src/components/UATabTitle.tsx +14 -9
- package/src/components/UATabs.tsx +32 -29
- package/src/components/ldvPickerView.tsx +2 -1
- package/src/config/dark-theme.ts +22 -0
- package/src/config/light-theme.ts +22 -0
- package/src/i18n/strings.ts +22056 -22056
|
@@ -8,8 +8,10 @@ import { Utils } from "tuya-panel-kit";
|
|
|
8
8
|
const { add, subtract, inMaxMin } = Utils.NumberUtils
|
|
9
9
|
|
|
10
10
|
const { convertX: cx } = Utils.RatioUtils
|
|
11
|
+
const { withTheme } = Utils.ThemeUtils
|
|
11
12
|
|
|
12
13
|
export interface StepperProps {
|
|
14
|
+
theme?: any
|
|
13
15
|
value: number | string
|
|
14
16
|
stepValue?: number // 1
|
|
15
17
|
min?: number // 0
|
|
@@ -70,13 +72,48 @@ const Stepper = (props: StepperProps) => {
|
|
|
70
72
|
|
|
71
73
|
}, [])
|
|
72
74
|
|
|
75
|
+
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
stepperContainer: {
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
backgroundColor: props.theme.container.background,
|
|
81
|
+
padding: cx(2),
|
|
82
|
+
borderRadius: cx(12),
|
|
83
|
+
width: cx(150),
|
|
84
|
+
},
|
|
85
|
+
stepperButton: {
|
|
86
|
+
width: cx(52),
|
|
87
|
+
height: cx(28),
|
|
88
|
+
backgroundColor: props.theme.global.background,
|
|
89
|
+
borderRadius: cx(10),
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
justifyContent: 'center',
|
|
92
|
+
},
|
|
93
|
+
stepperIcon: {
|
|
94
|
+
width: cx(20),
|
|
95
|
+
height: cx(20),
|
|
96
|
+
tintColor: props.theme.global.fontColor
|
|
97
|
+
},
|
|
98
|
+
stepperInput: {
|
|
99
|
+
width: cx(42),
|
|
100
|
+
height: cx(22),
|
|
101
|
+
color: props.theme.global.secondFontColor,
|
|
102
|
+
fontSize: cx(16),
|
|
103
|
+
padding: 0,
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
textAlign: 'center',
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
|
|
73
110
|
return (
|
|
74
111
|
<View style={[styles.stepperContainer, props.style]}>
|
|
75
112
|
<TouchableOpacity
|
|
76
113
|
style={[styles.stepperButton, props.buttonStyle]}
|
|
77
114
|
onPress={() => handlePress(false)}
|
|
78
115
|
>
|
|
79
|
-
<Image
|
|
116
|
+
<Image style={styles.stepperIcon} source={res.ic_minus} />
|
|
80
117
|
</TouchableOpacity>
|
|
81
118
|
<TextInput
|
|
82
119
|
style={[styles.stepperInput, props.inputStyle]}
|
|
@@ -92,39 +129,10 @@ const Stepper = (props: StepperProps) => {
|
|
|
92
129
|
style={[styles.stepperButton, props.buttonStyle]}
|
|
93
130
|
onPress={() => handlePress(true)}
|
|
94
131
|
>
|
|
95
|
-
<Image style={
|
|
132
|
+
<Image style={styles.stepperIcon} source={res.ic_plus} />
|
|
96
133
|
</TouchableOpacity>
|
|
97
134
|
</View>
|
|
98
135
|
)
|
|
99
136
|
}
|
|
100
137
|
|
|
101
|
-
|
|
102
|
-
stepperContainer: {
|
|
103
|
-
flexDirection: 'row',
|
|
104
|
-
alignItems: 'center',
|
|
105
|
-
backgroundColor: '#f5f5f5',
|
|
106
|
-
padding: cx(2),
|
|
107
|
-
borderRadius: cx(12),
|
|
108
|
-
width: cx(150),
|
|
109
|
-
},
|
|
110
|
-
stepperButton: {
|
|
111
|
-
width: cx(52),
|
|
112
|
-
height: cx(28),
|
|
113
|
-
backgroundColor: '#fff',
|
|
114
|
-
borderRadius: cx(10),
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
justifyContent: 'center',
|
|
117
|
-
},
|
|
118
|
-
stepperInput: {
|
|
119
|
-
width: cx(42),
|
|
120
|
-
height: cx(22),
|
|
121
|
-
color: '#333',
|
|
122
|
-
fontSize: cx(16),
|
|
123
|
-
padding: 0,
|
|
124
|
-
alignItems: 'center',
|
|
125
|
-
justifyContent: 'center',
|
|
126
|
-
textAlign: 'center',
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
export default memo(Stepper)
|
|
138
|
+
export default memo(withTheme(Stepper))
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlatList, TouchableOpacity, View, Image } from "react-native";
|
|
3
|
-
import ColorAdjustView, { ColorAdjustViewProps } from "
|
|
4
|
-
import ColorTempAdjustView, { ColorTempAdjustViewProps } from "
|
|
5
|
-
import Spacer from "
|
|
3
|
+
import ColorAdjustView, { ColorAdjustViewProps } from "./ColorAdjustView";
|
|
4
|
+
import ColorTempAdjustView, { ColorTempAdjustViewProps } from "./ColorTempAdjustView";
|
|
5
|
+
import Spacer from "./Spacer";
|
|
6
6
|
import { TabBar, Utils } from "tuya-panel-kit";
|
|
7
7
|
import { ColorDisk } from "@tuya/tuya-panel-lamp-sdk";
|
|
8
|
-
import res from "
|
|
8
|
+
import res from "../res";
|
|
9
9
|
const { convertX: cx } = Utils.RatioUtils
|
|
10
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
11
|
|
|
11
12
|
type TabsNode = {
|
|
12
13
|
key: number | string
|
|
@@ -26,83 +27,84 @@ const StripAdjustView = (props: StripAdjustViewProps) => {
|
|
|
26
27
|
<TabBar
|
|
27
28
|
type='radio'
|
|
28
29
|
tabs={props.lampTabs}
|
|
29
|
-
style={{ borderRadius: cx(8), backgroundColor:
|
|
30
|
-
tabTextStyle={{ color:
|
|
31
|
-
tabActiveTextStyle={{ color:
|
|
30
|
+
style={{ borderRadius: cx(8), backgroundColor: props.theme.segment.background, height: cx(40), marginHorizontal: cx(16) }}
|
|
31
|
+
tabTextStyle={{ color: props.theme.segment.fontColor }}
|
|
32
|
+
tabActiveTextStyle={{ color: props.theme.segment.fontColor, fontWeight: 'bold' }}
|
|
33
|
+
activeColor={props.theme.segment.active}
|
|
32
34
|
activeKey={props.activeKey}
|
|
33
35
|
onChange={props.onActiveKeyChange}
|
|
34
36
|
/>
|
|
35
37
|
{
|
|
36
38
|
props.activeKey === 1 &&
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
<>
|
|
40
|
+
<Spacer height={cx(10)} />
|
|
41
|
+
<ColorAdjustView
|
|
42
|
+
h={props.h}
|
|
43
|
+
s={props.s}
|
|
44
|
+
v={props.v}
|
|
45
|
+
minSaturation={1}
|
|
46
|
+
reserveSV={true}
|
|
47
|
+
onHSVChange={props.onHSVChange}
|
|
48
|
+
onHSVChangeComplete={props.onHSVChangeComplete} />
|
|
49
|
+
<Spacer />
|
|
50
|
+
</>
|
|
49
51
|
}
|
|
50
52
|
{
|
|
51
53
|
props.activeKey === 0 &&
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
<>
|
|
55
|
+
<Spacer height={cx(10)} />
|
|
56
|
+
<ColorTempAdjustView
|
|
57
|
+
minBrightness={1}
|
|
58
|
+
isSupportTemperature={props.isSupportTemperature}
|
|
59
|
+
isSupportBrightness={props.isSupportBrightness}
|
|
60
|
+
colorTemp={props.colorTemp}
|
|
61
|
+
brightness={props.brightness}
|
|
62
|
+
onCCTChange={props.onCCTChange}
|
|
63
|
+
onCCTChangeComplete={props.onCCTChangeComplete}
|
|
64
|
+
onBrightnessChange={props.onBrightnessChange}
|
|
65
|
+
onBrightnessChangeComplete={props.onBrightnessChangeComplete} />
|
|
66
|
+
<Spacer />
|
|
67
|
+
</>
|
|
66
68
|
}
|
|
67
69
|
{
|
|
68
70
|
props.activeKey === 3 &&
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
71
|
+
<FlatList
|
|
72
|
+
numColumns={6}
|
|
73
|
+
style={{
|
|
74
|
+
marginHorizontal: cx(16),
|
|
75
|
+
}}
|
|
76
|
+
data={ColorList}
|
|
77
|
+
renderItem={({ item, index }) => {
|
|
78
|
+
return (
|
|
79
|
+
<TouchableOpacity
|
|
80
|
+
onPress={() => {
|
|
81
|
+
props.onColorDiskChange && props.onColorDiskChange(item, index)
|
|
82
|
+
}}
|
|
83
|
+
style={{
|
|
84
|
+
width: '16.66%', alignItems: 'center',
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
}}>
|
|
87
|
+
<ColorDisk
|
|
88
|
+
radius={cx(20)}
|
|
89
|
+
colors={item}
|
|
90
|
+
/>
|
|
91
|
+
{props.colorDiskActiveKey === index && <View style={{ width: cx(44), height: cx(44), borderRadius: cx(44), borderColor: props.theme.button.primary, borderWidth: cx(2), alignItems: 'center', justifyContent: 'center', position: 'absolute' }}>
|
|
92
|
+
<Image source={{ uri: res.ic_check }} style={{ width: cx(40), height: cx(40), tintColor: props.theme.button.fontColor }} />
|
|
93
|
+
</View>}
|
|
94
|
+
</TouchableOpacity>
|
|
95
|
+
)
|
|
96
|
+
}}
|
|
97
|
+
ListHeaderComponent={() => <Spacer height={cx(10)} />}
|
|
98
|
+
ItemSeparatorComponent={() => <Spacer height={cx(10)} />}
|
|
99
|
+
ListFooterComponent={() => <Spacer height={cx(10)} />}
|
|
100
|
+
keyExtractor={(_, idx) => idx.toString()}
|
|
101
|
+
/>
|
|
100
102
|
}
|
|
101
103
|
</View>
|
|
102
104
|
)
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
export default StripAdjustView
|
|
107
|
+
export default withTheme(StripAdjustView)
|
|
106
108
|
|
|
107
109
|
export const ColorList = [
|
|
108
110
|
['#F4A4BF', '#F65997','#F5075A','#F52071'],
|
|
@@ -127,4 +129,4 @@ export const ColorList = [
|
|
|
127
129
|
['#76BC41','#95D35F','#B2DD8D','#D9EC39','#E8F291'],
|
|
128
130
|
['#52D6FB','#F9B241','#F66B05','#D356FC','#9A2ABD'],
|
|
129
131
|
['#F9AEC7','#F88ABA','#F65590','#F65C79','#F64A49', '#F50803'],
|
|
130
|
-
]
|
|
132
|
+
]
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { requireNativeComponent, ViewProps } from 'react-native'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { Utils } from 'tuya-panel-kit'
|
|
3
4
|
|
|
5
|
+
const { withTheme } = Utils.ThemeUtils
|
|
4
6
|
const NativeStripLightView = requireNativeComponent('StripLightView')
|
|
5
7
|
|
|
6
8
|
export interface LightNode {
|
|
@@ -9,6 +11,7 @@ export interface LightNode {
|
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface StripLightViewProps extends ViewProps {
|
|
14
|
+
theme?: any
|
|
12
15
|
nodes: LightNode[]
|
|
13
16
|
fixCount: number
|
|
14
17
|
stripStyle: 'ONLY_LINE' | 'WITH_BEAD'
|
|
@@ -17,9 +20,10 @@ export interface StripLightViewProps extends ViewProps {
|
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
const StripLightView = (props: StripLightViewProps) => {
|
|
23
|
+
const newNodes = props.nodes.map(node => ({...node, backgroundColor: props.theme.card.background}))
|
|
20
24
|
return (
|
|
21
|
-
<NativeStripLightView {...props} nodes={JSON.stringify(
|
|
25
|
+
<NativeStripLightView {...props} nodes={JSON.stringify(newNodes)}/>
|
|
22
26
|
)
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
export default StripLightView
|
|
29
|
+
export default withTheme(StripLightView)
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React, { ReactElement, memo } from "react";
|
|
2
2
|
import { Text, ViewStyle, View, StyleSheet } from 'react-native'
|
|
3
|
-
import res from "
|
|
4
|
-
import I18n from "
|
|
3
|
+
import res from "../res"
|
|
4
|
+
import I18n from "../i18n";
|
|
5
5
|
import { Utils } from "tuya-panel-kit";
|
|
6
|
-
import Spacer from "
|
|
7
|
-
import InfoText from "
|
|
6
|
+
import Spacer from "../components/Spacer";
|
|
7
|
+
import InfoText from "../components/InfoText";
|
|
8
8
|
|
|
9
9
|
const { convertX: cx } = Utils.RatioUtils;
|
|
10
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
11
|
|
|
11
12
|
interface SummaryProps {
|
|
13
|
+
theme?: any
|
|
12
14
|
style?: ViewStyle
|
|
13
15
|
frequency?: string | ReactElement
|
|
14
16
|
time?: string | ReactElement
|
|
@@ -17,6 +19,53 @@ interface SummaryProps {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
const Summary = (props: SummaryProps) => {
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
cardContainer: {
|
|
25
|
+
marginHorizontal: cx(24),
|
|
26
|
+
},
|
|
27
|
+
itemTitle: {
|
|
28
|
+
color: props.theme.global.fontColor,
|
|
29
|
+
fontSize: cx(16),
|
|
30
|
+
fontWeight: 'bold',
|
|
31
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
32
|
+
},
|
|
33
|
+
summaryContainer: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
marginBottom: cx(10),
|
|
37
|
+
},
|
|
38
|
+
summaryLeft: {
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
minWidth: cx(100)
|
|
42
|
+
},
|
|
43
|
+
summaryImg: {
|
|
44
|
+
tintColor: props.theme.global.fontColor,
|
|
45
|
+
width: cx(12),
|
|
46
|
+
height: cx(12),
|
|
47
|
+
marginRight: cx(6)
|
|
48
|
+
},
|
|
49
|
+
leftTitle: {
|
|
50
|
+
fontSize: cx(14),
|
|
51
|
+
color: props.theme.global.fontColor
|
|
52
|
+
},
|
|
53
|
+
summaryRight: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
flexDirection: 'column',
|
|
56
|
+
marginLeft: cx(15),
|
|
57
|
+
marginTop: cx(5)
|
|
58
|
+
},
|
|
59
|
+
rightWrap: {
|
|
60
|
+
borderRadius: cx(16),
|
|
61
|
+
paddingHorizontal: cx(12),
|
|
62
|
+
alignSelf: 'flex-start',
|
|
63
|
+
backgroundColor: props.theme.tag.background,
|
|
64
|
+
},
|
|
65
|
+
rightItem: {
|
|
66
|
+
color: props.theme.tag.fontColor,
|
|
67
|
+
},
|
|
68
|
+
})
|
|
20
69
|
return (
|
|
21
70
|
<View style={styles.cardContainer}>
|
|
22
71
|
<Text style={styles.itemTitle}>{I18n.getLang('add_sleepschedule_one_source_subheadline4_text')}</Text>
|
|
@@ -51,66 +100,20 @@ const Summary = (props: SummaryProps) => {
|
|
|
51
100
|
</View>
|
|
52
101
|
</View>
|
|
53
102
|
{!props.hideActions && <View style={[styles.summaryContainer, { alignItems: 'flex-start' }]}>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
103
|
+
<InfoText
|
|
104
|
+
icon={res.summary_icon3}
|
|
105
|
+
text={I18n.getLang('motion_detection_add_time_schedule_actions_text1')}
|
|
106
|
+
iconStyle={styles.summaryImg}
|
|
107
|
+
textStyle={styles.leftTitle}
|
|
108
|
+
style={styles.summaryLeft}
|
|
109
|
+
/>
|
|
110
|
+
<View style={styles.summaryRight}>
|
|
111
|
+
{props.actions}
|
|
112
|
+
</View>
|
|
64
113
|
</View>}
|
|
65
114
|
</View>
|
|
66
115
|
</View>
|
|
67
116
|
)
|
|
68
117
|
}
|
|
69
118
|
|
|
70
|
-
|
|
71
|
-
cardContainer: {
|
|
72
|
-
marginHorizontal: cx(24),
|
|
73
|
-
},
|
|
74
|
-
itemTitle: {
|
|
75
|
-
color: '#000',
|
|
76
|
-
fontSize: cx(16),
|
|
77
|
-
fontWeight: 'bold',
|
|
78
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
79
|
-
},
|
|
80
|
-
summaryContainer: {
|
|
81
|
-
flex: 1,
|
|
82
|
-
flexDirection: 'row',
|
|
83
|
-
marginBottom: cx(10),
|
|
84
|
-
},
|
|
85
|
-
summaryLeft: {
|
|
86
|
-
flexDirection: 'row',
|
|
87
|
-
alignItems: 'center',
|
|
88
|
-
minWidth: cx(100)
|
|
89
|
-
},
|
|
90
|
-
summaryImg: {
|
|
91
|
-
width: cx(12),
|
|
92
|
-
height: cx(12),
|
|
93
|
-
marginRight: cx(6)
|
|
94
|
-
},
|
|
95
|
-
leftTitle: {
|
|
96
|
-
fontSize: cx(14),
|
|
97
|
-
color: '#000'
|
|
98
|
-
},
|
|
99
|
-
summaryRight: {
|
|
100
|
-
flex: 1,
|
|
101
|
-
flexDirection: 'column',
|
|
102
|
-
marginLeft: cx(15),
|
|
103
|
-
marginTop: cx(5)
|
|
104
|
-
},
|
|
105
|
-
rightWrap: {
|
|
106
|
-
borderRadius: cx(16),
|
|
107
|
-
paddingHorizontal: cx(12),
|
|
108
|
-
alignSelf: 'flex-start',
|
|
109
|
-
backgroundColor: '#cbcbcb',
|
|
110
|
-
},
|
|
111
|
-
rightItem: {
|
|
112
|
-
color: '#000',
|
|
113
|
-
},
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
export default memo(Summary)
|
|
119
|
+
export default memo(withTheme(Summary))
|
|
@@ -5,28 +5,33 @@ import { Utils } from 'tuya-panel-kit'
|
|
|
5
5
|
import res from '../res/index'
|
|
6
6
|
|
|
7
7
|
const cx = Utils.RatioUtils.convertX
|
|
8
|
+
const { withTheme } = Utils.ThemeUtils
|
|
8
9
|
|
|
9
10
|
export interface UATabTitleProps extends ViewProps {
|
|
11
|
+
theme?: any
|
|
10
12
|
text: string
|
|
11
13
|
onIconClick: () => void
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
const UATabTitle = (props: UATabTitleProps) => {
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
tabsTitle: {
|
|
19
|
+
color: props.theme.global.fontColor,
|
|
20
|
+
fontSize: cx(14),
|
|
21
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
15
25
|
return (
|
|
16
26
|
<View style={[{ flex: 1, flexDirection: 'row', alignItems: 'center' }, props.style]}>
|
|
17
27
|
<Text style={styles.tabsTitle}>{props.text}</Text>
|
|
18
28
|
<Spacer height={cx(0)} width={cx(4)}/>
|
|
19
29
|
<TouchableOpacity onPress={props.onIconClick}>
|
|
20
|
-
<Image style={{ width: cx(16), height: cx(16), tintColor:
|
|
30
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.icon.primary }} source={res.ic_info}/>
|
|
21
31
|
</TouchableOpacity>
|
|
22
32
|
</View>
|
|
23
33
|
)
|
|
24
34
|
}
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
color: '#000',
|
|
29
|
-
fontSize: cx(14),
|
|
30
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
31
|
-
},
|
|
32
|
-
})
|
|
36
|
+
export default withTheme(UATabTitle)
|
|
37
|
+
|
|
@@ -3,8 +3,10 @@ import { StyleSheet, Text, TouchableOpacity, View, ViewProps } from 'react-nativ
|
|
|
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
|
export interface UATabsProps extends ViewProps {
|
|
9
|
+
theme?: any
|
|
8
10
|
active: any
|
|
9
11
|
data: UATabData[]
|
|
10
12
|
onSelectChange: (value: UATabData, index: number) => void
|
|
@@ -16,6 +18,33 @@ export interface UATabData {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const UATabs = (props: UATabsProps) => {
|
|
21
|
+
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
flex: 1,
|
|
25
|
+
height: cx(32),
|
|
26
|
+
paddingVertical: cx(2),
|
|
27
|
+
paddingHorizontal: cx(3),
|
|
28
|
+
backgroundColor: props.theme.segment.background,
|
|
29
|
+
borderRadius: cx(9),
|
|
30
|
+
},
|
|
31
|
+
tabs: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
overflow: 'hidden',
|
|
35
|
+
borderRadius: cx(7),
|
|
36
|
+
},
|
|
37
|
+
tab: {
|
|
38
|
+
flex: 1,
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
},
|
|
42
|
+
tabText: {
|
|
43
|
+
fontSize: cx(14),
|
|
44
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
|
|
19
48
|
return (
|
|
20
49
|
<View style={[styles.root, props.style]}>
|
|
21
50
|
<View style={styles.tabs}>
|
|
@@ -32,13 +61,13 @@ const UATabs = (props: UATabsProps) => {
|
|
|
32
61
|
<View style={[
|
|
33
62
|
styles.tab,
|
|
34
63
|
{
|
|
35
|
-
backgroundColor: active ?
|
|
64
|
+
backgroundColor: active ? props.theme.button.primary : props.theme.container.background,
|
|
36
65
|
},
|
|
37
66
|
]}>
|
|
38
67
|
<Text style={[
|
|
39
68
|
styles.tabText,
|
|
40
69
|
{
|
|
41
|
-
color: active ?
|
|
70
|
+
color: active ? props.theme.button.fontColor : props.theme.global.secondFontColor,
|
|
42
71
|
},
|
|
43
72
|
]}>{item.title}</Text>
|
|
44
73
|
</View>
|
|
@@ -49,30 +78,4 @@ const UATabs = (props: UATabsProps) => {
|
|
|
49
78
|
)
|
|
50
79
|
}
|
|
51
80
|
|
|
52
|
-
|
|
53
|
-
root: {
|
|
54
|
-
flex: 1,
|
|
55
|
-
height: cx(32),
|
|
56
|
-
paddingVertical: cx(2),
|
|
57
|
-
paddingHorizontal: cx(3),
|
|
58
|
-
backgroundColor: '#f6f6f6',
|
|
59
|
-
borderRadius: cx(9),
|
|
60
|
-
},
|
|
61
|
-
tabs: {
|
|
62
|
-
flex: 1,
|
|
63
|
-
flexDirection: 'row',
|
|
64
|
-
overflow: 'hidden',
|
|
65
|
-
borderRadius: cx(7),
|
|
66
|
-
},
|
|
67
|
-
tab: {
|
|
68
|
-
flex: 1,
|
|
69
|
-
justifyContent: 'center',
|
|
70
|
-
alignItems: 'center',
|
|
71
|
-
},
|
|
72
|
-
tabText: {
|
|
73
|
-
fontSize: cx(14),
|
|
74
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
75
|
-
},
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
export default UATabs
|
|
81
|
+
export default withTheme(UATabs)
|
package/src/config/dark-theme.ts
CHANGED
|
@@ -79,4 +79,26 @@ export default {
|
|
|
79
79
|
placeholder: "#fff", // 占位符字体颜色
|
|
80
80
|
},
|
|
81
81
|
},
|
|
82
|
+
/**
|
|
83
|
+
* Popup 弹出层变量
|
|
84
|
+
*/
|
|
85
|
+
popup: {
|
|
86
|
+
cellHeight: 48, // 列表项的高度
|
|
87
|
+
cellBg: "#2a2a2a", // 列表底色
|
|
88
|
+
titleRadius: cx(8), // 头部圆角
|
|
89
|
+
footerRadius: 0, // 底部圆角
|
|
90
|
+
titleBg: "#2a2a2a",
|
|
91
|
+
bottomBg: "#2a2a2a", // 底部栏底色
|
|
92
|
+
lineColor: "#e5e5e5", // 分隔线颜色
|
|
93
|
+
tintColor: '#f60',
|
|
94
|
+
titleFontSize: 14, // 头部栏标题大小
|
|
95
|
+
titleFontColor: "#fff", // 头部栏标题颜色
|
|
96
|
+
cancelFontSize: 16, // 底部栏取消字体大小
|
|
97
|
+
cancelFontColor: "#cccccc", // 底部栏取消字体颜色
|
|
98
|
+
confirmFontSize: 16, // 底部栏确认字体大小
|
|
99
|
+
confirmFontColor: "#f60", // 底部栏确认字体颜色
|
|
100
|
+
list: {
|
|
101
|
+
cellFontColor: '#fff',
|
|
102
|
+
}
|
|
103
|
+
},
|
|
82
104
|
}
|
|
@@ -79,4 +79,26 @@ export default {
|
|
|
79
79
|
placeholder: "#d6d6de", // 占位符字体颜色
|
|
80
80
|
},
|
|
81
81
|
},
|
|
82
|
+
/**
|
|
83
|
+
* Popup 弹出层变量
|
|
84
|
+
*/
|
|
85
|
+
popup: {
|
|
86
|
+
cellHeight: 48, // 列表项的高度
|
|
87
|
+
cellBg: "#2a2a2a", // 列表底色
|
|
88
|
+
titleRadius: cx(8), // 头部圆角
|
|
89
|
+
footerRadius: 0, // 底部圆角
|
|
90
|
+
titleBg: "#fff",
|
|
91
|
+
bottomBg: "#fff", // 底部栏底色
|
|
92
|
+
lineColor: "#e5e5e5", // 分隔线颜色
|
|
93
|
+
tintColor: '#f60',
|
|
94
|
+
titleFontSize: 14, // 头部栏标题大小
|
|
95
|
+
titleFontColor: "#333", // 头部栏标题颜色
|
|
96
|
+
cancelFontSize: 16, // 底部栏取消字体大小
|
|
97
|
+
cancelFontColor: "#666", // 底部栏取消字体颜色
|
|
98
|
+
confirmFontSize: 16, // 底部栏确认字体大小
|
|
99
|
+
confirmFontColor: "#f60", // 底部栏确认字体颜色
|
|
100
|
+
list: {
|
|
101
|
+
cellFontColor: '#333',
|
|
102
|
+
}
|
|
103
|
+
},
|
|
82
104
|
}
|