Pull createMaterialBottomTabNavigator into separate repo

This commit is contained in:
Brent Vatne
2018-05-04 11:06:51 -07:00
parent 8e52995ef3
commit 2643f690a9
8 changed files with 68 additions and 92 deletions

View File

@@ -322,7 +322,7 @@ const AppNavigator = createStackNavigator(
}
);
export default () => <AppNavigator persistenceKey="NavState" />;
export default AppNavigator;
const styles = StyleSheet.create({
item: {

View File

@@ -4,10 +4,8 @@
import React from 'react';
import { SafeAreaView, StatusBar, Text, View } from 'react-native';
import {
createBottomTabNavigator,
withNavigationFocus,
} from 'react-navigation';
import { withNavigationFocus } from 'react-navigation';
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import { Button } from './commonComponents/ButtonWithMargin';
@@ -80,16 +78,26 @@ const createTabScreen = (name, icon, focusedIcon, tintColor = '#673ab7') => {
return withNavigationFocus(TabScreen);
};
const TabsWithNavigationFocus = createBottomTabNavigator({
One: {
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
const TabsWithNavigationFocus = createMaterialBottomTabNavigator(
{
One: {
screen: createTabScreen('One', 'numeric-1-box-outline', 'numeric-1-box'),
},
Two: {
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
},
Three: {
screen: createTabScreen(
'Three',
'numeric-3-box-outline',
'numeric-3-box'
),
},
},
Two: {
screen: createTabScreen('Two', 'numeric-2-box-outline', 'numeric-2-box'),
},
Three: {
screen: createTabScreen('Three', 'numeric-3-box-outline', 'numeric-3-box'),
},
});
{
shifting: false,
activeTintColor: '#F44336',
}
);
export default TabsWithNavigationFocus;

View File

@@ -16,7 +16,8 @@
"react-native": "^0.54.0",
"react-native-iphone-x-helper": "^1.0.2",
"react-navigation": "link:../..",
"react-navigation-header-buttons": "^0.0.4"
"react-navigation-header-buttons": "^0.0.4",
"react-navigation-material-bottom-tabs": "0.1.3"
},
"devDependencies": {
"babel-jest": "^22.4.1",

View File

@@ -2110,6 +2110,13 @@ create-react-context@^0.2.1:
fbjs "^0.8.0"
gud "^1.0.0"
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:
fbjs "^0.8.0"
gud "^1.0.0"
cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
@@ -2220,7 +2227,7 @@ deepmerge@^1.3.0, deepmerge@^1.5.1:
version "1.5.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753"
deepmerge@^2.0.1:
deepmerge@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.1.0.tgz#511a54fff405fc346f0240bb270a3e9533a31102"
@@ -5550,6 +5557,10 @@ react-lifecycles-compat@^1.0.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-1.1.4.tgz#fc005c72849b7ed364de20a0f64ff58ebdc2009a"
react-lifecycles-compat@^3, react-lifecycles-compat@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.2.tgz#7279047275bd727a912e25f734c0559527e84eff"
react-native-branch@2.0.0-beta.3:
version "2.0.0-beta.3"
resolved "https://registry.yarnpkg.com/react-native-branch/-/react-native-branch-2.0.0-beta.3.tgz#2167af86bbc9f964bd45bd5f37684e5b54965e32"
@@ -5589,14 +5600,15 @@ react-native-iphone-x-helper@^1.0.2:
babel-plugin-module-resolver "^2.3.0"
babel-preset-react-native "1.9.0"
react-native-paper@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-1.2.5.tgz#3a4480ca967aae4b3e65a987116973dd012d1fa8"
react-native-paper@=1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-1.4.0.tgz#33bd477cde1468b63e60bdb0c9a500822d03cdca"
dependencies:
color "^2.0.1"
create-react-context "^0.2.1"
deepmerge "^2.0.1"
create-react-context "^0.2.2"
deepmerge "^2.1.0"
hoist-non-react-statics "^2.5.0"
react-lifecycles-compat "^3.0.2"
react-native-platform-touchable@^1.1.1:
version "1.1.1"
@@ -5642,9 +5654,9 @@ react-native-svg@6.2.2:
lodash "^4.16.6"
pegjs "^0.10.0"
"react-native-tab-view@github:react-navigation/react-native-tab-view":
react-native-tab-view@^0.0.74:
version "0.0.74"
resolved "https://codeload.github.com/react-navigation/react-native-tab-view/tar.gz/36ebd834d78b841fc19778c966465d02fd1213bb"
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.74.tgz#62c0c882d9232b461ce181d440d683b4f99d1bd8"
dependencies:
prop-types "^15.6.0"
@@ -5725,11 +5737,11 @@ react-native@^0.54.0:
xmldoc "^0.4.0"
yargs "^9.0.0"
react-navigation-deprecated-tab-navigator@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.0.1.tgz#a869d749d16116630411d6c7761c51484ba90175"
react-navigation-deprecated-tab-navigator@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.1.0.tgz#58945c1c4c7c21b54954e814e8721e98423df75d"
dependencies:
react-native-tab-view react-navigation/react-native-tab-view
react-native-tab-view "^0.0.74"
react-navigation-header-buttons@^0.0.4:
version "0.0.4"
@@ -5737,14 +5749,22 @@ react-navigation-header-buttons@^0.0.4:
dependencies:
react-native-platform-touchable "^1.1.1"
react-navigation-tabs@0.1.0-alpha.5:
version "0.1.0-alpha.5"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.1.0-alpha.5.tgz#51cae3ea5f0f77bdf0deb50a855a5dcaa2f9bf1e"
react-navigation-material-bottom-tabs@0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/react-navigation-material-bottom-tabs/-/react-navigation-material-bottom-tabs-0.1.3.tgz#8e11c3d57ebb72d19adf5e4764390729ed964072"
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.0"
react-native-paper "=1.4.0"
react-navigation-tabs "0.2.0-rc.0"
react-navigation-tabs@0.2.0-rc.0:
version "0.2.0-rc.0"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.2.0-rc.0.tgz#671e8c9914b915796879329752f7240147494038"
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.0"
react-lifecycles-compat "^1.0.2"
react-native-paper "^1.2.5"
react-native-safe-area-view "^0.7.0"
react-native-tab-view "~0.0.77"