Skip to content

Commit 65c8cd2

Browse files
author
bietkul
committed
Added Customization For Error Icon
1 parent c837376 commit 65c8cd2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/fields/textInput/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class TextInputField extends Component {
2222
<ListItem style={{ borderBottomWidth: 0, paddingVertical: 5 }}>
2323
<View style={{ flex: 1 }}>
2424
<View>
25-
<Item error={attributes.error}>
25+
<Item error={theme.changeTextInputColorOnError ? attributes.error : null}>
2626
{ attributes.icon &&
2727
<Icon color={theme.textInputIconColor} name={attributes.icon} />
2828
}
@@ -45,8 +45,8 @@ export default class TextInputField extends Component {
4545
onChangeText={text => this.handleChange(text)}
4646
{...inputProps}
4747
/>
48-
{ attributes.error ?
49-
<Icon name="close-circle" /> : null}
48+
{ theme.textInputErrorIcon && attributes.error ?
49+
<Icon name={theme.textInputErrorIcon} /> : null}
5050
</Item>
5151
</View>
5252
<ErrorComponent {...{ attributes, theme }} />

src/theme.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ export default {
1515
inputFontSize: 15,
1616
labelActiveColor: '#575757',
1717
errorMsgColor: '#ed2f2f',
18+
changeTextInputColorOnError: true,
19+
textInputErrorIcon: 'close-circle',
1820
};

0 commit comments

Comments
 (0)