From a5666a62bf2ded1f759ec220359f3368e0a33e23 Mon Sep 17 00:00:00 2001 From: aksonov Date: Wed, 12 Jul 2017 21:18:26 +0200 Subject: [PATCH] support onRight/rightTitle/rightButtonImage for Actions.refresh --- Example/Example.js | 2 +- Example/components/Login.js | 7 +++++++ src/Router.js | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Example/Example.js b/Example/Example.js index 661d643dc..1cd3f7ee8 100644 --- a/Example/Example.js +++ b/Example/Example.js @@ -114,7 +114,7 @@ class Example extends Component { - {}} > + {}, + }); + } render() { const title = this.props.title || 'No Title'; const data = this.props.data || 'No Data'; diff --git a/src/Router.js b/src/Router.js index 274e7aa2a..c18c462c9 100644 --- a/src/Router.js +++ b/src/Router.js @@ -103,12 +103,15 @@ function createNavigationOptions(params) { res.tabBarIcon = tabBarIcon || icon; } - if ((rightButtonImage || rightTitle || params.renderRightButton) && onRight) { + if (rightButtonImage || rightTitle || params.renderRightButton || onRight || navigationParams.onRight + || navigationParams.rightTitle || navigationParams.rightButtonImage) { res.headerRight = getValue(navigationParams.right || right || rightButton || params.renderRightButton, { ...navigationParams, ...screenProps }) || renderRightButton({ ...params, ...navigationParams }); } - if (leftButtonImage || backButtonImage || backTitle || leftTitle || params.renderLeftButton || leftButtonTextStyle || backButtonTextStyle || onLeft) { + if (leftButtonImage || backButtonImage || backTitle || leftTitle || params.renderLeftButton || leftButtonTextStyle + || backButtonTextStyle || onLeft || navigationParams.leftTitle || navigationParams.onLeft || navigationParams.leftButtonImage + || navigationParams.backButtonImage || navigationParams.backTitle) { res.headerLeft = getValue(navigationParams.left || left || leftButton || params.renderLeftButton, { ...params, ...navigationParams, ...screenProps }) || renderLeftButton({ ...params, ...navigationParams }) || (init ? null : renderBackButton({ ...params, ...navigationParams, ...screenProps })); }