diff --git a/index.js b/index.js index 7fb0df3..25c7e35 100755 --- a/index.js +++ b/index.js @@ -50,12 +50,14 @@ export default class CheckBox extends Component { checkedCheckBoxColor: PropTypes.string, uncheckedCheckBoxColor: PropTypes.string, disabled: PropTypes.bool, + allowFontScaling: PropTypes.bool } static defaultProps = { isChecked: false, isIndeterminate: false, leftTextStyle: {}, - rightTextStyle: {} + rightTextStyle: {}, + allowFontScaling: true } onClick() { @@ -63,18 +65,22 @@ export default class CheckBox extends Component { } _renderLeft() { - if (this.props.leftTextView) return this.props.leftTextView; - if (!this.props.leftText) return null; + const { leftTextView, leftText, leftTextStyle, allowFontScaling } = this.props; + + if (leftTextView) return leftTextView; + if (!leftText) return null; return ( - {this.props.leftText} + {leftText} ); } _renderRight() { - if (this.props.rightTextView) return this.props.rightTextView; - if (!this.props.rightText) return null; + const { rightTextView, rightText, rightTextStyle, allowFontScaling } = this.props; + + if (rightTextView) return rightTextView; + if (!rightText) return null; return ( - {this.props.rightText} + {rightText} ); }