feat: put material bottom tabs in another repository

This commit is contained in:
Brent Vatne
2018-05-04 11:12:01 -07:00
committed by satyajit.happy
parent 7d7323576c
commit 42e35f5028
3 changed files with 10 additions and 49 deletions

View File

@@ -1,3 +0,0 @@
/* eslint-disable import/no-commonjs */
module.exports = require('./dist/navigators/createMaterialBottomTabNavigator');

View File

@@ -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;
},
};

View File

@@ -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);