From a70a44eb19271ed045f55121f96eb72b9432e965 Mon Sep 17 00:00:00 2001 From: Vincent Catillon Date: Tue, 5 Feb 2019 23:48:51 +0100 Subject: [PATCH 1/3] Add activityIndicator prop support --- Button.js | 5 +++++ Example/button/Example.js | 15 +++++++++++++++ README.md | 1 + __tests__/Button.test.js | 11 ++++++++++- 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Button.js b/Button.js index 3cdb551..ed1861e 100644 --- a/Button.js +++ b/Button.js @@ -28,6 +28,7 @@ class Button extends Component { allowFontScaling: PropTypes.bool, isLoading: PropTypes.bool, isDisabled: PropTypes.bool, + activityIndicator: PropTypes.object, activityIndicatorColor: PropTypes.string, delayLongPress: PropTypes.number, delayPressIn: PropTypes.number, @@ -70,6 +71,10 @@ class Button extends Component { _renderInnerText() { if (this.props.isLoading) { + if (this.props.activityIndicator) { + return this.props.activityIndicator; + } + return ( Hello + + ) + const tree = component.toJSON() + expect(tree).toMatchSnapshot() + }) test('Renders with a inner View', () => { const component = renderer.create(