Skip to content

Commit 23b1585

Browse files
author
aksonov
committed
Fixes #2288
1 parent 97438e3 commit 23b1585

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

dist/navigationStore.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ return null;
318318
}
319319
var res={};
320320
var order=[];var _scene$props=
321-
scene.props,navigator=_scene$props.navigator,contentComponent=_scene$props.contentComponent,tabBarPosition=_scene$props.tabBarPosition,lazy=_scene$props.lazy,duration=_scene$props.duration,parentProps=_objectWithoutProperties(_scene$props,['navigator','contentComponent','tabBarPosition','lazy','duration']);var
322-
tabs=parentProps.tabs,modal=parentProps.modal,lightbox=parentProps.lightbox,overlay=parentProps.overlay,drawer=parentProps.drawer,tabBarComponent=parentProps.tabBarComponent,transitionConfig=parentProps.transitionConfig;
321+
scene.props,navigator=_scene$props.navigator,contentComponent=_scene$props.contentComponent,lazy=_scene$props.lazy,duration=_scene$props.duration,parentProps=_objectWithoutProperties(_scene$props,['navigator','contentComponent','lazy','duration']);var
322+
tabs=parentProps.tabs,modal=parentProps.modal,lightbox=parentProps.lightbox,overlay=parentProps.overlay,tabBarPosition=parentProps.tabBarPosition,drawer=parentProps.drawer,tabBarComponent=parentProps.tabBarComponent,transitionConfig=parentProps.transitionConfig;
323323
if(scene.type===_Modal2.default){
324324
modal=true;
325325
}else if(scene.type===_Drawer2.default){
@@ -436,6 +436,9 @@ if(!tabBarComponent){
436436
tabBarComponent=tabBarPosition==='top'?function(props){return _react2.default.createElement(_reactNavigation.TabBarTop,_extends({},props,commonProps,{__source:{fileName:_jsxFileName,lineNumber:436}}));}:
437437
function(props){return _react2.default.createElement(_reactNavigation.TabBarBottom,_extends({},props,commonProps,{__source:{fileName:_jsxFileName,lineNumber:437}}));};
438438
}
439+
if(!tabBarPosition){
440+
tabBarPosition=_reactNative.Platform.OS==='android'?'top':'bottom';
441+
}
439442
return(0,_reactNavigation.TabNavigator)(res,_extends({lazy:lazy,tabBarComponent:tabBarComponent,tabBarPosition:tabBarPosition,initialRouteName:initialRouteName,initialRouteParams:initialRouteParams,order:order},commonProps,{
440443
tabBarOptions:createTabBarOptions(commonProps),navigationOptions:createNavigationOptions(commonProps)}));
441444
}else if(drawer){

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-router-flux",
3-
"version": "4.0.0-beta.20",
3+
"version": "4.0.0-beta.21",
44
"description": "React Native Router using Flux architecture",
55
"repository": {
66
"type": "git",

src/navigationStore.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { observable, action } from 'mobx';
33
import * as ActionConst from './ActionConst';
44
import { OnEnter, OnExit, assert } from './Util';
5-
import { View, Image, Animated, Easing } from 'react-native';
5+
import { View, Image, Animated, Easing, Platform } from 'react-native';
66
import { TabNavigator, DrawerNavigator, StackNavigator, NavigationActions, TabBarTop, TabBarBottom } from 'react-navigation';
77
import { LeftButton, RightButton, BackButton } from './NavBar';
88
import LightboxNavigator from './LightboxNavigator';
@@ -318,8 +318,8 @@ class NavigationStore {
318318
}
319319
const res = {};
320320
const order = [];
321-
const { navigator, contentComponent, tabBarPosition, lazy, duration, ...parentProps } = scene.props;
322-
let { tabs, modal, lightbox, overlay, drawer, tabBarComponent, transitionConfig } = parentProps;
321+
const { navigator, contentComponent, lazy, duration, ...parentProps } = scene.props;
322+
let { tabs, modal, lightbox, overlay, tabBarPosition, drawer, tabBarComponent, transitionConfig } = parentProps;
323323
if (scene.type === Modal) {
324324
modal = true;
325325
} else if (scene.type === Drawer) {
@@ -436,6 +436,9 @@ class NavigationStore {
436436
tabBarComponent = tabBarPosition === 'top' ? (props) => <TabBarTop {...props} {...commonProps} /> :
437437
(props) => <TabBarBottom {...props} {...commonProps} />;
438438
}
439+
if (!tabBarPosition) {
440+
tabBarPosition = Platform.OS === 'android' ? 'top' : 'bottom';
441+
}
439442
return TabNavigator(res, { lazy, tabBarComponent, tabBarPosition, initialRouteName, initialRouteParams, order, ...commonProps,
440443
tabBarOptions: createTabBarOptions(commonProps), navigationOptions: createNavigationOptions(commonProps) });
441444
} else if (drawer) {

0 commit comments

Comments
 (0)