Nav apraksta

Navigation.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import React from "react";
  2. import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
  3. import { createNativeStackNavigator } from "@react-navigation/native-stack";
  4. import { NavigationContainer } from "@react-navigation/native";
  5. import { Entypo } from '@expo/vector-icons';
  6. import { Ionicons } from '@expo/vector-icons';
  7. // Import the screens to be used in the navigator
  8. import Denuncias from "./screens/Denuncias";
  9. import Derechos from "./screens/Derechos";
  10. import Analisis from "./screens/Analisis";
  11. import Formulario from "./screens/Formulario";
  12. import Lista from "./screens/Lista";
  13. import Drna from "./screens/Drna";
  14. import { TabBarIOSItem } from "react-native";
  15. const StackDenuncias = createNativeStackNavigator();
  16. function Stacks() {
  17. return (
  18. <StackDenuncias.Navigator initialRouteName="DenunciasIni">
  19. <StackDenuncias.Screen name="Denuncias" component={Denuncias} />
  20. <StackDenuncias.Screen name="Formulario" component={Formulario} />
  21. <StackDenuncias.Screen name="Lista" component={Lista} />
  22. <StackDenuncias.Screen name="Drna" component={Drna} />
  23. </StackDenuncias.Navigator>
  24. );
  25. }
  26. const Tab = createBottomTabNavigator();
  27. function Tabs() {
  28. return (
  29. <Tab.Navigator initialRouteName="DenunciasIni">
  30. <Tab.Screen
  31. name="Denuncias"
  32. component={Stacks}
  33. options={{
  34. tabBarIcon: ({}) => (
  35. <Entypo name="megaphone" size={24} color="black" />
  36. ),
  37. headerShown:false
  38. }}
  39. />
  40. <Tab.Screen
  41. name="Derechos"
  42. component={Derechos}
  43. options={{
  44. tabBarIcon: ({}) => (
  45. <Ionicons name="ios-newspaper-outline" size={24} color="black" />
  46. )
  47. }}
  48. />
  49. <Tab.Screen
  50. name="Analisis"
  51. component={Analisis}
  52. options={{
  53. tabBarIcon: ({}) => (
  54. <Ionicons name="earth" size={24} color="black" />
  55. )
  56. }} />
  57. </Tab.Navigator>
  58. );
  59. }
  60. export default function Navigation() {
  61. return (
  62. <NavigationContainer>
  63. <Tabs />
  64. </NavigationContainer>
  65. );
  66. }