Skip to content

Commit

Permalink
Closes #3163: Bring TabBarTop and TabBarBottom back to LegacyTabs (#3265
Browse files Browse the repository at this point in the history
)

* Closes #3163: Bring TabBarTop and TabBarBottom back to LegacyTabs

* Lint
  • Loading branch information
daviscabral authored and aksonov committed Sep 13, 2018
1 parent 14269ff commit 71f0fae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
35 changes: 14 additions & 21 deletions ReduxExample/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ create-react-class@^15.6.3:
loose-envify "^1.3.1"
object-assign "^4.1.1"

create-react-context@^0.2.1:
[email protected].2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca"
dependencies:
Expand Down Expand Up @@ -4368,13 +4368,7 @@ [email protected]:
opencollective "^1.0.3"
path-to-regexp "^2.4.0"
prop-types "^15.6.2"
react-navigation "2.12.x"

react-native-safe-area-view@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.7.0.tgz#38f5ab9368d6ef9e5d18ab64212938af3ec39421"
dependencies:
hoist-non-react-statics "^2.3.1"
react-navigation "2.13.x"

react-native-safe-area-view@^0.9.0:
version "0.9.0"
Expand Down Expand Up @@ -4468,35 +4462,34 @@ react-navigation-redux-helpers@^2.0.5:
dependencies:
invariant "^2.2.2"

react-navigation-stack@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.2.3.tgz#9d1e2524aa1d178302c938948b8ece49d713f12b"
react-navigation-stack@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.3.0.tgz#cdd056771e5fd12114811824653b1ec7e9ae5de1"

react-navigation-tabs@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.6.0.tgz#2f526194f4360e56c2702e736887449acc2080dc"
react-navigation-tabs@0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.7.0.tgz#c89d41e501043f7fdb38550de85814452c3e6104"
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.1"
react-lifecycles-compat "^3.0.4"
react-native-safe-area-view "^0.7.0"
react-native-tab-view "^1.0.0"

react-navigation@2.12.x:
version "2.12.1"
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.12.1.tgz#17122a4162cd5a65d79814385cd61c2c0cb7ebb5"
react-navigation@2.13.x:
version "2.13.0"
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.13.0.tgz#7102ff7cbc492c8daf2ad90fc80463c3469f8b78"
dependencies:
clamp "^1.0.1"
create-react-context "^0.2.1"
create-react-context "0.2.2"
hoist-non-react-statics "^2.2.0"
path-to-regexp "^1.7.0"
query-string "^6.1.0"
react-lifecycles-compat "^3"
react-native-safe-area-view "^0.9.0"
react-navigation-deprecated-tab-navigator "1.3.0"
react-navigation-drawer "0.5.0"
react-navigation-stack "0.2.3"
react-navigation-tabs "0.6.0"
react-navigation-stack "0.3.0"
react-navigation-tabs "0.7.0"

react-proxy@^1.1.7:
version "1.1.8"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"react-native": "*",
"react-navigation-deprecated-tab-navigator": "*"
},
"jest": {
"preset": "react-native",
Expand Down
9 changes: 8 additions & 1 deletion src/navigationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
StatusBar, Image, Animated, Easing,
} from 'react-native';
import {
createTabNavigator as DEPRECATED_createTabNavigator,
createBottomTabNavigator,
createMaterialTopTabNavigator,
createDrawerNavigator,
Expand All @@ -12,6 +11,11 @@ import {
StackActions,
DrawerActions,
} from 'react-navigation';
import {
createTabNavigator as DEPRECATED_createTabNavigator,
TabBarTop as DEPRECATED_TabBarTop,
TabBarBottom as DEPRECATED_TabBarBottom,
} from 'react-navigation-deprecated-tab-navigator';
import PropTypes from 'prop-types';
import { reducer } from './Reducer';
import * as ActionConst from './ActionConst';
Expand Down Expand Up @@ -813,6 +817,9 @@ class NavigationStore {
let createTabNavigator = createMaterialTopTabNavigator;
if (legacy) {
createTabNavigator = DEPRECATED_createTabNavigator;
if (!tabBarComponent) {
tabBarComponent = tabBarPosition === 'top' ? props => <DEPRECATED_TabBarTop {...props} {...commonProps} /> : props => <DEPRECATED_TabBarBottom {...props} {...commonProps} />;
}
} else if (tabBarPosition !== 'top') {
createTabNavigator = createBottomTabNavigator;
}
Expand Down

0 comments on commit 71f0fae

Please sign in to comment.