@ledvance/base 1.2.83 → 1.2.84
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/.babelrc +31 -31
- package/.eslintignore +5 -5
- package/.eslintrc.js +27 -27
- package/.prettierrc.js +1 -1
- package/.versionrc +5 -5
- package/localazy.json +848 -848
- package/localazy.keys.json +4 -4
- package/package.json +74 -74
- package/rn-cli.config.js +8 -8
- package/src/api/native.d.ts +71 -71
- package/src/api/native.ts +423 -423
- package/src/api/nativeEventEmitter.d.ts +3 -3
- package/src/api/nativeEventEmitter.ts +125 -125
- package/src/components/AdvanceCard.d.ts +25 -25
- package/src/components/AdvanceCard.tsx +117 -117
- package/src/components/AdvanceList.d.ts +9 -9
- package/src/components/AdvanceList.tsx +69 -69
- package/src/components/ApplyForDeviceItem.d.ts +6 -6
- package/src/components/ApplyForDeviceItem.tsx +83 -83
- package/src/components/ApplyForDeviceList.d.ts +7 -7
- package/src/components/ApplyForDeviceList.tsx +61 -61
- package/src/components/ApplyForText.d.ts +6 -6
- package/src/components/ApplyForText.tsx +52 -52
- package/src/components/Card.d.ts +10 -10
- package/src/components/Card.tsx +40 -40
- package/src/components/Cell.d.ts +21 -21
- package/src/components/Cell.tsx +69 -69
- package/src/components/CircularProgress.d.ts +8 -8
- package/src/components/CircularProgress.tsx +42 -42
- package/src/components/ColorAdjustView.d.ts +12 -12
- package/src/components/ColorAdjustView.tsx +64 -64
- package/src/components/ColorExtractor.d.ts +73 -73
- package/src/components/ColorExtractor.tsx +374 -374
- package/src/components/ColorTempAdjustView.d.ts +13 -13
- package/src/components/ColorTempAdjustView.tsx +57 -57
- package/src/components/ColorsLine.d.ts +7 -7
- package/src/components/ColorsLine.tsx +47 -47
- package/src/components/CustomListDialog.d.ts +15 -15
- package/src/components/CustomListDialog.tsx +66 -66
- package/src/components/DeleteButton.d.ts +10 -10
- package/src/components/DeleteButton.tsx +40 -40
- package/src/components/Dialog.d.ts +10 -10
- package/src/components/Dialog.tsx +38 -38
- package/src/components/DrawToolView.d.ts +46 -46
- package/src/components/DrawToolView.tsx +262 -262
- package/src/components/FanAdjustView.d.ts +23 -23
- package/src/components/FanAdjustView.tsx +141 -141
- package/src/components/InfoText.d.ts +11 -11
- package/src/components/InfoText.tsx +45 -45
- package/src/components/LampAdjustView.d.ts +10 -10
- package/src/components/LampAdjustView.tsx +75 -75
- package/src/components/LampAdjustView2.d.ts +24 -24
- package/src/components/LampAdjustView2.tsx +104 -104
- package/src/components/LinearGradientLine.d.ts +9 -9
- package/src/components/LinearGradientLine.tsx +63 -63
- package/src/components/LoadingView.tsx +39 -39
- package/src/components/MoodColorsLine.d.ts +9 -9
- package/src/components/MoodColorsLine.tsx +38 -38
- package/src/components/Page.d.ts +21 -21
- package/src/components/Page.tsx +104 -104
- package/src/components/Popup.d.ts +7 -7
- package/src/components/Popup.tsx +71 -71
- package/src/components/Segmented.d.ts +14 -14
- package/src/components/Segmented.tsx +76 -76
- package/src/components/ShowSelect.d.ts +1 -1
- package/src/components/ShowSelect.tsx +158 -158
- package/src/components/SocketItem.d.ts +13 -13
- package/src/components/SocketItem.tsx +87 -87
- package/src/components/Spacer.d.ts +7 -7
- package/src/components/Spacer.tsx +13 -13
- package/src/components/Stepper.d.ts +19 -19
- package/src/components/Stepper.tsx +130 -130
- package/src/components/StripAdjustView.d.ts +16 -16
- package/src/components/StripAdjustView.tsx +129 -129
- package/src/components/StripLightView.d.ts +14 -14
- package/src/components/StripLightView.tsx +24 -24
- package/src/components/Summary.tsx +116 -116
- package/src/components/Tag.d.ts +8 -8
- package/src/components/Tag.tsx +56 -56
- package/src/components/TextButton.d.ts +9 -9
- package/src/components/TextButton.tsx +31 -31
- package/src/components/TextField.d.ts +9 -9
- package/src/components/TextField.tsx +92 -92
- package/src/components/TextFieldStyleButton.d.ts +8 -8
- package/src/components/TextFieldStyleButton.tsx +85 -85
- package/src/components/UATabTitle.d.ts +6 -6
- package/src/components/UATabTitle.tsx +31 -31
- package/src/components/UATabs.d.ts +12 -12
- package/src/components/UATabs.tsx +77 -77
- package/src/components/connect.d.ts +10 -10
- package/src/components/connect.tsx +20 -20
- package/src/components/ldvColorBrightness.d.ts +1 -1
- package/src/components/ldvColorBrightness.tsx +18 -18
- package/src/components/ldvColorSlider.d.ts +14 -14
- package/src/components/ldvColorSlider.tsx +131 -131
- package/src/components/ldvItemView.d.ts +12 -12
- package/src/components/ldvItemView.tsx +43 -43
- package/src/components/ldvPickerView.d.ts +13 -13
- package/src/components/ldvPickerView.tsx +97 -97
- package/src/components/ldvPresetView.d.ts +2 -2
- package/src/components/ldvPresetView.tsx +86 -86
- package/src/components/ldvSaturation.d.ts +2 -2
- package/src/components/ldvSaturation.tsx +22 -22
- package/src/components/ldvSlider.d.ts +15 -15
- package/src/components/ldvSlider.tsx +103 -103
- package/src/components/ldvSwitch.d.ts +10 -10
- package/src/components/ldvSwitch.tsx +52 -52
- package/src/components/ldvTemperatureSlider.d.ts +13 -13
- package/src/components/ldvTemperatureSlider.tsx +139 -139
- package/src/components/ldvTopBar.d.ts +10 -10
- package/src/components/ldvTopBar.tsx +76 -76
- package/src/components/ldvTopName.d.ts +9 -9
- package/src/components/ldvTopName.tsx +63 -63
- package/src/components/segmentControl.d.ts +1 -1
- package/src/components/segmentControl.tsx +65 -65
- package/src/components/weekSelect.d.ts +7 -7
- package/src/components/weekSelect.tsx +98 -98
- package/src/composeLayout.d.ts +30 -30
- package/src/composeLayout.tsx +261 -261
- package/src/config/dark-theme.ts +61 -61
- package/src/config/light-theme.ts +61 -61
- package/src/hooks/Hooks.d.ts +2 -2
- package/src/hooks/Hooks.ts +8 -8
- package/src/i18n/index.d.ts +16 -16
- package/src/i18n/index.ts +37 -37
- package/src/i18n/strings.d.ts +15953 -15953
- package/src/i18n/strings.ts +23723 -23723
- package/src/main.tsx +9 -9
- package/src/models/GlobalParams.d.ts +14 -14
- package/src/models/GlobalParams.ts +14 -14
- package/src/models/TuyaApi.d.ts +29 -29
- package/src/models/TuyaApi.ts +92 -92
- package/src/models/combine.d.ts +26 -26
- package/src/models/combine.ts +17 -17
- package/src/models/configureStore.d.ts +9 -9
- package/src/models/configureStore.ts +33 -33
- package/src/models/index.d.ts +31 -31
- package/src/models/index.ts +22 -22
- package/src/models/modules/NativePropsSlice.d.ts +61 -61
- package/src/models/modules/NativePropsSlice.tsx +467 -467
- package/src/models/modules/Result.d.ts +14 -14
- package/src/models/modules/Result.ts +15 -15
- package/src/models/modules/common.d.ts +44 -44
- package/src/models/modules/common.ts +161 -161
- package/src/res/index.d.ts +70 -70
- package/src/res/index.ts +73 -73
- package/src/utils/ColorParser.d.ts +66 -66
- package/src/utils/ColorParser.ts +189 -189
- package/src/utils/ColorUtils.d.ts +71 -71
- package/src/utils/ColorUtils.tsx +448 -448
- package/src/utils/Support.d.ts +13 -13
- package/src/utils/Support.ts +108 -108
- package/src/utils/TypeUtils.d.ts +3 -3
- package/src/utils/cctUtils.d.ts +1 -1
- package/src/utils/cctUtils.ts +110 -110
- package/src/utils/common.d.ts +35 -35
- package/src/utils/common.ts +379 -379
- package/src/utils/index.d.ts +26 -26
- package/src/utils/index.ts +191 -191
- package/src/utils/interface.d.ts +6 -6
- package/src/utils/interface.ts +50 -50
- package/src/utils/loopsCompare.d.ts +1 -1
- package/src/utils/loopsCompare.ts +62 -62
- package/tsconfig.json +50 -50
- package/update-localazy.py +52 -52
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import React, {useEffect} from 'react'
|
|
2
|
-
import {StyleProp, StyleSheet, Text, TextProps, View, ViewStyle} from 'react-native'
|
|
3
|
-
import {LinearGradient, Slider, Utils} from 'tuya-panel-kit'
|
|
4
|
-
import {Rect} from 'react-native-svg'
|
|
5
|
-
import {useReactive} from 'ahooks'
|
|
6
|
-
|
|
7
|
-
const cx = Utils.RatioUtils.convertX
|
|
8
|
-
|
|
9
|
-
const temperatures = {
|
|
10
|
-
'0%': 'rgb(254, 172, 90)',
|
|
11
|
-
'22%': 'rgb(249, 209, 164)',
|
|
12
|
-
'41%': 'rgb(254, 244, 223)',
|
|
13
|
-
'60%': 'rgb(252, 250, 242)',
|
|
14
|
-
'80%': 'rgb(226, 235, 248)',
|
|
15
|
-
'100%': 'rgb(194, 217, 254)',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface LdvTemperatureSliderProps {
|
|
19
|
-
title: string
|
|
20
|
-
onSlidingComplete: (number) => void
|
|
21
|
-
thumbColor: string
|
|
22
|
-
value: number
|
|
23
|
-
width?: number | undefined
|
|
24
|
-
style?: StyleProp<ViewStyle> | undefined
|
|
25
|
-
titleStyle?: StyleProp<TextProps> | undefined
|
|
26
|
-
subTitleStr?: string | undefined
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const LdvTemperatureSlider = (props: LdvTemperatureSliderProps) => {
|
|
30
|
-
const {title, onSlidingComplete, thumbColor, value, titleStyle} = props
|
|
31
|
-
let dataSource = temperatures
|
|
32
|
-
let max = 100
|
|
33
|
-
let min = 0
|
|
34
|
-
const width = props.width || (Utils.RatioUtils.width - cx(80))
|
|
35
|
-
|
|
36
|
-
const state = useReactive({
|
|
37
|
-
value: value,
|
|
38
|
-
})
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
state.value = value
|
|
41
|
-
}, [value])
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<View style={[styles.container, props.style]}>
|
|
45
|
-
<View style={styles.titleBg}>
|
|
46
|
-
<Text style={[styles.title, titleStyle]}>
|
|
47
|
-
{title}
|
|
48
|
-
</Text>
|
|
49
|
-
</View>
|
|
50
|
-
<Slider.Horizontal
|
|
51
|
-
style={{...styles.shadeSlider, width}}
|
|
52
|
-
styles={{track: styles.sliderTrack, thumb: {...styles.shadeThumb, backgroundColor: thumbColor}}}
|
|
53
|
-
maximumValue={max}
|
|
54
|
-
minimumValue={min}
|
|
55
|
-
value={value}
|
|
56
|
-
stepValue={1}
|
|
57
|
-
canTouchTrack={true}
|
|
58
|
-
theme={{
|
|
59
|
-
trackRadius: cx(15),
|
|
60
|
-
}}
|
|
61
|
-
onlyMaximumTrack={true}
|
|
62
|
-
renderMaximumTrack={() => {
|
|
63
|
-
return (
|
|
64
|
-
<View style={{flex: 1, borderRadius: cx(15)}}>
|
|
65
|
-
<LinearGradient
|
|
66
|
-
style={{...styles.sliderLinearGradient, width}}
|
|
67
|
-
x1="0%"
|
|
68
|
-
y1="0%"
|
|
69
|
-
x2="100%"
|
|
70
|
-
y2="0%"
|
|
71
|
-
stops={dataSource}>
|
|
72
|
-
<Rect {...styles.sliderLinearGradient} width={width}/>
|
|
73
|
-
</LinearGradient>
|
|
74
|
-
</View>
|
|
75
|
-
)
|
|
76
|
-
}}
|
|
77
|
-
onValueChange={(value) => {
|
|
78
|
-
state.value = value
|
|
79
|
-
}}
|
|
80
|
-
onSlidingComplete={onSlidingComplete}
|
|
81
|
-
/>
|
|
82
|
-
</View>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const styles = StyleSheet.create({
|
|
87
|
-
container: {
|
|
88
|
-
height: cx(57),
|
|
89
|
-
flexDirection: 'column',
|
|
90
|
-
paddingHorizontal: cx(16),
|
|
91
|
-
},
|
|
92
|
-
titleBg: {
|
|
93
|
-
flexDirection: 'row',
|
|
94
|
-
justifyContent: 'space-between',
|
|
95
|
-
},
|
|
96
|
-
valueText: {
|
|
97
|
-
marginTop: cx(10),
|
|
98
|
-
fontSize: cx(14),
|
|
99
|
-
color: '#000',
|
|
100
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
101
|
-
},
|
|
102
|
-
title: {
|
|
103
|
-
marginTop: cx(4),
|
|
104
|
-
fontSize: cx(14),
|
|
105
|
-
color: '#000',
|
|
106
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
107
|
-
},
|
|
108
|
-
shadeSlider: {
|
|
109
|
-
marginTop: cx(8),
|
|
110
|
-
height: cx(28),
|
|
111
|
-
justifyContent: 'center',
|
|
112
|
-
},
|
|
113
|
-
sliderTrack: {
|
|
114
|
-
marginTop: cx(9),
|
|
115
|
-
marginBottom: cx(9),
|
|
116
|
-
flex: 1,
|
|
117
|
-
borderRadius: cx(15),
|
|
118
|
-
},
|
|
119
|
-
shadeThumb: {
|
|
120
|
-
backgroundColor: 'rgb(0, 249, 255)',
|
|
121
|
-
width: cx(28),
|
|
122
|
-
height: cx(28),
|
|
123
|
-
borderRadius: cx(14),
|
|
124
|
-
borderColor: 'white',
|
|
125
|
-
borderWidth: 1,
|
|
126
|
-
shadowColor: '#000000',
|
|
127
|
-
shadowOpacity: 0.2,
|
|
128
|
-
shadowRadius: cx(8),
|
|
129
|
-
elevation: cx(8),
|
|
130
|
-
shadowOffset: {
|
|
131
|
-
width: 0,
|
|
132
|
-
height: cx(4),
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
sliderLinearGradient: {
|
|
136
|
-
height: cx(12),
|
|
137
|
-
},
|
|
138
|
-
})
|
|
139
|
-
|
|
1
|
+
import React, {useEffect} from 'react'
|
|
2
|
+
import {StyleProp, StyleSheet, Text, TextProps, View, ViewStyle} from 'react-native'
|
|
3
|
+
import {LinearGradient, Slider, Utils} from 'tuya-panel-kit'
|
|
4
|
+
import {Rect} from 'react-native-svg'
|
|
5
|
+
import {useReactive} from 'ahooks'
|
|
6
|
+
|
|
7
|
+
const cx = Utils.RatioUtils.convertX
|
|
8
|
+
|
|
9
|
+
const temperatures = {
|
|
10
|
+
'0%': 'rgb(254, 172, 90)',
|
|
11
|
+
'22%': 'rgb(249, 209, 164)',
|
|
12
|
+
'41%': 'rgb(254, 244, 223)',
|
|
13
|
+
'60%': 'rgb(252, 250, 242)',
|
|
14
|
+
'80%': 'rgb(226, 235, 248)',
|
|
15
|
+
'100%': 'rgb(194, 217, 254)',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface LdvTemperatureSliderProps {
|
|
19
|
+
title: string
|
|
20
|
+
onSlidingComplete: (number) => void
|
|
21
|
+
thumbColor: string
|
|
22
|
+
value: number
|
|
23
|
+
width?: number | undefined
|
|
24
|
+
style?: StyleProp<ViewStyle> | undefined
|
|
25
|
+
titleStyle?: StyleProp<TextProps> | undefined
|
|
26
|
+
subTitleStr?: string | undefined
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const LdvTemperatureSlider = (props: LdvTemperatureSliderProps) => {
|
|
30
|
+
const {title, onSlidingComplete, thumbColor, value, titleStyle} = props
|
|
31
|
+
let dataSource = temperatures
|
|
32
|
+
let max = 100
|
|
33
|
+
let min = 0
|
|
34
|
+
const width = props.width || (Utils.RatioUtils.width - cx(80))
|
|
35
|
+
|
|
36
|
+
const state = useReactive({
|
|
37
|
+
value: value,
|
|
38
|
+
})
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
state.value = value
|
|
41
|
+
}, [value])
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<View style={[styles.container, props.style]}>
|
|
45
|
+
<View style={styles.titleBg}>
|
|
46
|
+
<Text style={[styles.title, titleStyle]}>
|
|
47
|
+
{title}
|
|
48
|
+
</Text>
|
|
49
|
+
</View>
|
|
50
|
+
<Slider.Horizontal
|
|
51
|
+
style={{...styles.shadeSlider, width}}
|
|
52
|
+
styles={{track: styles.sliderTrack, thumb: {...styles.shadeThumb, backgroundColor: thumbColor}}}
|
|
53
|
+
maximumValue={max}
|
|
54
|
+
minimumValue={min}
|
|
55
|
+
value={value}
|
|
56
|
+
stepValue={1}
|
|
57
|
+
canTouchTrack={true}
|
|
58
|
+
theme={{
|
|
59
|
+
trackRadius: cx(15),
|
|
60
|
+
}}
|
|
61
|
+
onlyMaximumTrack={true}
|
|
62
|
+
renderMaximumTrack={() => {
|
|
63
|
+
return (
|
|
64
|
+
<View style={{flex: 1, borderRadius: cx(15)}}>
|
|
65
|
+
<LinearGradient
|
|
66
|
+
style={{...styles.sliderLinearGradient, width}}
|
|
67
|
+
x1="0%"
|
|
68
|
+
y1="0%"
|
|
69
|
+
x2="100%"
|
|
70
|
+
y2="0%"
|
|
71
|
+
stops={dataSource}>
|
|
72
|
+
<Rect {...styles.sliderLinearGradient} width={width}/>
|
|
73
|
+
</LinearGradient>
|
|
74
|
+
</View>
|
|
75
|
+
)
|
|
76
|
+
}}
|
|
77
|
+
onValueChange={(value) => {
|
|
78
|
+
state.value = value
|
|
79
|
+
}}
|
|
80
|
+
onSlidingComplete={onSlidingComplete}
|
|
81
|
+
/>
|
|
82
|
+
</View>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const styles = StyleSheet.create({
|
|
87
|
+
container: {
|
|
88
|
+
height: cx(57),
|
|
89
|
+
flexDirection: 'column',
|
|
90
|
+
paddingHorizontal: cx(16),
|
|
91
|
+
},
|
|
92
|
+
titleBg: {
|
|
93
|
+
flexDirection: 'row',
|
|
94
|
+
justifyContent: 'space-between',
|
|
95
|
+
},
|
|
96
|
+
valueText: {
|
|
97
|
+
marginTop: cx(10),
|
|
98
|
+
fontSize: cx(14),
|
|
99
|
+
color: '#000',
|
|
100
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
101
|
+
},
|
|
102
|
+
title: {
|
|
103
|
+
marginTop: cx(4),
|
|
104
|
+
fontSize: cx(14),
|
|
105
|
+
color: '#000',
|
|
106
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
107
|
+
},
|
|
108
|
+
shadeSlider: {
|
|
109
|
+
marginTop: cx(8),
|
|
110
|
+
height: cx(28),
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
},
|
|
113
|
+
sliderTrack: {
|
|
114
|
+
marginTop: cx(9),
|
|
115
|
+
marginBottom: cx(9),
|
|
116
|
+
flex: 1,
|
|
117
|
+
borderRadius: cx(15),
|
|
118
|
+
},
|
|
119
|
+
shadeThumb: {
|
|
120
|
+
backgroundColor: 'rgb(0, 249, 255)',
|
|
121
|
+
width: cx(28),
|
|
122
|
+
height: cx(28),
|
|
123
|
+
borderRadius: cx(14),
|
|
124
|
+
borderColor: 'white',
|
|
125
|
+
borderWidth: 1,
|
|
126
|
+
shadowColor: '#000000',
|
|
127
|
+
shadowOpacity: 0.2,
|
|
128
|
+
shadowRadius: cx(8),
|
|
129
|
+
elevation: cx(8),
|
|
130
|
+
shadowOffset: {
|
|
131
|
+
width: 0,
|
|
132
|
+
height: cx(4),
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
sliderLinearGradient: {
|
|
136
|
+
height: cx(12),
|
|
137
|
+
},
|
|
138
|
+
})
|
|
139
|
+
|
|
140
140
|
export default LdvTemperatureSlider
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
interface TopBarProps {
|
|
2
|
-
title: string;
|
|
3
|
-
onBackPress: () => void;
|
|
4
|
-
rightButtonIcon?: any | {};
|
|
5
|
-
rightButtonStyle?: any | undefined;
|
|
6
|
-
rightButtonDisabled?: boolean;
|
|
7
|
-
onRightButtonPress?: (() => void) | undefined;
|
|
8
|
-
}
|
|
9
|
-
declare const LDVTopBar: (props: TopBarProps) => JSX.Element;
|
|
10
|
-
export default LDVTopBar;
|
|
1
|
+
interface TopBarProps {
|
|
2
|
+
title: string;
|
|
3
|
+
onBackPress: () => void;
|
|
4
|
+
rightButtonIcon?: any | {};
|
|
5
|
+
rightButtonStyle?: any | undefined;
|
|
6
|
+
rightButtonDisabled?: boolean;
|
|
7
|
+
onRightButtonPress?: (() => void) | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare const LDVTopBar: (props: TopBarProps) => JSX.Element;
|
|
10
|
+
export default LDVTopBar;
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {Image, Platform, Text, TouchableOpacity, View} from 'react-native'
|
|
3
|
-
import {IconFont, Utils} from 'tuya-panel-kit'
|
|
4
|
-
|
|
5
|
-
const backIcon = Platform.OS === 'ios' ? 'backIos' : 'backAndroid'
|
|
6
|
-
|
|
7
|
-
const cx = Utils.RatioUtils.convertX
|
|
8
|
-
const { withTheme } = Utils.ThemeUtils
|
|
9
|
-
|
|
10
|
-
interface TopBarProps {
|
|
11
|
-
theme?: any
|
|
12
|
-
title: string
|
|
13
|
-
onBackPress: () => void
|
|
14
|
-
rightButtonIcon?: any | {}
|
|
15
|
-
rightButtonStyle?: any | undefined
|
|
16
|
-
rightButtonDisabled?: boolean
|
|
17
|
-
onRightButtonPress?: (() => void) | undefined
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const LDVTopBar = (props: TopBarProps) => {
|
|
21
|
-
const icon = typeof props.rightButtonIcon === 'string' ? {uri: props.rightButtonIcon} : props.rightButtonIcon
|
|
22
|
-
return (
|
|
23
|
-
<View
|
|
24
|
-
style={{
|
|
25
|
-
flexDirection: 'row',
|
|
26
|
-
height: cx(46),
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
marginTop: Platform.OS === 'ios' ? Utils.RatioUtils.statusBarHeight : 0,
|
|
29
|
-
justifyContent: 'space-between',
|
|
30
|
-
}}>
|
|
31
|
-
<TouchableOpacity onPress={props.onBackPress} style={{flex: 1, maxWidth: cx(290)}} >
|
|
32
|
-
<View
|
|
33
|
-
style={{
|
|
34
|
-
flexDirection: 'row',
|
|
35
|
-
height: cx(46),
|
|
36
|
-
marginHorizontal: cx(20),
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
flex: 1,
|
|
39
|
-
}}>
|
|
40
|
-
<IconFont size={cx(16)} color={props.theme.global.brand} name={backIcon}/>
|
|
41
|
-
<View style={{width: cx(10)}}/>
|
|
42
|
-
<Text
|
|
43
|
-
numberOfLines={1}
|
|
44
|
-
style={{
|
|
45
|
-
maxWidth: cx(290),
|
|
46
|
-
color: props.theme.global.brand,
|
|
47
|
-
fontSize: cx(16),
|
|
48
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
49
|
-
}}>{props.title}</Text>
|
|
50
|
-
</View>
|
|
51
|
-
</TouchableOpacity>
|
|
52
|
-
{!!props.rightButtonIcon &&
|
|
53
|
-
<TouchableOpacity
|
|
54
|
-
style={{
|
|
55
|
-
width: cx(44),
|
|
56
|
-
height: cx(44),
|
|
57
|
-
marginRight: cx(10)
|
|
58
|
-
}}
|
|
59
|
-
onPress={props.onRightButtonPress}
|
|
60
|
-
disabled={props.rightButtonDisabled}>
|
|
61
|
-
<Image
|
|
62
|
-
style={[
|
|
63
|
-
{
|
|
64
|
-
width: cx(44),
|
|
65
|
-
height: cx(44),
|
|
66
|
-
},
|
|
67
|
-
props.rightButtonStyle,
|
|
68
|
-
]}
|
|
69
|
-
source={icon}/>
|
|
70
|
-
</TouchableOpacity>
|
|
71
|
-
}
|
|
72
|
-
</View>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default withTheme(LDVTopBar)
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Image, Platform, Text, TouchableOpacity, View} from 'react-native'
|
|
3
|
+
import {IconFont, Utils} from 'tuya-panel-kit'
|
|
4
|
+
|
|
5
|
+
const backIcon = Platform.OS === 'ios' ? 'backIos' : 'backAndroid'
|
|
6
|
+
|
|
7
|
+
const cx = Utils.RatioUtils.convertX
|
|
8
|
+
const { withTheme } = Utils.ThemeUtils
|
|
9
|
+
|
|
10
|
+
interface TopBarProps {
|
|
11
|
+
theme?: any
|
|
12
|
+
title: string
|
|
13
|
+
onBackPress: () => void
|
|
14
|
+
rightButtonIcon?: any | {}
|
|
15
|
+
rightButtonStyle?: any | undefined
|
|
16
|
+
rightButtonDisabled?: boolean
|
|
17
|
+
onRightButtonPress?: (() => void) | undefined
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const LDVTopBar = (props: TopBarProps) => {
|
|
21
|
+
const icon = typeof props.rightButtonIcon === 'string' ? {uri: props.rightButtonIcon} : props.rightButtonIcon
|
|
22
|
+
return (
|
|
23
|
+
<View
|
|
24
|
+
style={{
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
height: cx(46),
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
marginTop: Platform.OS === 'ios' ? Utils.RatioUtils.statusBarHeight : 0,
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
}}>
|
|
31
|
+
<TouchableOpacity onPress={props.onBackPress} style={{flex: 1, maxWidth: cx(290)}} >
|
|
32
|
+
<View
|
|
33
|
+
style={{
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
height: cx(46),
|
|
36
|
+
marginHorizontal: cx(20),
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
flex: 1,
|
|
39
|
+
}}>
|
|
40
|
+
<IconFont size={cx(16)} color={props.theme.global.brand} name={backIcon}/>
|
|
41
|
+
<View style={{width: cx(10)}}/>
|
|
42
|
+
<Text
|
|
43
|
+
numberOfLines={1}
|
|
44
|
+
style={{
|
|
45
|
+
maxWidth: cx(290),
|
|
46
|
+
color: props.theme.global.brand,
|
|
47
|
+
fontSize: cx(16),
|
|
48
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
49
|
+
}}>{props.title}</Text>
|
|
50
|
+
</View>
|
|
51
|
+
</TouchableOpacity>
|
|
52
|
+
{!!props.rightButtonIcon &&
|
|
53
|
+
<TouchableOpacity
|
|
54
|
+
style={{
|
|
55
|
+
width: cx(44),
|
|
56
|
+
height: cx(44),
|
|
57
|
+
marginRight: cx(10)
|
|
58
|
+
}}
|
|
59
|
+
onPress={props.onRightButtonPress}
|
|
60
|
+
disabled={props.rightButtonDisabled}>
|
|
61
|
+
<Image
|
|
62
|
+
style={[
|
|
63
|
+
{
|
|
64
|
+
width: cx(44),
|
|
65
|
+
height: cx(44),
|
|
66
|
+
},
|
|
67
|
+
props.rightButtonStyle,
|
|
68
|
+
]}
|
|
69
|
+
source={icon}/>
|
|
70
|
+
</TouchableOpacity>
|
|
71
|
+
}
|
|
72
|
+
</View>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default withTheme(LDVTopBar)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
interface LdvTopNameProps {
|
|
2
|
-
title: string;
|
|
3
|
-
rightIcon?: string | undefined | number;
|
|
4
|
-
rightIconClick?: () => void;
|
|
5
|
-
showGreenery?: boolean;
|
|
6
|
-
greeneryIcon?: string | undefined | number;
|
|
7
|
-
}
|
|
8
|
-
declare const LdvTopName: (props: LdvTopNameProps) => JSX.Element;
|
|
9
|
-
export default LdvTopName;
|
|
1
|
+
interface LdvTopNameProps {
|
|
2
|
+
title: string;
|
|
3
|
+
rightIcon?: string | undefined | number;
|
|
4
|
+
rightIconClick?: () => void;
|
|
5
|
+
showGreenery?: boolean;
|
|
6
|
+
greeneryIcon?: string | undefined | number;
|
|
7
|
+
}
|
|
8
|
+
declare const LdvTopName: (props: LdvTopNameProps) => JSX.Element;
|
|
9
|
+
export default LdvTopName;
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native'
|
|
3
|
-
import {Utils} from 'tuya-panel-kit'
|
|
4
|
-
|
|
5
|
-
const cx = Utils.RatioUtils.convertX
|
|
6
|
-
const { withTheme } = Utils.ThemeUtils
|
|
7
|
-
|
|
8
|
-
interface LdvTopNameProps {
|
|
9
|
-
theme?: any
|
|
10
|
-
title: string,
|
|
11
|
-
rightIcon?: string | undefined | number,
|
|
12
|
-
rightIconClick?: () => void
|
|
13
|
-
showGreenery?: boolean
|
|
14
|
-
greeneryIcon?: string | undefined | number
|
|
15
|
-
headlineContent?: React.ReactNode
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const LdvTopName = (props: LdvTopNameProps) => {
|
|
19
|
-
const rightIcon = typeof props.rightIcon === 'number' ? props.rightIcon : {uri: props.rightIcon}
|
|
20
|
-
const greeneryIcon = typeof props.greeneryIcon === 'number' ? props.greeneryIcon : {uri: props.greeneryIcon}
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create({
|
|
23
|
-
container: {
|
|
24
|
-
marginHorizontal: cx(24),
|
|
25
|
-
marginBottom: cx(12),
|
|
26
|
-
},
|
|
27
|
-
title: {
|
|
28
|
-
color: props.theme.global.brand,
|
|
29
|
-
fontSize: cx(24),
|
|
30
|
-
},
|
|
31
|
-
})
|
|
32
|
-
return (
|
|
33
|
-
<View style={styles.container}>
|
|
34
|
-
<View
|
|
35
|
-
style={{
|
|
36
|
-
flexDirection: 'row',
|
|
37
|
-
justifyContent: 'space-between',
|
|
38
|
-
alignItems: 'center',
|
|
39
|
-
marginTop: cx(38),
|
|
40
|
-
}}>
|
|
41
|
-
<View style={{flexDirection: 'row', flex: 1}}>
|
|
42
|
-
<Text style={styles.title}>
|
|
43
|
-
{props.title}
|
|
44
|
-
</Text>
|
|
45
|
-
{props.showGreenery && <Image
|
|
46
|
-
source={greeneryIcon}
|
|
47
|
-
resizeMode="contain"
|
|
48
|
-
style={{height: cx(16), width: cx(16), left: 0}}
|
|
49
|
-
/> || null}
|
|
50
|
-
</View>
|
|
51
|
-
{props.rightIcon && <TouchableOpacity
|
|
52
|
-
onPress={props.rightIconClick}>
|
|
53
|
-
<Image
|
|
54
|
-
style={{width: cx(24), height: cx(24), tintColor: props.theme.global.brand}}
|
|
55
|
-
source={rightIcon}/>
|
|
56
|
-
</TouchableOpacity>}
|
|
57
|
-
{props.headlineContent && props.headlineContent}
|
|
58
|
-
</View>
|
|
59
|
-
</View>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export default withTheme(LdvTopName)
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native'
|
|
3
|
+
import {Utils} from 'tuya-panel-kit'
|
|
4
|
+
|
|
5
|
+
const cx = Utils.RatioUtils.convertX
|
|
6
|
+
const { withTheme } = Utils.ThemeUtils
|
|
7
|
+
|
|
8
|
+
interface LdvTopNameProps {
|
|
9
|
+
theme?: any
|
|
10
|
+
title: string,
|
|
11
|
+
rightIcon?: string | undefined | number,
|
|
12
|
+
rightIconClick?: () => void
|
|
13
|
+
showGreenery?: boolean
|
|
14
|
+
greeneryIcon?: string | undefined | number
|
|
15
|
+
headlineContent?: React.ReactNode
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const LdvTopName = (props: LdvTopNameProps) => {
|
|
19
|
+
const rightIcon = typeof props.rightIcon === 'number' ? props.rightIcon : {uri: props.rightIcon}
|
|
20
|
+
const greeneryIcon = typeof props.greeneryIcon === 'number' ? props.greeneryIcon : {uri: props.greeneryIcon}
|
|
21
|
+
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
container: {
|
|
24
|
+
marginHorizontal: cx(24),
|
|
25
|
+
marginBottom: cx(12),
|
|
26
|
+
},
|
|
27
|
+
title: {
|
|
28
|
+
color: props.theme.global.brand,
|
|
29
|
+
fontSize: cx(24),
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
return (
|
|
33
|
+
<View style={styles.container}>
|
|
34
|
+
<View
|
|
35
|
+
style={{
|
|
36
|
+
flexDirection: 'row',
|
|
37
|
+
justifyContent: 'space-between',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
marginTop: cx(38),
|
|
40
|
+
}}>
|
|
41
|
+
<View style={{flexDirection: 'row', flex: 1}}>
|
|
42
|
+
<Text style={styles.title}>
|
|
43
|
+
{props.title}
|
|
44
|
+
</Text>
|
|
45
|
+
{props.showGreenery && <Image
|
|
46
|
+
source={greeneryIcon}
|
|
47
|
+
resizeMode="contain"
|
|
48
|
+
style={{height: cx(16), width: cx(16), left: 0}}
|
|
49
|
+
/> || null}
|
|
50
|
+
</View>
|
|
51
|
+
{props.rightIcon && <TouchableOpacity
|
|
52
|
+
onPress={props.rightIconClick}>
|
|
53
|
+
<Image
|
|
54
|
+
style={{width: cx(24), height: cx(24), tintColor: props.theme.global.brand}}
|
|
55
|
+
source={rightIcon}/>
|
|
56
|
+
</TouchableOpacity>}
|
|
57
|
+
{props.headlineContent && props.headlineContent}
|
|
58
|
+
</View>
|
|
59
|
+
</View>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default withTheme(LdvTopName)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function SegmentControl(props: any): JSX.Element;
|
|
1
|
+
export default function SegmentControl(props: any): JSX.Element;
|