From a4006d8a38bef2c2c449504a527f87cca9665860 Mon Sep 17 00:00:00 2001 From: Yasar icli <yasaricli@gmail.com> Date: Tue, 7 Jan 2020 15:52:33 +0300 Subject: [PATCH 1/2] add allowFontScaling props --- index.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 7fb0df3..a74ed46 100755 --- a/index.js +++ b/index.js @@ -63,18 +63,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 ( - <Text style={[styles.leftText, this.props.leftTextStyle]}>{this.props.leftText}</Text> + <Text style={[styles.leftText, leftTextStyle]} allowFontScaling={allowFontScaling}>{leftText}</Text> ); } _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 ( - <Text style={[styles.rightText, this.props.rightTextStyle]}>{this.props.rightText}</Text> + <Text style={[styles.rightText, rightTextStyle]} allowFontScaling={allowFontScaling}>{rightText}</Text> ); } From f4d54b7026b165aa1e35eb020e977067d70b8edb Mon Sep 17 00:00:00 2001 From: Yasar icli <yasaricli@gmail.com> Date: Tue, 7 Jan 2020 15:56:00 +0300 Subject: [PATCH 2/2] add allowFontScaling to defaultProps and propTypes --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a74ed46..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() {