From 567310b9d66052f4e38d3d4394aec58a143ee3ee Mon Sep 17 00:00:00 2001 From: Chris Duarte Date: Thu, 23 Feb 2017 15:04:59 -0800 Subject: [PATCH] PLT-5572 Add swiping to close all scenes that open from the side (#292) --- app/navigation/router.js | 10 +++++++--- app/scenes/channel/channel.js | 2 +- app/scenes/navigationSceneConnect.js | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/navigation/router.js b/app/navigation/router.js index daf160a31..e46d81e5d 100644 --- a/app/navigation/router.js +++ b/app/navigation/router.js @@ -101,10 +101,14 @@ class Router extends React.Component { }; } + // NavigationExperimental only creates the correct panHandlers if the panHandlers prop === undefined + const panHandlers = navigationProps.allowSceneSwipe ? undefined : null; // eslint-disable-line + return ( @@ -214,7 +218,7 @@ class Router extends React.Component { panOpenMask={0.1} panCloseMask={0.2} panThreshold={0.2} - acceptPan={navigationProps.allowSwipe} + acceptPan={navigationProps.allowMenuSwipe} negotiatePan={true} useInteractionManager={true} > diff --git a/app/scenes/channel/channel.js b/app/scenes/channel/channel.js index d827dce02..1f79e9099 100644 --- a/app/scenes/channel/channel.js +++ b/app/scenes/channel/channel.js @@ -41,7 +41,7 @@ export default class Channel extends React.PureComponent { }; static navigationProps = { - allowSwipe: true, + allowMenuSwipe: true, renderLeftComponent: (props, emitter) => { return ; }, diff --git a/app/scenes/navigationSceneConnect.js b/app/scenes/navigationSceneConnect.js index b4b8728d9..485689c7f 100644 --- a/app/scenes/navigationSceneConnect.js +++ b/app/scenes/navigationSceneConnect.js @@ -53,7 +53,8 @@ const defaults = { flexDirection: 'row', alignItems: 'center' }, - allowSwipe: false + allowSceneSwipe: true, + allowMenuSwipe: false }; export default (stateProps, dispatchProps) => (WrappedComponent) => {