File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
generatedTypes/components/checkbox Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { StyleProp , TouchableOpacityProps , ViewStyle , TextStyle } from 'react-native' ;
3
+ import { TextProps } from '../text' ;
3
4
export interface CheckboxProps extends TouchableOpacityProps {
4
5
/**
5
6
* The value of the Checkbox. If true the switch will be turned on. Default value is false.
@@ -45,6 +46,10 @@ export interface CheckboxProps extends TouchableOpacityProps {
45
46
* The style of the label
46
47
*/
47
48
labelStyle ?: StyleProp < TextStyle > ;
49
+ /**
50
+ * Props that will be passed to the checkbox Text label.
51
+ */
52
+ labelProps ?: Omit < TextProps , 'style' > ;
48
53
/**
49
54
* Additional styling
50
55
*/
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import {Colors, Spacings} from '../../style';
15
15
import Assets from '../../assets' ;
16
16
import { asBaseComponent } from '../../commons/new' ;
17
17
import TouchableOpacity from '../touchableOpacity' ;
18
- import Text from '../text' ;
18
+ import Text , { TextProps } from '../text' ;
19
19
import View from '../view' ;
20
20
21
21
const DEFAULT_SIZE = 24 ;
@@ -71,6 +71,10 @@ export interface CheckboxProps extends TouchableOpacityProps {
71
71
* The style of the label
72
72
*/
73
73
labelStyle ?: StyleProp < TextStyle > ;
74
+ /**
75
+ * Props that will be passed to the checkbox Text label.
76
+ */
77
+ labelProps ?: Omit < TextProps , 'style' > ;
74
78
/**
75
79
* Additional styling
76
80
*/
@@ -236,11 +240,11 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
236
240
}
237
241
238
242
render ( ) {
239
- const { label, labelStyle, containerStyle} = this . props ;
243
+ const { label, labelStyle, containerStyle, labelProps } = this . props ;
240
244
return label ? (
241
245
< View row centerV style = { [ containerStyle ] } >
242
246
{ this . renderCheckbox ( ) }
243
- < Text style = { [ this . styles . checkboxLabel , labelStyle ] } onPress = { this . onPress } >
247
+ < Text style = { [ this . styles . checkboxLabel , labelStyle ] } { ... labelProps } onPress = { this . onPress } >
244
248
{ label }
245
249
</ Text >
246
250
</ View >
You can’t perform that action at this time.
0 commit comments