From 71f0fae206f768d32aa1817187c2ee01be5d14fa Mon Sep 17 00:00:00 2001 From: "Davis Z. Cabral" Date: Thu, 13 Sep 2018 12:04:10 -0300 Subject: [PATCH] Closes #3163: Bring TabBarTop and TabBarBottom back to LegacyTabs (#3265) * Closes #3163: Bring TabBarTop and TabBarBottom back to LegacyTabs * Lint --- ReduxExample/yarn.lock | 35 ++++++++++++++--------------------- package.json | 3 ++- src/navigationStore.js | 9 ++++++++- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/ReduxExample/yarn.lock b/ReduxExample/yarn.lock index ff3ac0133..71f22d168 100644 --- a/ReduxExample/yarn.lock +++ b/ReduxExample/yarn.lock @@ -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: +create-react-context@0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca" dependencies: @@ -4368,13 +4368,7 @@ react-native-drawer-layout@1.3.2: 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" @@ -4468,26 +4462,25 @@ 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" @@ -4495,8 +4488,8 @@ react-navigation@2.12.x: 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" diff --git a/package.json b/package.json index 31412d261..2116ad88f 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,8 @@ }, "peerDependencies": { "react": "*", - "react-native": "*" + "react-native": "*", + "react-navigation-deprecated-tab-navigator": "*" }, "jest": { "preset": "react-native", diff --git a/src/navigationStore.js b/src/navigationStore.js index 9101da282..b1786ab1f 100644 --- a/src/navigationStore.js +++ b/src/navigationStore.js @@ -3,7 +3,6 @@ import { StatusBar, Image, Animated, Easing, } from 'react-native'; import { - createTabNavigator as DEPRECATED_createTabNavigator, createBottomTabNavigator, createMaterialTopTabNavigator, createDrawerNavigator, @@ -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'; @@ -813,6 +817,9 @@ class NavigationStore { let createTabNavigator = createMaterialTopTabNavigator; if (legacy) { createTabNavigator = DEPRECATED_createTabNavigator; + if (!tabBarComponent) { + tabBarComponent = tabBarPosition === 'top' ? props => : props => ; + } } else if (tabBarPosition !== 'top') { createTabNavigator = createBottomTabNavigator; }