mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
feat: put material bottom tabs in another repository
This commit is contained in:
@@ -4,7 +4,6 @@ import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
||||
import { createStackNavigator } from 'react-navigation';
|
||||
import BottomTabs from './src/BottomTabs';
|
||||
import MaterialTopTabs from './src/MaterialTopTabs';
|
||||
import MaterialBottomTabs from './src/MaterialBottomTabs';
|
||||
|
||||
class Home extends React.Component {
|
||||
render() {
|
||||
@@ -22,12 +21,6 @@ class Home extends React.Component {
|
||||
>
|
||||
<Text>Material top tabs</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity
|
||||
style={styles.item}
|
||||
onPress={() => this.props.navigation.push('MaterialBottomTabs')}
|
||||
>
|
||||
<Text>Material bottom tabs</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -37,7 +30,6 @@ const App = createStackNavigator({
|
||||
Home,
|
||||
BottomTabs,
|
||||
MaterialTopTabs,
|
||||
MaterialBottomTabs,
|
||||
});
|
||||
|
||||
const styles = {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"react-native-paper": "^1.2.4",
|
||||
"react-native-safe-area-view": "^0.7.0",
|
||||
"react-native-tab-view": "^0.0.74",
|
||||
"react-navigation": "^2.0.0-alpha.5"
|
||||
"react-navigation": "^2.0.0-rc.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-module-resolver": "^3.0.0",
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import { View, Text } from 'react-native';
|
||||
import { createMaterialBottomTabNavigator } from 'react-navigation-tabs';
|
||||
import { MaterialIcons } from '@expo/vector-icons';
|
||||
|
||||
const tabBarIcon = name => ({ tintColor }) => (
|
||||
<MaterialIcons
|
||||
style={{ backgroundColor: 'transparent' }}
|
||||
name={name}
|
||||
color={tintColor}
|
||||
size={24}
|
||||
/>
|
||||
);
|
||||
|
||||
class Album extends React.Component {
|
||||
static navigationOptions = {
|
||||
tabBarColor: '#3F51B5',
|
||||
tabBarIcon: tabBarIcon('photo-album'),
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Album</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Library extends React.Component {
|
||||
static navigationOptions = {
|
||||
tabBarColor: '#009688',
|
||||
tabBarIcon: tabBarIcon('photo-library'),
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Library</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class History extends React.Component {
|
||||
static navigationOptions = {
|
||||
tabBarColor: '#795548',
|
||||
tabBarIcon: tabBarIcon('history'),
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Text>History</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Cart extends React.Component {
|
||||
static navigationOptions = {
|
||||
tabBarColor: '#607D8B',
|
||||
tabBarIcon: tabBarIcon('shopping-cart'),
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Cart</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default createMaterialBottomTabNavigator(
|
||||
{
|
||||
Album,
|
||||
Library,
|
||||
History,
|
||||
Cart,
|
||||
},
|
||||
{
|
||||
shifting: false,
|
||||
activeTintColor: '#F44336',
|
||||
}
|
||||
);
|
||||
@@ -1432,6 +1432,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"
|
||||
@@ -1541,7 +1548,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.0.1, deepmerge@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.1.0.tgz#511a54fff405fc346f0240bb270a3e9533a31102"
|
||||
|
||||
@@ -4018,6 +4025,10 @@ react-lifecycles-compat@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-1.0.2.tgz#551d8b1d156346e5fcf30ffac9b32ce3f78b8850"
|
||||
|
||||
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"
|
||||
@@ -4057,6 +4068,16 @@ react-native-paper@^1.2.4:
|
||||
deepmerge "^2.0.1"
|
||||
hoist-non-react-statics "^2.5.0"
|
||||
|
||||
react-native-paper@^1.4.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-1.5.0.tgz#36bf1b9e6aeb86b208f52c85312bfd41834963ca"
|
||||
dependencies:
|
||||
color "^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-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"
|
||||
@@ -4102,6 +4123,12 @@ react-native-tab-view@^0.0.74:
|
||||
dependencies:
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react-native-tab-view@~0.0.77:
|
||||
version "0.0.77"
|
||||
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz#11ceb8e7c23100d07e628dc151b57797524d00d4"
|
||||
dependencies:
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react-native-vector-icons@4.4.2:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-4.4.2.tgz#090f42ee0396c4cc4eae0ddaa518028ba8df40c7"
|
||||
@@ -4167,19 +4194,37 @@ react-native@0.50.4:
|
||||
xmldoc "^0.4.0"
|
||||
yargs "^9.0.0"
|
||||
|
||||
react-navigation@^2.0.0-alpha.5:
|
||||
version "2.0.0-alpha.5"
|
||||
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.0.0-alpha.5.tgz#eb84cb5f0d358912cd18c6d952be046714485d88"
|
||||
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 "^0.0.74"
|
||||
|
||||
react-navigation-tabs@0.1.0-alpha.8:
|
||||
version "0.1.0-alpha.8"
|
||||
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.1.0-alpha.8.tgz#bb18699f8496a00f9911c9c75cce243d299c2423"
|
||||
dependencies:
|
||||
hoist-non-react-statics "^2.5.0"
|
||||
prop-types "^15.6.0"
|
||||
react-lifecycles-compat "^1.0.2"
|
||||
react-native-paper "^1.4.0"
|
||||
react-native-safe-area-view "^0.7.0"
|
||||
react-native-tab-view "~0.0.77"
|
||||
|
||||
react-navigation@^2.0.0-rc.8:
|
||||
version "2.0.0-rc.8"
|
||||
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.0.0-rc.8.tgz#7ec5b49a2a4770b4e88cf87cb8ac1c4644a24ef6"
|
||||
dependencies:
|
||||
clamp "^1.0.1"
|
||||
create-react-context "^0.2.1"
|
||||
hoist-non-react-statics "^2.2.0"
|
||||
path-to-regexp "^1.7.0"
|
||||
prop-types "^15.5.10"
|
||||
react-lifecycles-compat "^1.0.2"
|
||||
react-lifecycles-compat "^3"
|
||||
react-native-drawer-layout-polyfill "^1.3.2"
|
||||
react-native-safe-area-view "^0.7.0"
|
||||
react-native-tab-view "^0.0.74"
|
||||
react-navigation-deprecated-tab-navigator "1.1.0"
|
||||
react-navigation-tabs "0.1.0-alpha.8"
|
||||
|
||||
react-proxy@^1.1.7:
|
||||
version "1.1.8"
|
||||
|
||||
Reference in New Issue
Block a user