diff --git a/Example/Example.js b/Example/Example.js index 7d2c0ac20..5a6877f34 100644 --- a/Example/Example.js +++ b/Example/Example.js @@ -52,103 +52,100 @@ const getSceneStyle = () => ({ shadowRadius: 3, }); -const Example = () => { - return ( +const Example = () => ( + - - - - - - navigation.state.key}/> - - - - - - - + + + + navigation.state.key}/> + + + + + + + + - alert('Right button')} - rightTitle="Right" - /> - - - - Right} - /> - alert('onBack button!')} - backTitle="Back!" - panHandlers={null} - /> - - {}}/> - - + key="tab1_1" + component={TabView} + title="Tab #1_1" + onRight={() => alert('Right button')} + rightTitle="Right" + /> + + + + Right} + /> + alert('onBack button!')} + backTitle="Back!" + panHandlers={null} + /> + {}}/> + + - - - - console.log('onEnter')} - onExit={()=>console.log('onExit')} - leftTitle="Cancel" onLeft={Actions.pop}/> - - + + + + console.log('onEnter')} + onExit={()=>console.log('onExit')} + leftTitle="Cancel" onLeft={Actions.pop}/> + + - ); -} + + ); export default Example; diff --git a/dist/navigationStore.js b/dist/navigationStore.js index b6ccbde01..0254184cb 100644 --- a/dist/navigationStore.js +++ b/dist/navigationStore.js @@ -6,7 +6,6 @@ var _reactNative=require('react-native'); var _reactNavigation=require('react-navigation'); var _NavBar=require('./NavBar'); var _LightboxNavigator=require('./LightboxNavigator');var _LightboxNavigator2=_interopRequireDefault(_LightboxNavigator); -var _OverlayNavigator=require('./OverlayNavigator');var _OverlayNavigator2=_interopRequireDefault(_OverlayNavigator); var _menu_burger=require('../images/menu_burger.png');var _menu_burger2=_interopRequireDefault(_menu_burger); var _Scene=require('./Scene');var _Scene2=_interopRequireDefault(_Scene); var _propTypes=require('prop-types');var _propTypes2=_interopRequireDefault(_propTypes); @@ -66,7 +65,6 @@ var dontInheritKeys=[ 'component', 'wrap', 'modal', -'overlay', 'drawer', 'tabs', 'navigator', @@ -124,7 +122,7 @@ headerStyle:getValue(navigationParams.headerStyle||headerStyle||navigationBarSty headerBackImage:navigationParams.backButtonImage||backButtonImage}); if(NavBar){ -res.header=function(data){return _react2.default.createElement(NavBar,_extends({navigation:navigation},state,data,{__source:{fileName:_jsxFileName,lineNumber:127}}));}; +res.header=function(data){return _react2.default.createElement(NavBar,_extends({navigation:navigation},state,data,{__source:{fileName:_jsxFileName,lineNumber:125}}));}; } if(panHandlers===null){ @@ -132,7 +130,7 @@ res.gesturesEnabled=false; } if(navigationBarTitleImage){ -res.headerTitle=_react2.default.createElement(Image,{source:navigationBarTitleImage,style:navigationBarTitleImageStyle,__source:{fileName:_jsxFileName,lineNumber:135}}); +res.headerTitle=_react2.default.createElement(Image,{source:navigationBarTitleImage,style:navigationBarTitleImageStyle,__source:{fileName:_jsxFileName,lineNumber:133}}); } if(tabBarLabel){ @@ -141,7 +139,7 @@ res.tabBarLabel=tabBarLabel; if(tabBarIcon||icon){ var Icon=tabBarIcon||icon; -res.tabBarIcon=function(data){return _react2.default.createElement(Icon,_extends({},state,data,{__source:{fileName:_jsxFileName,lineNumber:144}}));}; +res.tabBarIcon=function(data){return _react2.default.createElement(Icon,_extends({},state,data,{__source:{fileName:_jsxFileName,lineNumber:142}}));}; } var componentData={}; @@ -159,7 +157,7 @@ if(rightButtonImage||rightTitle||params.renderRightButton||onRight||navigationPa navigationParams.rightTitle||navigationParams.rightButtonImage||rightButtonTextStyle|| (drawerImage||drawerIcon)&&drawerPosition==='right'){ res.headerRight=getValue(navigationParams.right||navigationParams.rightButton||params.renderRightButton,_extends({}, -navigationParams,screenProps))||_react2.default.createElement(RightNavBarButton,_extends({},params,navigationParams,componentData,{__source:{fileName:_jsxFileName,lineNumber:162}})); +navigationParams,screenProps))||_react2.default.createElement(RightNavBarButton,_extends({},params,navigationParams,componentData,{__source:{fileName:_jsxFileName,lineNumber:160}})); } if(leftButtonImage||backButtonImage||backTitle||leftTitle||params.renderLeftButton||leftButtonTextStyle|| @@ -167,12 +165,12 @@ backButtonTextStyle||onLeft||navigationParams.leftTitle||navigationParams.onLeft navigationParams.backButtonImage||navigationParams.backTitle||(drawerImage||drawerIcon)&&drawerPosition!=='right'){ res.headerLeft=getValue(navigationParams.left||navigationParams.leftButton||params.renderLeftButton,_extends({},params,navigationParams,screenProps))|| (onLeft&&(leftTitle||navigationParams.leftTitle||leftButtonImage||navigationParams.leftButtonImage)||drawerImage||drawerIcon)&& -_react2.default.createElement(LeftNavBarButton,_extends({},params,navigationParams,componentData,{__source:{fileName:_jsxFileName,lineNumber:170}}))||( -init?null:renderBackButton&&renderBackButton(state)||_react2.default.createElement(BackNavBarButton,_extends({},state,{__source:{fileName:_jsxFileName,lineNumber:171}}))); +_react2.default.createElement(LeftNavBarButton,_extends({},params,navigationParams,componentData,{__source:{fileName:_jsxFileName,lineNumber:168}}))||( +init?null:renderBackButton&&renderBackButton(state)||_react2.default.createElement(BackNavBarButton,_extends({},state,{__source:{fileName:_jsxFileName,lineNumber:169}}))); } if(back){ -res.headerLeft=renderBackButton&&renderBackButton(state)||_react2.default.createElement(BackNavBarButton,_extends({},state,{__source:{fileName:_jsxFileName,lineNumber:175}})); +res.headerLeft=renderBackButton&&renderBackButton(state)||_react2.default.createElement(BackNavBarButton,_extends({},state,{__source:{fileName:_jsxFileName,lineNumber:173}})); } if(hideTabBar){ @@ -195,7 +193,7 @@ return null; } var wrapper=wrapBy||function(props){return props;}; function wrapped(_ref4){var navigation=_ref4.navigation,props=_objectWithoutProperties(_ref4,['navigation']); -return _react2.default.createElement(Component,_extends({},props,{navigation:navigation},navigation.state.params,{name:navigation.state.routeName,__source:{fileName:_jsxFileName,lineNumber:198}})); +return _react2.default.createElement(Component,_extends({},props,{navigation:navigation},navigation.state.params,{name:navigation.state.routeName,__source:{fileName:_jsxFileName,lineNumber:196}})); } wrapped.propTypes={ navigation:_propTypes2.default.object}; @@ -262,7 +260,7 @@ return null; } var res={}; var order=[];var _scene$props= -scene.props,tabs=_scene$props.tabs,modal=_scene$props.modal,overlay=_scene$props.overlay,lightbox=_scene$props.lightbox,navigator=_scene$props.navigator,contentComponent=_scene$props.contentComponent,lazy=_scene$props.lazy,drawer=_scene$props.drawer,parentProps=_objectWithoutProperties(_scene$props,['tabs','modal','overlay','lightbox','navigator','contentComponent','lazy','drawer']); +scene.props,tabs=_scene$props.tabs,modal=_scene$props.modal,lightbox=_scene$props.lightbox,navigator=_scene$props.navigator,contentComponent=_scene$props.contentComponent,lazy=_scene$props.lazy,drawer=_scene$props.drawer,parentProps=_objectWithoutProperties(_scene$props,['tabs','modal','lightbox','navigator','contentComponent','lazy','drawer']); var commonProps=_extends({},inheritProps,parentProps); delete commonProps.children; @@ -362,9 +360,6 @@ return(0,_reactNavigation.TabNavigator)(res,_extends({lazy:lazy,initialRouteName tabBarOptions:createTabBarOptions(commonProps),navigationOptions:createNavigationOptions(commonProps)})); }else if(drawer){ return(0,_reactNavigation.DrawerNavigator)(res,_extends({initialRouteName:initialRouteName,contentComponent:contentComponent,order:order},commonProps)); -}else if(overlay){ -return(0,_OverlayNavigator2.default)(res,_extends({mode:mode,initialRouteParams:initialRouteParams,order:order,contentComponent:contentComponent,initialRouteName:initialRouteName},commonProps,{ -navigationOptions:createNavigationOptions(commonProps)})); } return(0,_reactNavigation.StackNavigator)(res,_extends({mode:mode,initialRouteParams:initialRouteParams,initialRouteName:initialRouteName},commonProps,{navigationOptions:createNavigationOptions(commonProps)})); };this. diff --git a/src/navigationStore.js b/src/navigationStore.js index 972a0a214..a105886b4 100644 --- a/src/navigationStore.js +++ b/src/navigationStore.js @@ -6,7 +6,6 @@ import { View } from 'react-native'; import { TabNavigator, DrawerNavigator, StackNavigator, NavigationActions } from 'react-navigation'; import { LeftButton, RightButton, BackButton } from './NavBar'; import LightboxNavigator from './LightboxNavigator'; -import OverlayNavigator from './OverlayNavigator'; import _drawerImage from '../images/menu_burger.png'; import Scene from './Scene'; import PropTypes from 'prop-types'; @@ -66,7 +65,6 @@ const dontInheritKeys = [ 'component', 'wrap', 'modal', - 'overlay', 'drawer', 'tabs', 'navigator', @@ -262,7 +260,7 @@ class NavigationStore { } const res = {}; const order = []; - const { tabs, modal, overlay, lightbox, navigator, contentComponent, lazy, drawer, ...parentProps } = scene.props; + const { tabs, modal, lightbox, navigator, contentComponent, lazy, drawer, ...parentProps } = scene.props; const commonProps = { ...inheritProps, ...parentProps }; delete commonProps.children; @@ -362,9 +360,6 @@ class NavigationStore { tabBarOptions: createTabBarOptions(commonProps), navigationOptions: createNavigationOptions(commonProps) }); } else if (drawer) { return DrawerNavigator(res, { initialRouteName, contentComponent, order, ...commonProps }); - } else if (overlay) { - return OverlayNavigator(res, { mode, initialRouteParams, order, contentComponent, initialRouteName, ...commonProps, - navigationOptions: createNavigationOptions(commonProps) }); } return StackNavigator(res, { mode, initialRouteParams, initialRouteName, ...commonProps, navigationOptions: createNavigationOptions(commonProps) }); };