From abffee27c74961794e9583867573904be2ce2e62 Mon Sep 17 00:00:00 2001 From: Samuel Oberhofer Date: Sat, 10 Dec 2022 11:30:07 +0100 Subject: [PATCH] Add Navigator.js and move Tab navigation there --- App.js | 55 ++----------------------------------- navigation/Navigator.js | 60 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 53 deletions(-) create mode 100644 navigation/Navigator.js diff --git a/App.js b/App.js index a3ce205..3bbcf04 100644 --- a/App.js +++ b/App.js @@ -1,58 +1,7 @@ -import { StyleSheet, Text, View } from "react-native"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; -import { NavigationContainer } from "@react-navigation/native"; -import Icon from "react-native-vector-icons/Ionicons"; -import MainScreen from "./screens/MainScreen"; - +import Navigator from "./navigation/Navigator"; const Tab = createBottomTabNavigator(); export default function App() { - return ( - - - ( - - ), - }} - /> - ( - - ), - }} - /> - ( - - ), - }} - /> - ( - - ), - }} - /> - - - ); + return ; } diff --git a/navigation/Navigator.js b/navigation/Navigator.js new file mode 100644 index 0000000..80f2783 --- /dev/null +++ b/navigation/Navigator.js @@ -0,0 +1,60 @@ +import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; +import { NavigationContainer } from "@react-navigation/native"; +import Icon from "react-native-vector-icons/Ionicons"; + +import MainScreen from "../screens/MainScreen"; + +const Tab = createBottomTabNavigator(); + +function Navigator() { + return ( + + + ( + + ), + }} + /> + ( + + ), + }} + /> + ( + + ), + }} + /> + ( + + ), + }} + /> + + + ); +} + +export default Navigator;