Skip to content

Commit

Permalink
Button: set button text to go uppercase or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Palaganas committed Jan 12, 2017
1 parent 8d30d21 commit ae283db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Button/Button.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -44,6 +48,7 @@ const defaultProps = {
accent: false,
disabled: false,
raised: false,
upperCase: true,
style: {},
};
const contextTypes = {
Expand Down Expand Up @@ -144,15 +149,15 @@ 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);

const content = (
<View style={styles.container}>
{this.renderIcon(styles)}
<Text style={styles.text}>
{text.toUpperCase()}
{upperCase ? text.toUpperCase() : text}
</Text>
</View>
);
Expand Down

0 comments on commit ae283db

Please sign in to comment.