Skip to content

Commit

Permalink
#15
Browse files Browse the repository at this point in the history
  • Loading branch information
godba11 committed Dec 16, 2021
1 parent db986e3 commit 028ef3c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface TextFieldProps extends TextInputProps {

error?: string;
errorColor?: string;
errortTestId?: string;

lineWidth?: number;
activeLineWidth?: number;
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class Example extends Component {
suffix | Text field suffix text | String | -
error | Text field error text | String | -
errorColor | Text field color for errored state | String | rgb(213, 0, 0)
errorTestId | Text field error testID | String | -
lineType | Text field line type | String | solid
disabledLineType | Text field line type in disabled state | String | dotted
animationDuration | Text field animation duration in ms | Number | 225
Expand Down
3 changes: 3 additions & 0 deletions src/components/field/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export default class TextField extends PureComponent {

error: PropTypes.string,
errorColor: PropTypes.string,
errorTestId: PropTypes.string,

lineWidth: PropTypes.number,
activeLineWidth: PropTypes.number,
Expand Down Expand Up @@ -573,6 +574,7 @@ export default class TextField extends PureComponent {
disabled,
baseColor,
errorColor,
errorTestId,
titleTextStyle: style,
characterRestriction: limit,
} = this.props;
Expand Down Expand Up @@ -601,6 +603,7 @@ export default class TextField extends PureComponent {
...styleProps,
title,
error,
testId: errorTestId,
disabled,
focusAnimation,
};
Expand Down
5 changes: 3 additions & 2 deletions src/components/helper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class Helper extends PureComponent {
static propTypes = {
title: PropTypes.string,
error: PropTypes.string,

testId: PropTypes.string,
disabled: PropTypes.bool,

style: Text.propTypes.style,
Expand Down Expand Up @@ -70,6 +70,7 @@ export default class Helper extends PureComponent {
disabled,
baseColor,
errorColor,
testId,
} = this.props;

let text = errored?
Expand All @@ -89,7 +90,7 @@ export default class Helper extends PureComponent {
};

return (
<Animated.Text style={[styles.text, style, textStyle]}>
<Animated.Text testID={testId || undefined} style={[styles.text, style, textStyle]}>
{text}
</Animated.Text>
);
Expand Down

0 comments on commit 028ef3c

Please sign in to comment.