No Description

App.js 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import * as React from 'react';
  2. import { Button, View, Image} from 'react-native';
  3. import { createDrawerNavigator } from '@react-navigation/drawer';
  4. import { NavigationContainer } from '@react-navigation/native';
  5. import About from './screens/about';
  6. import Gallery from './screens/gallery';
  7. import Calendario from './screens/calendar';
  8. import Donate from './screens/donar';
  9. import Solicitar from './screens/solicitar';
  10. import Account from './screens/account';
  11. import Header from './shared/header';
  12. import EventSearch from './screens/eventSearch';
  13. const screens = {
  14. About: {
  15. screen: About,
  16. navigationOptions: ({navigation}) => {
  17. return {
  18. headerTitle: () => <Header navigation={navigation}/>,
  19. }
  20. }
  21. },
  22. }
  23. function HomeScreen({ navigation }) {
  24. return (
  25. <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
  26. <Button
  27. onPress={() => navigation.navigate('Notifications')}
  28. title="Go to notifications"
  29. />
  30. </View>
  31. );
  32. }
  33. function NotificationsScreen({ navigation }) {
  34. return (
  35. <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
  36. <Button onPress={() => navigation.goBack()} title="Go back home" />
  37. </View>
  38. );
  39. }
  40. const Drawer = createDrawerNavigator();
  41. export default function App() {
  42. return (
  43. <NavigationContainer >
  44. <Drawer.Navigator initialRouteName="Home">
  45. <Drawer.Screen name="Sobre nosotros" component={About} options={({navigation}) => {
  46. return {
  47. headerTitle: () => <Header navigation={navigation}/>,
  48. }
  49. }}/>
  50. <Drawer.Screen name="Calendario" component={Calendario} options={({navigation}) => {
  51. return {
  52. headerTitle: () => <Header navigation={navigation}/>,
  53. }
  54. }}/>
  55. <Drawer.Screen name="Galeria" component={Gallery} options={({navigation}) => {
  56. return {
  57. headerTitle: () => <Header navigation={navigation}/>,
  58. }
  59. }}/>
  60. <Drawer.Screen name="Donar" component={Donate} options={({navigation}) => {
  61. return {
  62. headerTitle: () => <Header navigation={navigation}/>,
  63. }
  64. }}/>
  65. <Drawer.Screen name="Solicitar ayuda" component={Solicitar}
  66. options={({navigation}) => {
  67. return {
  68. headerTitle: () => <Header navigation={navigation}/>,
  69. }
  70. }}/>
  71. <Drawer.Screen name="Mi cuenta" component={Account}
  72. options={({navigation}) => {
  73. return {
  74. headerTitle: () => <Header navigation={navigation}/>,
  75. }
  76. }}/>
  77. <Drawer.Screen name="Event Search" component={EventSearch}
  78. options={({navigation}) => {
  79. return {
  80. headerTitle: () => <Header navigation={navigation}/>,
  81. }
  82. }}/>
  83. </Drawer.Navigator>
  84. </NavigationContainer>
  85. );
  86. }