@ledvance/base 1.1.54 → 1.1.55
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
CHANGED
|
@@ -13,21 +13,29 @@ interface TextFieldProps extends TextInputProps {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const TextField = (props: TextFieldProps) => {
|
|
16
|
+
const icon = props.tipIcon || res.ic_warning_amber
|
|
17
|
+
const color = props.tipColor || '#FF9500'
|
|
16
18
|
return (
|
|
17
19
|
<View style={props.style}>
|
|
18
|
-
<Text style={[styles.topTip, {opacity: (!!props.value) ? 1 : 0}]}>{props.placeholder}</Text>
|
|
20
|
+
<Text style={[styles.topTip, { opacity: (!!props.value) ? 1 : 0 }]}>{props.placeholder}</Text>
|
|
19
21
|
<View style={styles.textInputGroup}>
|
|
20
|
-
<TextInput{...props} style={styles.textInput}/>
|
|
22
|
+
<TextInput{...props} style={styles.textInput} />
|
|
21
23
|
{!!props.value &&
|
|
22
24
|
<TouchableOpacity
|
|
23
25
|
style={styles.iconTouchable}
|
|
24
26
|
onPress={() => {
|
|
25
27
|
props.onChangeText && props.onChangeText('')
|
|
26
28
|
}}>
|
|
27
|
-
<Image source={{uri: res.ic_cancel}} style={styles.icon}/>
|
|
29
|
+
<Image source={{ uri: res.ic_cancel }} style={styles.icon} />
|
|
28
30
|
</TouchableOpacity>
|
|
29
31
|
}
|
|
30
|
-
<View style={styles.line}/>
|
|
32
|
+
<View style={styles.line} />
|
|
33
|
+
</View>
|
|
34
|
+
<View style={[styles.errorContainer, { opacity: !!(props.showError) ? 1 : 0 }]}>
|
|
35
|
+
<Image source={icon} style={[styles.icon, { tintColor: color }]} />
|
|
36
|
+
<Text
|
|
37
|
+
style={{ marginLeft: cx(5), color: color }}
|
|
38
|
+
>{props.errorText}</Text>
|
|
31
39
|
</View>
|
|
32
40
|
</View>
|
|
33
41
|
)
|
|
@@ -72,6 +80,11 @@ const styles = StyleSheet.create({
|
|
|
72
80
|
bottom: 0,
|
|
73
81
|
backgroundColor: '#cbcbcb',
|
|
74
82
|
},
|
|
83
|
+
errorContainer: {
|
|
84
|
+
flexDirection: 'row',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
marginStart: cx(13),
|
|
87
|
+
},
|
|
75
88
|
})
|
|
76
89
|
|
|
77
|
-
export default TextField
|
|
90
|
+
export default TextField
|
|
@@ -24,8 +24,9 @@ const LDVTopBar = (props: TopBarProps) => {
|
|
|
24
24
|
height: cx(46),
|
|
25
25
|
alignItems: 'center',
|
|
26
26
|
marginTop: Platform.OS === 'ios' ? Utils.RatioUtils.statusBarHeight : 0,
|
|
27
|
+
justifyContent: 'space-between',
|
|
27
28
|
}}>
|
|
28
|
-
<TouchableOpacity onPress={props.onBackPress} style={{flex: 1}}>
|
|
29
|
+
<TouchableOpacity onPress={props.onBackPress} style={{flex: 1, maxWidth: cx(290)}} >
|
|
29
30
|
<View
|
|
30
31
|
style={{
|
|
31
32
|
flexDirection: 'row',
|
|
@@ -51,6 +52,7 @@ const LDVTopBar = (props: TopBarProps) => {
|
|
|
51
52
|
style={{
|
|
52
53
|
width: cx(44),
|
|
53
54
|
height: cx(44),
|
|
55
|
+
marginRight: cx(10)
|
|
54
56
|
}}
|
|
55
57
|
onPress={props.onRightButtonPress}
|
|
56
58
|
disabled={props.rightButtonDisabled}>
|
|
@@ -65,7 +67,6 @@ const LDVTopBar = (props: TopBarProps) => {
|
|
|
65
67
|
source={icon}/>
|
|
66
68
|
</TouchableOpacity>
|
|
67
69
|
}
|
|
68
|
-
<View style={{width: cx(12)}}/>
|
|
69
70
|
</View>
|
|
70
71
|
)
|
|
71
72
|
}
|