From ae283dbb42dd8797ebb98982bf144ba142df5c3c Mon Sep 17 00:00:00 2001 From: Kenneth Palaganas Date: Thu, 12 Jan 2017 01:55:07 +0800 Subject: [PATCH] Button: set button text to go uppercase or not --- src/Button/Button.react.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Button/Button.react.js b/src/Button/Button.react.js index ff0733ac..2cf6333a 100644 --- a/src/Button/Button.react.js +++ b/src/Button/Button.react.js @@ -28,6 +28,10 @@ const propTypes = { */ text: PropTypes.string.isRequired, /** + * Button text will be in uppercase letters + */ + upperCase: PropTypes.bool, + /** * If specified it'll be shown before text */ icon: PropTypes.string, @@ -44,6 +48,7 @@ const defaultProps = { accent: false, disabled: false, raised: false, + upperCase: true, style: {}, }; const contextTypes = { @@ -144,7 +149,7 @@ class Button extends PureComponent { ); } render() { - const { text, disabled, raised, onLongPress } = this.props; + const { text, disabled, raised, upperCase, onLongPress } = this.props; const styles = getStyles(this.props, this.context, this.state); @@ -152,7 +157,7 @@ class Button extends PureComponent { {this.renderIcon(styles)} - {text.toUpperCase()} + {upperCase ? text.toUpperCase() : text} );