From dfa8a58b348bf43ec8d96ffa1f42cae75dbdf2db Mon Sep 17 00:00:00 2001 From: Denis Arkhireev Date: Wed, 21 Nov 2018 15:33:58 +0400 Subject: [PATCH 1/3] Added color property for bottom border --- src/TextInputLayout.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TextInputLayout.js b/src/TextInputLayout.js index 7797106..6a3761c 100644 --- a/src/TextInputLayout.js +++ b/src/TextInputLayout.js @@ -15,6 +15,7 @@ export default class TextInputLayout extends Component { static propTypes = { ...View.propTypes, hintColor: PropTypes.string, + borderColor: PropTypes.string, errorColor: PropTypes.string, focusColor: PropTypes.string, labelFontSize: PropTypes.number, @@ -23,6 +24,7 @@ export default class TextInputLayout extends Component { }; static defaultProps = { hintColor: DEFAULT_PLACEHOLDER_COLOR, + borderColor: DEFAULT_PLACEHOLDER_COLOR, errorColor: DEFAULT_LABEL_ERROR_COLOR, focusColor: DEFAULT_LABEL_COLOR, labelFontSize: 12, @@ -141,12 +143,13 @@ export default class TextInputLayout extends Component { render () { let {isFocused, isError}=this.state; - let {errorColor, hintColor, focusColor}=this.props; + let {errorColor, hintColor, borderColor, focusColor}=this.props; let color = isError ? errorColor : (isFocused ? focusColor : hintColor); + let borderBottomColor = isError ? errorColor : (isFocused ? focusColor : borderColor); return ( Date: Wed, 21 Nov 2018 15:38:32 +0400 Subject: [PATCH 2/3] Fixed readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dc487af..7df6f15 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ const styles = StyleSheet.create({ ##Props - hintColor +- borderColor - errorColor - focusColor - labelFontSize From 617f0617c68be4a49931dbd02d0912b914a3b2ef Mon Sep 17 00:00:00 2001 From: Denis Arkhireev Date: Thu, 13 Dec 2018 18:03:02 +0400 Subject: [PATCH 3/3] Fixed height of placeholder text --- src/TextInputLayout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TextInputLayout.js b/src/TextInputLayout.js index 6a3761c..cc59d7a 100644 --- a/src/TextInputLayout.js +++ b/src/TextInputLayout.js @@ -112,7 +112,7 @@ export default class TextInputLayout extends Component { }); this._labelStyle = { fontSize: labelFontSize, - height: labelHeight, + lineHeight: labelHeight, backgroundColor: 'transparent', transform: [{translateY: labelTransY}] };