Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allowFontScaling props #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add allowFontScaling props
yasaricli committed Jan 7, 2020
commit a4006d8a38bef2c2c449504a527f87cca9665860
16 changes: 10 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -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>
);
}