@ledvance/base 1.3.8 → 1.3.10
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 +13 -1
- package/package.json +1 -1
- package/src/components/AdvanceCard.tsx +4 -3
- package/src/components/AdvanceList.tsx +3 -3
- package/src/components/ApplyForDeviceItem.tsx +23 -8
- package/src/components/ApplyForDeviceList.tsx +4 -3
- package/src/components/ApplyForText.tsx +4 -3
- package/src/components/BatteryStateView.tsx +3 -3
- package/src/components/Card.tsx +4 -3
- package/src/components/ColorTempAdjustView.tsx +2 -1
- package/src/components/CustomListDialog.tsx +4 -3
- package/src/components/DeleteButton.tsx +4 -3
- package/src/components/DrawToolView.tsx +13 -12
- package/src/components/FanAdjustView.tsx +16 -15
- package/src/components/InfoText.tsx +3 -2
- package/src/components/Page.tsx +3 -2
- package/src/components/Popup.tsx +4 -3
- package/src/components/Segmented.tsx +7 -6
- package/src/components/SocketItem.tsx +4 -3
- package/src/components/Stepper.tsx +7 -6
- package/src/components/StripAdjustView.tsx +6 -6
- package/src/components/StripLightView.tsx +3 -2
- package/src/components/Summary.tsx +7 -6
- package/src/components/Tag.tsx +6 -5
- package/src/components/TextField.tsx +7 -6
- package/src/components/TextFieldStyleButton.tsx +7 -6
- package/src/components/UATabTitle.tsx +4 -3
- package/src/components/UATabs.tsx +5 -4
- package/src/components/ldvColorSlider.tsx +3 -2
- package/src/components/ldvPickerView.tsx +5 -4
- package/src/components/ldvSlider.tsx +4 -3
- package/src/components/ldvSwitch.tsx +6 -6
- package/src/components/ldvTopBar.tsx +4 -3
- package/src/components/ldvTopName.tsx +5 -4
- package/src/components/segmentControl.tsx +7 -7
- package/src/components/weekSelect.tsx +3 -3
- package/src/i18n/strings.ts +420 -72
- package/translateKey.txt +12 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, {ReactNode} from 'react'
|
|
2
2
|
import {StyleSheet, Text, TouchableOpacity, View, ViewStyle} from 'react-native'
|
|
3
3
|
import {Utils} from 'tuya-panel-kit'
|
|
4
|
+
import ThemeType from '../config/themeType'
|
|
4
5
|
|
|
5
6
|
const {convertX: cx} = Utils.RatioUtils
|
|
6
7
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -11,7 +12,7 @@ interface SegmentedItem {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
interface SegmentedProps {
|
|
14
|
-
theme?:
|
|
15
|
+
theme?: ThemeType
|
|
15
16
|
value?: string | number
|
|
16
17
|
options?: SegmentedItem[]
|
|
17
18
|
onChange?: (v: string | number) => void
|
|
@@ -23,7 +24,7 @@ const Segmented = (props: SegmentedProps) => {
|
|
|
23
24
|
wrap_container: {
|
|
24
25
|
flexDirection: 'row',
|
|
25
26
|
height: cx(42),
|
|
26
|
-
backgroundColor: props.theme
|
|
27
|
+
backgroundColor: props.theme?.segment.background,
|
|
27
28
|
padding: cx(2),
|
|
28
29
|
borderRadius: cx(8),
|
|
29
30
|
},
|
|
@@ -31,7 +32,7 @@ const Segmented = (props: SegmentedProps) => {
|
|
|
31
32
|
flex: 1,
|
|
32
33
|
alignItems: 'center',
|
|
33
34
|
justifyContent: 'center',
|
|
34
|
-
backgroundColor: props.theme
|
|
35
|
+
backgroundColor: props.theme?.container.background,
|
|
35
36
|
},
|
|
36
37
|
segmented_item_first: {
|
|
37
38
|
borderBottomLeftRadius: cx(8),
|
|
@@ -42,14 +43,14 @@ const Segmented = (props: SegmentedProps) => {
|
|
|
42
43
|
borderTopRightRadius: cx(8),
|
|
43
44
|
},
|
|
44
45
|
segmented_item_check: {
|
|
45
|
-
backgroundColor: props.theme
|
|
46
|
+
backgroundColor: props.theme?.button.primary,
|
|
46
47
|
},
|
|
47
48
|
segmented_text: {
|
|
48
49
|
fontSize: cx(16),
|
|
49
|
-
color: props.theme
|
|
50
|
+
color: props.theme?.global.secondFontColor,
|
|
50
51
|
},
|
|
51
52
|
segmented_text_check: {
|
|
52
|
-
color: props.theme
|
|
53
|
+
color: props.theme?.button.fontColor,
|
|
53
54
|
},
|
|
54
55
|
})
|
|
55
56
|
return (
|
|
@@ -4,12 +4,13 @@ import Card from "components/Card";
|
|
|
4
4
|
import Spacer from "components/Spacer";
|
|
5
5
|
import { Dialog, SwitchButton, Utils } from "tuya-panel-kit";
|
|
6
6
|
import I18n from "../i18n";
|
|
7
|
+
import ThemeType from '../config/themeType'
|
|
7
8
|
|
|
8
9
|
const cx = Utils.RatioUtils.convertX
|
|
9
10
|
const { withTheme } = Utils.ThemeUtils
|
|
10
11
|
|
|
11
12
|
interface SocketItemProps extends PropsWithChildren<ViewProps>{
|
|
12
|
-
theme?:
|
|
13
|
+
theme?: ThemeType
|
|
13
14
|
title: string
|
|
14
15
|
name: string
|
|
15
16
|
icon: any
|
|
@@ -29,7 +30,7 @@ function SocketItem(props: SocketItemProps) {
|
|
|
29
30
|
},
|
|
30
31
|
title: {
|
|
31
32
|
fontSize: cx(16),
|
|
32
|
-
color: props.theme
|
|
33
|
+
color: props.theme?.global.fontColor,
|
|
33
34
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
34
35
|
fontWeight: 'bold',
|
|
35
36
|
},
|
|
@@ -43,7 +44,7 @@ function SocketItem(props: SocketItemProps) {
|
|
|
43
44
|
},
|
|
44
45
|
name: {
|
|
45
46
|
fontSize: cx(14),
|
|
46
|
-
color: props.theme
|
|
47
|
+
color: props.theme?.global.fontColor,
|
|
47
48
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
48
49
|
},
|
|
49
50
|
})
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { exchangeNumber, localeNumber } from "
|
|
1
|
+
import { exchangeNumber, localeNumber } from "../utils/common";
|
|
2
2
|
import res from "@res";
|
|
3
3
|
import { useReactive } from "ahooks";
|
|
4
4
|
import React, { memo, useCallback } from "react";
|
|
5
5
|
import { TouchableOpacity, View, Image, TextInput, StyleSheet, StyleProp, ViewStyle } from "react-native";
|
|
6
6
|
import { Utils } from "tuya-panel-kit";
|
|
7
|
+
import ThemeType from '../config/themeType'
|
|
7
8
|
|
|
8
9
|
const { add, subtract, inMaxMin } = Utils.NumberUtils
|
|
9
10
|
|
|
@@ -11,7 +12,7 @@ const { convertX: cx } = Utils.RatioUtils
|
|
|
11
12
|
const { withTheme } = Utils.ThemeUtils
|
|
12
13
|
|
|
13
14
|
export interface StepperProps {
|
|
14
|
-
theme?:
|
|
15
|
+
theme?: ThemeType
|
|
15
16
|
value: number | string
|
|
16
17
|
stepValue?: number // 1
|
|
17
18
|
min?: number // 0
|
|
@@ -77,7 +78,7 @@ const Stepper = (props: StepperProps) => {
|
|
|
77
78
|
stepperContainer: {
|
|
78
79
|
flexDirection: 'row',
|
|
79
80
|
alignItems: 'center',
|
|
80
|
-
backgroundColor: props.theme
|
|
81
|
+
backgroundColor: props.theme?.container.background,
|
|
81
82
|
padding: cx(2),
|
|
82
83
|
borderRadius: cx(12),
|
|
83
84
|
width: cx(150),
|
|
@@ -85,7 +86,7 @@ const Stepper = (props: StepperProps) => {
|
|
|
85
86
|
stepperButton: {
|
|
86
87
|
width: cx(52),
|
|
87
88
|
height: cx(28),
|
|
88
|
-
backgroundColor: props.theme
|
|
89
|
+
backgroundColor: props.theme?.global.background,
|
|
89
90
|
borderRadius: cx(10),
|
|
90
91
|
alignItems: 'center',
|
|
91
92
|
justifyContent: 'center',
|
|
@@ -93,12 +94,12 @@ const Stepper = (props: StepperProps) => {
|
|
|
93
94
|
stepperIcon: {
|
|
94
95
|
width: cx(20),
|
|
95
96
|
height: cx(20),
|
|
96
|
-
tintColor: props.theme
|
|
97
|
+
tintColor: props.theme?.global.fontColor
|
|
97
98
|
},
|
|
98
99
|
stepperInput: {
|
|
99
100
|
width: cx(42),
|
|
100
101
|
height: cx(22),
|
|
101
|
-
color: props.theme
|
|
102
|
+
color: props.theme?.global.secondFontColor,
|
|
102
103
|
fontSize: cx(16),
|
|
103
104
|
padding: 0,
|
|
104
105
|
alignItems: 'center',
|
|
@@ -27,10 +27,10 @@ const StripAdjustView = (props: StripAdjustViewProps) => {
|
|
|
27
27
|
<TabBar
|
|
28
28
|
type='radio'
|
|
29
29
|
tabs={props.lampTabs}
|
|
30
|
-
style={{ borderRadius: cx(8), backgroundColor: props.theme
|
|
31
|
-
tabTextStyle={{ color: props.theme
|
|
32
|
-
tabActiveTextStyle={{ color: props.theme
|
|
33
|
-
activeColor={props.theme
|
|
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}
|
|
34
34
|
activeKey={props.activeKey}
|
|
35
35
|
onChange={props.onActiveKeyChange}
|
|
36
36
|
/>
|
|
@@ -88,8 +88,8 @@ const StripAdjustView = (props: StripAdjustViewProps) => {
|
|
|
88
88
|
radius={cx(20)}
|
|
89
89
|
colors={item}
|
|
90
90
|
/>
|
|
91
|
-
{props.colorDiskActiveKey === index && <View style={{ width: cx(44), height: cx(44), borderRadius: cx(44), borderColor: props.theme
|
|
92
|
-
<Image source={{ uri: res.ic_check }} style={{ width: cx(40), height: cx(40), tintColor: props.theme
|
|
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
93
|
</View>}
|
|
94
94
|
</TouchableOpacity>
|
|
95
95
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { requireNativeComponent, ViewProps } from 'react-native'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { Utils } from 'tuya-panel-kit'
|
|
4
|
+
import ThemeType from '../config/themeType'
|
|
4
5
|
|
|
5
6
|
const { withTheme } = Utils.ThemeUtils
|
|
6
7
|
const NativeStripLightView = requireNativeComponent('StripLightView')
|
|
@@ -11,7 +12,7 @@ export interface LightNode {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export interface StripLightViewProps extends ViewProps {
|
|
14
|
-
theme?:
|
|
15
|
+
theme?: ThemeType
|
|
15
16
|
nodes: LightNode[]
|
|
16
17
|
fixCount: number
|
|
17
18
|
stripStyle: 'ONLY_LINE' | 'WITH_BEAD'
|
|
@@ -20,7 +21,7 @@ export interface StripLightViewProps extends ViewProps {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const StripLightView = (props: StripLightViewProps) => {
|
|
23
|
-
const newNodes = props.nodes.map(node => ({...node, backgroundColor: props.theme
|
|
24
|
+
const newNodes = props.nodes.map(node => ({...node, backgroundColor: props.theme?.card.background}))
|
|
24
25
|
return (
|
|
25
26
|
<NativeStripLightView {...props} nodes={JSON.stringify(newNodes)}/>
|
|
26
27
|
)
|
|
@@ -5,12 +5,13 @@ import I18n from "../i18n";
|
|
|
5
5
|
import { Utils } from "tuya-panel-kit";
|
|
6
6
|
import Spacer from "../components/Spacer";
|
|
7
7
|
import InfoText from "../components/InfoText";
|
|
8
|
+
import ThemeType from '../config/themeType'
|
|
8
9
|
|
|
9
10
|
const { convertX: cx } = Utils.RatioUtils;
|
|
10
11
|
const { withTheme } = Utils.ThemeUtils
|
|
11
12
|
|
|
12
13
|
interface SummaryProps {
|
|
13
|
-
theme?:
|
|
14
|
+
theme?: ThemeType
|
|
14
15
|
style?: ViewStyle
|
|
15
16
|
frequency?: string | ReactElement
|
|
16
17
|
time?: string | ReactElement
|
|
@@ -25,7 +26,7 @@ const Summary = (props: SummaryProps) => {
|
|
|
25
26
|
marginHorizontal: cx(24),
|
|
26
27
|
},
|
|
27
28
|
itemTitle: {
|
|
28
|
-
color: props.theme
|
|
29
|
+
color: props.theme?.global.fontColor,
|
|
29
30
|
fontSize: cx(16),
|
|
30
31
|
fontWeight: 'bold',
|
|
31
32
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
@@ -41,14 +42,14 @@ const Summary = (props: SummaryProps) => {
|
|
|
41
42
|
minWidth: cx(100)
|
|
42
43
|
},
|
|
43
44
|
summaryImg: {
|
|
44
|
-
tintColor: props.theme
|
|
45
|
+
tintColor: props.theme?.global.fontColor,
|
|
45
46
|
width: cx(12),
|
|
46
47
|
height: cx(12),
|
|
47
48
|
marginRight: cx(6)
|
|
48
49
|
},
|
|
49
50
|
leftTitle: {
|
|
50
51
|
fontSize: cx(14),
|
|
51
|
-
color: props.theme
|
|
52
|
+
color: props.theme?.global.fontColor
|
|
52
53
|
},
|
|
53
54
|
summaryRight: {
|
|
54
55
|
flex: 1,
|
|
@@ -60,10 +61,10 @@ const Summary = (props: SummaryProps) => {
|
|
|
60
61
|
borderRadius: cx(16),
|
|
61
62
|
paddingHorizontal: cx(12),
|
|
62
63
|
alignSelf: 'flex-start',
|
|
63
|
-
backgroundColor: props.theme
|
|
64
|
+
backgroundColor: props.theme?.tag.background,
|
|
64
65
|
},
|
|
65
66
|
rightItem: {
|
|
66
|
-
color: props.theme
|
|
67
|
+
color: props.theme?.tag.fontColor,
|
|
67
68
|
},
|
|
68
69
|
})
|
|
69
70
|
return (
|
package/src/components/Tag.tsx
CHANGED
|
@@ -2,12 +2,13 @@ import {Image, StyleSheet, Text, TouchableOpacity, View, ViewProps} from 'react-
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import {Utils} from 'tuya-panel-kit'
|
|
4
4
|
import res from '../res'
|
|
5
|
+
import ThemeType from '../config/themeType'
|
|
5
6
|
|
|
6
7
|
const cx = Utils.RatioUtils.convertX
|
|
7
8
|
const { withTheme } = Utils.ThemeUtils
|
|
8
9
|
|
|
9
10
|
interface TagProps extends ViewProps {
|
|
10
|
-
theme?:
|
|
11
|
+
theme?: ThemeType
|
|
11
12
|
checked: boolean
|
|
12
13
|
text: string
|
|
13
14
|
onCheckedChange: (boolean) => void
|
|
@@ -22,12 +23,12 @@ const Tag = (props: TagProps) => {
|
|
|
22
23
|
justifyContent: 'center',
|
|
23
24
|
alignItems: 'center',
|
|
24
25
|
borderWidth: cx(1),
|
|
25
|
-
borderColor: props.theme
|
|
26
|
+
borderColor: props.theme?.global.brand,
|
|
26
27
|
borderRadius: cx(12),
|
|
27
28
|
},
|
|
28
29
|
text: {
|
|
29
30
|
marginStart: cx(12),
|
|
30
|
-
color: props.theme
|
|
31
|
+
color: props.theme?.global.brand,
|
|
31
32
|
fontSize: cx(14),
|
|
32
33
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
33
34
|
},
|
|
@@ -35,7 +36,7 @@ const Tag = (props: TagProps) => {
|
|
|
35
36
|
width: cx(12),
|
|
36
37
|
height: cx(12),
|
|
37
38
|
marginEnd: cx(6),
|
|
38
|
-
tintColor: props.theme
|
|
39
|
+
tintColor: props.theme?.global.brand,
|
|
39
40
|
},
|
|
40
41
|
})
|
|
41
42
|
|
|
@@ -44,7 +45,7 @@ const Tag = (props: TagProps) => {
|
|
|
44
45
|
onPress={() => {
|
|
45
46
|
props.onCheckedChange(!props.checked)
|
|
46
47
|
}}>
|
|
47
|
-
<View style={[styles.root, props.checked ? {backgroundColor: props.theme
|
|
48
|
+
<View style={[styles.root, props.checked ? {backgroundColor: props.theme?.global.thirdBrand} : {}, props.style]}>
|
|
48
49
|
<Text style={[styles.text, {marginEnd: cx(props.checked ? 4 : 12)}]}>{props.text}</Text>
|
|
49
50
|
{
|
|
50
51
|
props.checked &&
|
|
@@ -2,12 +2,13 @@ import {Image, StyleSheet, Text, TextInput, TextInputProps, ImageSourcePropType,
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import {Utils} from 'tuya-panel-kit'
|
|
4
4
|
import res from '../res'
|
|
5
|
+
import ThemeType from '../config/themeType'
|
|
5
6
|
|
|
6
7
|
const cx = Utils.RatioUtils.convertX
|
|
7
8
|
const { withTheme } = Utils.ThemeUtils
|
|
8
9
|
|
|
9
10
|
interface TextFieldProps extends TextInputProps {
|
|
10
|
-
theme?:
|
|
11
|
+
theme?: ThemeType
|
|
11
12
|
showError?: boolean
|
|
12
13
|
errorText?: string
|
|
13
14
|
tipIcon?: ImageSourcePropType
|
|
@@ -16,20 +17,20 @@ interface TextFieldProps extends TextInputProps {
|
|
|
16
17
|
|
|
17
18
|
const TextField = (props: TextFieldProps) => {
|
|
18
19
|
const icon = props.tipIcon || res.ic_warning_amber
|
|
19
|
-
const color = props.tipColor || props.theme
|
|
20
|
+
const color = props.tipColor || props.theme?.global.warning
|
|
20
21
|
|
|
21
22
|
const styles = StyleSheet.create({
|
|
22
23
|
topTip: {
|
|
23
24
|
marginTop: cx(5),
|
|
24
25
|
fontSize: cx(12),
|
|
25
26
|
marginStart: cx(13),
|
|
26
|
-
color: props.theme
|
|
27
|
+
color: props.theme?.global.secondFontColor,
|
|
27
28
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
28
29
|
},
|
|
29
30
|
textInputGroup: {
|
|
30
31
|
flexDirection: 'row',
|
|
31
32
|
borderRadius: cx(4),
|
|
32
|
-
backgroundColor: props.theme
|
|
33
|
+
backgroundColor: props.theme?.textInput.background,
|
|
33
34
|
alignItems: 'center',
|
|
34
35
|
},
|
|
35
36
|
textInput: {
|
|
@@ -38,7 +39,7 @@ const TextField = (props: TextFieldProps) => {
|
|
|
38
39
|
marginStart: cx(16),
|
|
39
40
|
marginEnd: cx(6),
|
|
40
41
|
fontSize: cx(16),
|
|
41
|
-
color: props.theme
|
|
42
|
+
color: props.theme?.textInput.fontColor,
|
|
42
43
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
43
44
|
},
|
|
44
45
|
iconTouchable: {
|
|
@@ -55,7 +56,7 @@ const TextField = (props: TextFieldProps) => {
|
|
|
55
56
|
start: cx(4),
|
|
56
57
|
end: cx(4),
|
|
57
58
|
bottom: 0,
|
|
58
|
-
backgroundColor: props.theme
|
|
59
|
+
backgroundColor: props.theme?.textInput.line,
|
|
59
60
|
},
|
|
60
61
|
errorContainer: {
|
|
61
62
|
flexDirection: 'row',
|
|
@@ -2,12 +2,13 @@ import {StyleSheet, Text, TouchableOpacity, View, ViewProps, Image} from 'react-
|
|
|
2
2
|
import {Utils} from 'tuya-panel-kit'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import res from "../res/index";
|
|
5
|
+
import ThemeType from '../config/themeType'
|
|
5
6
|
|
|
6
7
|
const cx = Utils.RatioUtils.convertX
|
|
7
8
|
const { withTheme } = Utils.ThemeUtils
|
|
8
9
|
|
|
9
10
|
interface TextFieldStyleButtonProps extends ViewProps {
|
|
10
|
-
theme?:
|
|
11
|
+
theme?: ThemeType
|
|
11
12
|
placeholder: string
|
|
12
13
|
text: string
|
|
13
14
|
onPress: () => void,
|
|
@@ -21,13 +22,13 @@ const TextFieldStyleButton = (props: TextFieldStyleButtonProps) => {
|
|
|
21
22
|
marginTop: cx(5),
|
|
22
23
|
fontSize: cx(12),
|
|
23
24
|
marginStart: cx(13),
|
|
24
|
-
color: props.theme
|
|
25
|
+
color: props.theme?.global.secondFontColor,
|
|
25
26
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
26
27
|
},
|
|
27
28
|
textGroup: {
|
|
28
29
|
flexDirection: 'row',
|
|
29
30
|
borderRadius: cx(4),
|
|
30
|
-
backgroundColor: props.theme
|
|
31
|
+
backgroundColor: props.theme?.textInput.background,
|
|
31
32
|
alignItems: 'center',
|
|
32
33
|
},
|
|
33
34
|
textParent: {
|
|
@@ -39,7 +40,7 @@ const TextFieldStyleButton = (props: TextFieldStyleButtonProps) => {
|
|
|
39
40
|
marginStart: cx(16),
|
|
40
41
|
marginEnd: cx(6),
|
|
41
42
|
fontSize: cx(16),
|
|
42
|
-
color: props.theme
|
|
43
|
+
color: props.theme?.textInput.fontColor,
|
|
43
44
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
44
45
|
},
|
|
45
46
|
line: {
|
|
@@ -48,7 +49,7 @@ const TextFieldStyleButton = (props: TextFieldStyleButtonProps) => {
|
|
|
48
49
|
start: cx(4),
|
|
49
50
|
end: cx(4),
|
|
50
51
|
bottom: 0,
|
|
51
|
-
backgroundColor: props.theme
|
|
52
|
+
backgroundColor: props.theme?.textInput.line,
|
|
52
53
|
},
|
|
53
54
|
tipParent: {
|
|
54
55
|
flexDirection: 'row',
|
|
@@ -58,7 +59,7 @@ const TextFieldStyleButton = (props: TextFieldStyleButtonProps) => {
|
|
|
58
59
|
width: cx(16),
|
|
59
60
|
height: cx(16),
|
|
60
61
|
marginStart: cx(4),
|
|
61
|
-
tintColor: props.theme
|
|
62
|
+
tintColor: props.theme?.icon.primary
|
|
62
63
|
}
|
|
63
64
|
})
|
|
64
65
|
|
|
@@ -3,12 +3,13 @@ import Spacer from './Spacer'
|
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { Utils } from 'tuya-panel-kit'
|
|
5
5
|
import res from '../res/index'
|
|
6
|
+
import ThemeType from '../config/themeType'
|
|
6
7
|
|
|
7
8
|
const cx = Utils.RatioUtils.convertX
|
|
8
9
|
const { withTheme } = Utils.ThemeUtils
|
|
9
10
|
|
|
10
11
|
export interface UATabTitleProps extends ViewProps {
|
|
11
|
-
theme?:
|
|
12
|
+
theme?: ThemeType
|
|
12
13
|
text: string
|
|
13
14
|
onIconClick: () => void
|
|
14
15
|
}
|
|
@@ -16,7 +17,7 @@ export interface UATabTitleProps extends ViewProps {
|
|
|
16
17
|
const UATabTitle = (props: UATabTitleProps) => {
|
|
17
18
|
const styles = StyleSheet.create({
|
|
18
19
|
tabsTitle: {
|
|
19
|
-
color: props.theme
|
|
20
|
+
color: props.theme?.global.fontColor,
|
|
20
21
|
fontSize: cx(14),
|
|
21
22
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
22
23
|
},
|
|
@@ -27,7 +28,7 @@ const UATabTitle = (props: UATabTitleProps) => {
|
|
|
27
28
|
<Text style={styles.tabsTitle}>{props.text}</Text>
|
|
28
29
|
<Spacer height={cx(0)} width={cx(4)}/>
|
|
29
30
|
<TouchableOpacity onPress={props.onIconClick}>
|
|
30
|
-
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme
|
|
31
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.icon.primary }} source={res.ic_info}/>
|
|
31
32
|
</TouchableOpacity>
|
|
32
33
|
</View>
|
|
33
34
|
)
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { StyleSheet, Text, TouchableOpacity, View, ViewProps } from 'react-native'
|
|
3
3
|
import { Utils } from 'tuya-panel-kit'
|
|
4
|
+
import ThemeType from '../config/themeType'
|
|
4
5
|
|
|
5
6
|
const cx = Utils.RatioUtils.convertX
|
|
6
7
|
const { withTheme } = Utils.ThemeUtils
|
|
7
8
|
|
|
8
9
|
export interface UATabsProps extends ViewProps {
|
|
9
|
-
theme?:
|
|
10
|
+
theme?: ThemeType
|
|
10
11
|
active: any
|
|
11
12
|
data: UATabData[]
|
|
12
13
|
onSelectChange: (value: UATabData, index: number) => void
|
|
@@ -25,7 +26,7 @@ const UATabs = (props: UATabsProps) => {
|
|
|
25
26
|
height: cx(32),
|
|
26
27
|
paddingVertical: cx(2),
|
|
27
28
|
paddingHorizontal: cx(3),
|
|
28
|
-
backgroundColor: props.theme
|
|
29
|
+
backgroundColor: props.theme?.segment.background,
|
|
29
30
|
borderRadius: cx(9),
|
|
30
31
|
},
|
|
31
32
|
tabs: {
|
|
@@ -61,13 +62,13 @@ const UATabs = (props: UATabsProps) => {
|
|
|
61
62
|
<View style={[
|
|
62
63
|
styles.tab,
|
|
63
64
|
{
|
|
64
|
-
backgroundColor: active ? props.theme
|
|
65
|
+
backgroundColor: active ? props.theme?.button.primary : props.theme?.container.background,
|
|
65
66
|
},
|
|
66
67
|
]}>
|
|
67
68
|
<Text style={[
|
|
68
69
|
styles.tabText,
|
|
69
70
|
{
|
|
70
|
-
color: active ? props.theme
|
|
71
|
+
color: active ? props.theme?.button.fontColor : props.theme?.global.secondFontColor,
|
|
71
72
|
},
|
|
72
73
|
]}>{item.title}</Text>
|
|
73
74
|
</View>
|
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import {StyleProp, StyleSheet, Text, View, ViewStyle} from 'react-native'
|
|
3
3
|
import {LinearGradient, Slider, Utils} from 'tuya-panel-kit'
|
|
4
4
|
import {Rect} from 'react-native-svg'
|
|
5
|
+
import ThemeType from '../config/themeType'
|
|
5
6
|
|
|
6
7
|
const cx = Utils.RatioUtils.convertX
|
|
7
8
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -28,7 +29,7 @@ const colors = {
|
|
|
28
29
|
export const TEMP_KEY = 'temperature'
|
|
29
30
|
|
|
30
31
|
interface LdvColorSliderProps {
|
|
31
|
-
theme?:
|
|
32
|
+
theme?: ThemeType
|
|
32
33
|
title: string,
|
|
33
34
|
type: string,
|
|
34
35
|
onValueChange?: (number) => void | undefined,
|
|
@@ -55,7 +56,7 @@ const LdvColorSlider = (props: LdvColorSliderProps) => {
|
|
|
55
56
|
title: {
|
|
56
57
|
marginTop: cx(4),
|
|
57
58
|
fontSize: cx(14),
|
|
58
|
-
color: props.theme
|
|
59
|
+
color: props.theme?.global.fontColor,
|
|
59
60
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
60
61
|
},
|
|
61
62
|
shadeSlider: {
|
|
@@ -2,6 +2,7 @@ import React, { useMemo } from 'react'
|
|
|
2
2
|
import {StyleProp, StyleSheet, Text, View, ViewStyle} from 'react-native'
|
|
3
3
|
import {Picker, Utils} from 'tuya-panel-kit'
|
|
4
4
|
import _ from 'lodash'
|
|
5
|
+
import ThemeType from '../config/themeType'
|
|
5
6
|
|
|
6
7
|
const {convertX} = Utils.RatioUtils
|
|
7
8
|
const { withTheme } = Utils.ThemeUtils
|
|
@@ -11,7 +12,7 @@ const pickerTheme = {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
interface LdvPickerViewProps {
|
|
14
|
-
theme?:
|
|
15
|
+
theme?: ThemeType
|
|
15
16
|
hour: string,
|
|
16
17
|
minute: string,
|
|
17
18
|
setHour: (string) => void,
|
|
@@ -35,7 +36,7 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
35
36
|
},
|
|
36
37
|
picker: {
|
|
37
38
|
flex: 1,
|
|
38
|
-
backgroundColor: props.theme
|
|
39
|
+
backgroundColor: props.theme?.card.background,
|
|
39
40
|
},
|
|
40
41
|
pickerLeft: {},
|
|
41
42
|
pickerItem: {},
|
|
@@ -67,7 +68,7 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
67
68
|
))}
|
|
68
69
|
</Picker>
|
|
69
70
|
{unit ? <View style={styles.pickerUnit}>
|
|
70
|
-
<Text style={{color: props.theme
|
|
71
|
+
<Text style={{color: props.theme?.global.fontColor, fontSize: convertX(18)}}>
|
|
71
72
|
{unit[0]}
|
|
72
73
|
</Text>
|
|
73
74
|
</View> : null}
|
|
@@ -86,7 +87,7 @@ const LdvPickerView = (props: LdvPickerViewProps) => {
|
|
|
86
87
|
))}
|
|
87
88
|
</Picker>
|
|
88
89
|
{unit ? <View style={styles.pickerUnit}>
|
|
89
|
-
<Text style={{color: props.theme
|
|
90
|
+
<Text style={{color: props.theme?.global.fontColor, fontSize: convertX(18)}}>
|
|
90
91
|
{unit[1]}
|
|
91
92
|
</Text>
|
|
92
93
|
</View> : null}
|
|
@@ -2,12 +2,13 @@ import {useReactive} from 'ahooks'
|
|
|
2
2
|
import React, {useEffect} from 'react'
|
|
3
3
|
import {StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native'
|
|
4
4
|
import {Slider, Utils} from 'tuya-panel-kit'
|
|
5
|
+
import ThemeType from '../config/themeType'
|
|
5
6
|
|
|
6
7
|
const cx = Utils.RatioUtils.convertX
|
|
7
8
|
const { withTheme } = Utils.ThemeUtils
|
|
8
9
|
|
|
9
10
|
interface LdvSliderProps {
|
|
10
|
-
theme?:
|
|
11
|
+
theme?: ThemeType
|
|
11
12
|
title: string,
|
|
12
13
|
value: number,
|
|
13
14
|
min?: number | undefined,
|
|
@@ -44,13 +45,13 @@ const LdvSlider = (props: LdvSliderProps) => {
|
|
|
44
45
|
valueText: {
|
|
45
46
|
marginTop: cx(10),
|
|
46
47
|
fontSize: cx(14),
|
|
47
|
-
color: props.theme
|
|
48
|
+
color: props.theme?.global.fontColor,
|
|
48
49
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
49
50
|
},
|
|
50
51
|
title: {
|
|
51
52
|
marginTop: cx(10),
|
|
52
53
|
fontSize: cx(14),
|
|
53
|
-
color: props.theme
|
|
54
|
+
color: props.theme?.global.fontColor,
|
|
54
55
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
55
56
|
},
|
|
56
57
|
slider: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {StyleSheet, Text, View} from 'react-native'
|
|
3
3
|
import {SwitchButton, Utils} from 'tuya-panel-kit'
|
|
4
|
-
import
|
|
4
|
+
import ThemeType from '../config/themeType'
|
|
5
5
|
|
|
6
6
|
const {convertX: cx} = Utils.RatioUtils
|
|
7
7
|
const { withTheme } = Utils.ThemeUtils
|
|
8
8
|
|
|
9
9
|
interface Prop {
|
|
10
|
-
theme?:
|
|
10
|
+
theme?: ThemeType
|
|
11
11
|
title: string
|
|
12
|
-
color
|
|
12
|
+
color?: string
|
|
13
13
|
colorAlpha: number
|
|
14
14
|
enable: boolean
|
|
15
15
|
setEnable: (enable: boolean) => void
|
|
@@ -23,10 +23,10 @@ const LdvSwitch = (props: Prop) => {
|
|
|
23
23
|
<View style={styles.titleBGView}>
|
|
24
24
|
<View style={{flexDirection: 'column', flex: 1}}>
|
|
25
25
|
<View style={{flexDirection: 'row', alignItems: 'center'}}>
|
|
26
|
-
<Text style={{...styles.title, color: props.theme
|
|
27
|
-
<View style={[styles.colorBlock, {backgroundColor: color, opacity: colorAlpha}]}/>
|
|
26
|
+
<Text style={{...styles.title, color: props.theme?.global.fontColor}}>{title}</Text>
|
|
27
|
+
<View style={[styles.colorBlock, {backgroundColor: color || props.theme?.card.background, opacity: colorAlpha}]}/>
|
|
28
28
|
</View>
|
|
29
|
-
{description && <Text style={{color: props.theme
|
|
29
|
+
{description && <Text style={{color: props.theme?.global.fontColor}}>{description}</Text>}
|
|
30
30
|
</View>
|
|
31
31
|
{showSwitch && <SwitchButton value={enable} onValueChange={setEnable}/>}
|
|
32
32
|
</View>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {Image, Platform, Text, TouchableOpacity, View} from 'react-native'
|
|
3
3
|
import {IconFont, Utils} from 'tuya-panel-kit'
|
|
4
|
+
import ThemeType from '../config/themeType'
|
|
4
5
|
|
|
5
6
|
const backIcon = Platform.OS === 'ios' ? 'backIos' : 'backAndroid'
|
|
6
7
|
|
|
@@ -8,7 +9,7 @@ const cx = Utils.RatioUtils.convertX
|
|
|
8
9
|
const { withTheme } = Utils.ThemeUtils
|
|
9
10
|
|
|
10
11
|
interface TopBarProps {
|
|
11
|
-
theme?:
|
|
12
|
+
theme?: ThemeType
|
|
12
13
|
title: string
|
|
13
14
|
onBackPress: () => void
|
|
14
15
|
rightButtonIcon?: any | {}
|
|
@@ -37,13 +38,13 @@ const LDVTopBar = (props: TopBarProps) => {
|
|
|
37
38
|
alignItems: 'center',
|
|
38
39
|
flex: 1,
|
|
39
40
|
}}>
|
|
40
|
-
<IconFont size={cx(16)} color={props.theme
|
|
41
|
+
<IconFont size={cx(16)} color={props.theme?.global.brand} name={backIcon}/>
|
|
41
42
|
<View style={{width: cx(10)}}/>
|
|
42
43
|
<Text
|
|
43
44
|
numberOfLines={1}
|
|
44
45
|
style={{
|
|
45
46
|
maxWidth: cx(290),
|
|
46
|
-
color: props.theme
|
|
47
|
+
color: props.theme?.global.brand,
|
|
47
48
|
fontSize: cx(16),
|
|
48
49
|
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
49
50
|
}}>{props.title}</Text>
|