@@ -30,7 +30,9 @@ export default class CheckBox extends Component {
30
30
leftText : React . PropTypes . string ,
31
31
leftTextView : React . PropTypes . element ,
32
32
rightText : React . PropTypes . string ,
33
+ leftTextStyle : React . PropTypes . object ,
33
34
rightTextView : React . PropTypes . string ,
35
+ rightTextStyle : React . PropTypes . object ,
34
36
checkedImage : React . PropTypes . element ,
35
37
unCheckedImage : React . PropTypes . element ,
36
38
onClick : React . PropTypes . func . isRequired ,
@@ -39,20 +41,22 @@ export default class CheckBox extends Component {
39
41
}
40
42
static defaultProps = {
41
43
isChecked : false ,
44
+ leftTextStyle : { } ,
45
+ rightTextStyle : { }
42
46
}
43
47
44
48
_renderLeft ( ) {
45
49
if ( this . props . leftTextView ) return this . props . leftTextView ;
46
50
if ( ! this . props . leftText ) return null ;
47
51
return (
48
- < Text style = { styles . leftText } > { this . props . leftText } </ Text >
52
+ < Text style = { [ styles . leftText , this . props . leftTextStyle ] } > { this . props . leftText } </ Text >
49
53
)
50
54
}
51
55
_renderRight ( ) {
52
56
if ( this . props . rightTextView ) return this . props . rightTextView ;
53
57
if ( ! this . props . rightText ) return null ;
54
58
return (
55
- < Text style = { styles . rightText } > { this . props . rightText } </ Text >
59
+ < Text style = { [ styles . rightText , this . props . rightTextStyle ] } > { this . props . rightText } </ Text >
56
60
)
57
61
}
58
62
0 commit comments