From 17e4d03af7ec638999b5be9c57d5867396c78d82 Mon Sep 17 00:00:00 2001 From: Darren Date: Wed, 13 Jul 2016 10:28:11 +0930 Subject: [PATCH] Allow the RadioButton label to be able to display a view element or plain text --- lib/RadioButton.js | 21 ++++++++++++--------- lib/RadioButtonGroup.js | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/RadioButton.js b/lib/RadioButton.js index 654e8a3..867e21f 100644 --- a/lib/RadioButton.js +++ b/lib/RadioButton.js @@ -9,7 +9,7 @@ const typos = StyleSheet.create(TYPO); export default class RadioButton extends Component { static propTypes = { - label: PropTypes.string, + label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]), theme: PropTypes.oneOf(THEME_NAME), primary: PropTypes.oneOf(PRIMARY_COLORS), value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, @@ -101,18 +101,21 @@ export default class RadioButton extends Component { /> - {this.props.label} + } diff --git a/lib/RadioButtonGroup.js b/lib/RadioButtonGroup.js index 3f7a8ce..edd771f 100644 --- a/lib/RadioButtonGroup.js +++ b/lib/RadioButtonGroup.js @@ -19,7 +19,7 @@ export default class RadioButtonGroup extends Component { selected: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), items: PropTypes.arrayOf(PropTypes.shape({ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, - label: PropTypes.string, + label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]), disabled: PropTypes.bool })) };