mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 17:34:59 +08:00
feat: put material bottom tabs in another repository
This commit is contained in:
committed by
satyajit.happy
parent
7d7323576c
commit
42e35f5028
@@ -1,3 +0,0 @@
|
||||
/* eslint-disable import/no-commonjs */
|
||||
|
||||
module.exports = require('./dist/navigators/createMaterialBottomTabNavigator');
|
||||
@@ -11,17 +11,21 @@ module.exports = {
|
||||
get createMaterialTopTabNavigator() {
|
||||
return require('./navigators/createMaterialTopTabNavigator').default;
|
||||
},
|
||||
get createMaterialBottomTabNavigator() {
|
||||
return require('./navigators/createMaterialBottomTabNavigator').default;
|
||||
},
|
||||
|
||||
/**
|
||||
* Views
|
||||
*/
|
||||
get MaterialTopTabBar() {
|
||||
return require('./views/MaterialTopTabBar').default;
|
||||
},
|
||||
get BottomTabBar() {
|
||||
return require('./views/BottomTabBar').default;
|
||||
},
|
||||
get MaterialTopTabBar() {
|
||||
return require('./views/MaterialTopTabBar').default;
|
||||
},
|
||||
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
get createTabNavigator() {
|
||||
return require('./utils/createTabNavigator').default;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/* @flow */
|
||||
|
||||
import * as React from 'react';
|
||||
import { BottomNavigation } from 'react-native-paper';
|
||||
import createTabNavigator, {
|
||||
type InjectedProps,
|
||||
} from '../utils/createTabNavigator';
|
||||
|
||||
type Props = InjectedProps & {
|
||||
activeTintColor?: string,
|
||||
};
|
||||
|
||||
class BottomNavigationView extends React.Component<Props> {
|
||||
_getColor = ({ route }) => {
|
||||
const { descriptors } = this.props;
|
||||
const descriptor = descriptors[route.key];
|
||||
const options = descriptor.options;
|
||||
|
||||
return options.tabBarColor;
|
||||
};
|
||||
|
||||
render() {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { activeTintColor, navigation, descriptors, ...rest } = this.props;
|
||||
|
||||
return (
|
||||
<BottomNavigation
|
||||
{...rest}
|
||||
navigationState={navigation.state}
|
||||
getColor={this._getColor}
|
||||
theme={
|
||||
/* $FlowFixMe */
|
||||
activeTintColor ? { colors: { primary: activeTintColor } } : null
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default createTabNavigator(BottomNavigationView);
|
||||
Reference in New Issue
Block a user