diff --git a/components/App.js b/components/App.js
index 56d8796..20a7e81 100644
--- a/components/App.js
+++ b/components/App.js
@@ -4,6 +4,7 @@ import {
} from 'react-navigation';
import TabBarBottom from './TabBarBottom';
+import MainTabs from './MainTabs';
import TestScreens from './TestScreens';
import { HomeScreen } from '../containers/TestScreens'
@@ -17,7 +18,7 @@ const MainTab = TabNavigator({
});
const App = DrawerNavigator({
- Home: {screen: MainTab},
+ Home: {screen: MainTabs},
About: {screen: TestScreens.AboutScreen},
});
export default App;
diff --git a/components/MainTabs.js b/components/MainTabs.js
new file mode 100644
index 0000000..74fb590
--- /dev/null
+++ b/components/MainTabs.js
@@ -0,0 +1,150 @@
+/**
+ * @flow
+ */
+
+import React from 'react';
+import {
+ Button,
+ Platform,
+ ScrollView,
+ StyleSheet,
+ Text,
+ TouchableOpacity,
+ View,
+} from 'react-native';
+import {
+ createNavigator,
+ createNavigationContainer,
+ TabRouter,
+ addNavigationHelpers,
+} from 'react-navigation';
+
+const MyNavScreen = ({ navigation, banner }) => (
+
+ {banner}
+
+);
+
+const HomeScreen = ({ navigation }) => (
+
+);
+
+const FavScreen = ({ navigation }) => (
+
+);
+
+const AddScreen = ({ navigation }) => (
+
+ Choose the type of post you want to create
+
+);
+
+const SearchScreen = ({ navigation }) => (
+
+);
+
+const ProfileScreen = ({ navigation }) => (
+
+);
+
+const CustomTabBar = ({ navigation }) => {
+ const { routes } = navigation.state;
+ return (
+
+ {routes.map(route => (
+ navigation.navigate(route.routeName)}
+ style={styles.tab}
+ key={route.routeName}
+ >
+ {route.routeName}
+
+ ))}
+
+ );
+};
+
+const CustomTabView = ({ router, navigation }) => {
+ const { routes, index } = navigation.state;
+ const ActiveScreen = router.getComponentForState(navigation.state);
+ return (
+
+
+
+
+ );
+};
+
+const CustomTabRouter = TabRouter(
+ {
+ Home: {
+ screen: HomeScreen,
+ path: 'home',
+ },
+ Favourites: {
+ screen: FavScreen,
+ path: 'fav',
+ },
+ Add: {
+ screen: AddScreen,
+ path: 'settings',
+ },
+ Search: {
+ screen: SearchScreen,
+ path: 'search',
+ },
+ Profile: {
+ screen: ProfileScreen,
+ path: 'profile',
+ },
+ },
+ {
+ // Change this to start on a different tab
+ initialRouteName: 'Home',
+ }
+);
+
+const MainTabs = createNavigationContainer(
+ createNavigator(CustomTabRouter)(CustomTabView)
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'flex-end',
+ alignItems: 'center',
+ flexDirection: 'column',
+ marginTop: Platform.OS === 'ios' ? 20 : 0,
+ },
+ tabContainer: {
+ flexDirection: 'row',
+ height: 48,
+ },
+ tab: {
+ flex: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ margin: 4,
+ borderWidth: 1,
+ borderColor: '#ddd',
+ borderRadius: 4,
+ },
+});
+
+export default MainTabs;