@@ -30,7 +30,9 @@ export default class CheckBox extends Component {
3030 leftText : React . PropTypes . string ,
3131 leftTextView : React . PropTypes . element ,
3232 rightText : React . PropTypes . string ,
33+ leftTextStyle : React . PropTypes . object ,
3334 rightTextView : React . PropTypes . string ,
35+ rightTextStyle : React . PropTypes . object ,
3436 checkedImage : React . PropTypes . element ,
3537 unCheckedImage : React . PropTypes . element ,
3638 onClick : React . PropTypes . func . isRequired ,
@@ -39,20 +41,22 @@ export default class CheckBox extends Component {
3941 }
4042 static defaultProps = {
4143 isChecked : false ,
44+ leftTextStyle : { } ,
45+ rightTextStyle : { }
4246 }
4347
4448 _renderLeft ( ) {
4549 if ( this . props . leftTextView ) return this . props . leftTextView ;
4650 if ( ! this . props . leftText ) return null ;
4751 return (
48- < Text style = { styles . leftText } > { this . props . leftText } </ Text >
52+ < Text style = { [ styles . leftText , this . props . leftTextStyle ] } > { this . props . leftText } </ Text >
4953 )
5054 }
5155 _renderRight ( ) {
5256 if ( this . props . rightTextView ) return this . props . rightTextView ;
5357 if ( ! this . props . rightText ) return null ;
5458 return (
55- < Text style = { styles . rightText } > { this . props . rightText } </ Text >
59+ < Text style = { [ styles . rightText , this . props . rightTextStyle ] } > { this . props . rightText } </ Text >
5660 )
5761 }
5862
0 commit comments