Skip to content

Commit ce7ad22

Browse files
remagpieTrancever
authored andcommittedMay 5, 2020
feat: add color and uncheckedColor prop to RadioButton.Item (#1892)
1 parent 132570c commit ce7ad22

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed
 

‎src/components/RadioButton/RadioButtonItem.tsx

+16-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export type Props = {
2727
* Function to execute on press.
2828
*/
2929
onPress?: () => void;
30+
/**
31+
* Custom color for unchecked radio.
32+
*/
33+
uncheckedColor?: string;
34+
/**
35+
* Custom color for radio.
36+
*/
37+
color?: string;
3038
/**
3139
* Status of radio button.
3240
*/
@@ -90,6 +98,8 @@ class RadioButtonItem extends React.Component<Props> {
9098
style,
9199
labelStyle,
92100
onPress,
101+
color,
102+
uncheckedColor,
93103
status,
94104
theme: { colors },
95105
} = this.props;
@@ -113,7 +123,12 @@ class RadioButtonItem extends React.Component<Props> {
113123
>
114124
{label}
115125
</Text>
116-
<RadioButton value={value} status={status}></RadioButton>
126+
<RadioButton
127+
value={value}
128+
status={status}
129+
color={color}
130+
uncheckedColor={uncheckedColor}
131+
/>
117132
</View>
118133
</TouchableRipple>
119134
);

0 commit comments

Comments
 (0)