@ledvance/base 1.0.33 → 1.0.35
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/package.json +1 -1
- package/src/components/DeleteButton.tsx +36 -0
- package/src/components/Page.tsx +2 -2
- package/src/components/ldvTopName.tsx +7 -6
- package/src/i18n/strings.d.ts +420 -0
- package/src/i18n/strings.ts +114 -30
- package/src/models/modules/common.d.ts +13 -21
- package/src/utils/common.d.ts +22 -0
- package/src/utils/common.ts +33 -0
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TouchableOpacity, Text, StyleProp, ViewStyle, TextStyle } from 'react-native'
|
|
3
|
+
import { Utils } from 'tuya-panel-kit'
|
|
4
|
+
|
|
5
|
+
const cx = Utils.RatioUtils.convertX
|
|
6
|
+
interface DeleteButtonProps {
|
|
7
|
+
text: string,
|
|
8
|
+
onPress: () => void,
|
|
9
|
+
style?: StyleProp<ViewStyle>,
|
|
10
|
+
textStyle?: StyleProp<TextStyle>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const DeleteButton = (props: DeleteButtonProps) => {
|
|
14
|
+
const { text, onPress, style, textStyle } = props
|
|
15
|
+
return (
|
|
16
|
+
<TouchableOpacity
|
|
17
|
+
onPress={onPress}
|
|
18
|
+
style={[{
|
|
19
|
+
width: '100%',
|
|
20
|
+
height: cx(50),
|
|
21
|
+
backgroundColor: '#666',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
borderRadius: cx(8)
|
|
25
|
+
}, style]}
|
|
26
|
+
>
|
|
27
|
+
<Text style={[{
|
|
28
|
+
color: '#fff',
|
|
29
|
+
fontSize: cx(16),
|
|
30
|
+
fontFamily: 'helvetica_neue_lt_std_bd'
|
|
31
|
+
}, textStyle]}>{text}</Text>
|
|
32
|
+
</TouchableOpacity>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default DeleteButton
|
package/src/components/Page.tsx
CHANGED
|
@@ -10,10 +10,10 @@ interface PageProps extends PropsWithChildren<ViewProps> {
|
|
|
10
10
|
rightButtonIcon?: string
|
|
11
11
|
rightButtonIconClick?: () => void
|
|
12
12
|
headlineText?: string
|
|
13
|
-
headlineIcon?: string
|
|
13
|
+
headlineIcon?: string | number
|
|
14
14
|
onHeadlineIconClick?: () => void
|
|
15
15
|
showGreenery?: boolean
|
|
16
|
-
greeneryIcon?: string | undefined
|
|
16
|
+
greeneryIcon?: string | undefined | number
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const Page = (props: PageProps) => {
|
|
@@ -6,13 +6,15 @@ const cx = Utils.RatioUtils.convertX
|
|
|
6
6
|
|
|
7
7
|
interface LdvTopNameProps {
|
|
8
8
|
title: string,
|
|
9
|
-
rightIcon?: string | undefined,
|
|
9
|
+
rightIcon?: string | undefined | number,
|
|
10
10
|
rightIconClick?: () => void
|
|
11
11
|
showGreenery?: boolean
|
|
12
|
-
greeneryIcon?: string | undefined
|
|
12
|
+
greeneryIcon?: string | undefined | number
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const LdvTopName = (props: LdvTopNameProps) => {
|
|
16
|
+
const rightIcon = typeof props.rightIcon === 'number' ? props.rightIcon : {uri : props.rightIcon}
|
|
17
|
+
const greeneryIcon = typeof props.greeneryIcon === 'number' ? props.greeneryIcon : {uri : props.greeneryIcon}
|
|
16
18
|
return (
|
|
17
19
|
<View style={styles.container}>
|
|
18
20
|
<View
|
|
@@ -22,12 +24,12 @@ const LdvTopName = (props: LdvTopNameProps) => {
|
|
|
22
24
|
alignItems: 'center',
|
|
23
25
|
marginTop: cx(38),
|
|
24
26
|
}}>
|
|
25
|
-
<View style={{ flexDirection: 'row' }}>
|
|
27
|
+
<View style={{ flexDirection: 'row', flex: 1 }}>
|
|
26
28
|
<Text style={styles.title}>
|
|
27
29
|
{props.title}
|
|
28
30
|
</Text>
|
|
29
31
|
{props.showGreenery && <Image
|
|
30
|
-
source={
|
|
32
|
+
source={greeneryIcon}
|
|
31
33
|
resizeMode="contain"
|
|
32
34
|
style={{ height: cx(16), width: cx(16), left: 0 }}
|
|
33
35
|
/> || null}
|
|
@@ -36,7 +38,7 @@ const LdvTopName = (props: LdvTopNameProps) => {
|
|
|
36
38
|
onPress={props.rightIconClick}>
|
|
37
39
|
<Image
|
|
38
40
|
style={{ width: cx(24), height: cx(24), tintColor: '#ff6600' }}
|
|
39
|
-
source={
|
|
41
|
+
source={rightIcon} />
|
|
40
42
|
</TouchableOpacity>}
|
|
41
43
|
</View>
|
|
42
44
|
</View>
|
|
@@ -49,7 +51,6 @@ const styles = StyleSheet.create({
|
|
|
49
51
|
marginBottom: cx(12),
|
|
50
52
|
},
|
|
51
53
|
title: {
|
|
52
|
-
flex: 1,
|
|
53
54
|
color: '#f60',
|
|
54
55
|
fontSize: cx(24),
|
|
55
56
|
},
|