diff --git a/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js b/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js index dd002fe25..e0ea2ce8c 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js @@ -11,7 +11,6 @@ 'use strict'; const Image = require('Image'); -const PropTypes = require('prop-types'); const React = require('React'); const Text = require('Text'); const TouchableHighlight = require('TouchableHighlight'); @@ -27,43 +26,37 @@ import type {ImageSource} from 'ImageSource'; */ class SwipeableQuickActionButton extends React.Component<{ accessibilityLabel?: string, - imageSource: ImageSource | number, + imageSource?: ?(ImageSource | number), imageStyle?: ?ViewPropTypes.style, + mainView?: ?React.Node, onPress?: Function, style?: ?ViewPropTypes.style, testID?: string, text?: ?(string | Object | Array), textStyle?: ?ViewPropTypes.style, }> { - static propTypes = { - accessibilityLabel: PropTypes.string, - imageSource: Image.propTypes.source.isRequired, - imageStyle: Image.propTypes.style, - onPress: PropTypes.func, - style: ViewPropTypes.style, - testID: PropTypes.string, - text: PropTypes.string, - textStyle: Text.propTypes.style, - }; - render(): React.Node { - if (!this.props.imageSource && !this.props.text) { + if (!this.props.imageSource && !this.props.text && !this.props.mainView) { return null; } - + const mainView = this.props.mainView ? ( + this.props.mainView + ) : ( + + + {this.props.text} + + ); return ( - - - {this.props.text} - + {mainView} ); }