@ledvance/base 1.1.53 → 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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.53",
7
+ "version": "1.1.55",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -6,7 +6,7 @@ import Spacer from './Spacer'
6
6
  const cx = Utils.RatioUtils.convertX
7
7
 
8
8
  interface InfoTextProps extends ViewProps {
9
- icon: string
9
+ icon: string | number
10
10
  text: string
11
11
  contentColor?: string
12
12
  iconStyle?: StyleProp<ImageStyle>
@@ -15,10 +15,11 @@ interface InfoTextProps extends ViewProps {
15
15
 
16
16
  const InfoText = (props: InfoTextProps) => {
17
17
  const contentColor = props.contentColor || '#666666'
18
+ const source = typeof props.icon === 'string' ? {uri: props.icon} : props.icon
18
19
  return (
19
20
  <View style={styles.root}>
20
21
  <Image style={[styles.icon, props.iconStyle, {tintColor: contentColor}]}
21
- source={{uri: props.icon}}/>
22
+ source={source}/>
22
23
  <Spacer width={cx(4)} height={0}/>
23
24
  <Text style={[styles.text, props.textStyle, {color: contentColor}]}>{props.text}</Text>
24
25
  </View>
@@ -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
  }