App.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import 'react-native-gesture-handler';
  2. import React from 'react';
  3. import { View } from 'react-native';
  4. import { NavigationContainer } from '@react-navigation/native';
  5. import { createStackNavigator } from '@react-navigation/stack';
  6. import { DefaultTheme, Provider } from 'react-native-paper'
  7. import Map from './screens/Map'
  8. import NewPlace from './screens/NewPlace';
  9. import Intro from './screens/Intro';
  10. import Login from './screens/Login';
  11. import RegisterCredentials from './screens/RegisterCredentials';
  12. import RegisterMeasurements from './screens/RegisterMeasurements';
  13. import { RegistrationFormProvider } from './contexts/RegisterContext';
  14. import RegisterImage from './screens/RegisterImage';
  15. import RegisterResult from './screens/RegistrationResult';
  16. const Stack = createStackNavigator();
  17. const theme = {
  18. ...DefaultTheme,
  19. colors: {
  20. primary: '#df3f3f',
  21. accent: 'white',
  22. },
  23. }
  24. const App = () => {
  25. return(
  26. <Provider theme={theme}>
  27. <NavigationContainer>
  28. <RegistrationFormProvider>
  29. <Stack.Navigator screenOptions={{
  30. headerTransparent: true,
  31. headerTintColor: 'white',
  32. headerTitle: ""
  33. }} initialRouteName="Intro">
  34. <Stack.Screen name="Intro" component={Intro} />
  35. <Stack.Screen name="Login" component={Login} />
  36. {/* registration screens */}
  37. <Stack.Screen name="Credentials" component={RegisterCredentials} />
  38. <Stack.Screen name="Measurements" component={RegisterMeasurements} />
  39. <Stack.Screen name="RegisterImage" component={RegisterImage} />
  40. <Stack.Screen name="RegisterResult" component={RegisterResult} />
  41. <Stack.Screen name="Map" component={Map} />
  42. <Stack.Screen name="New Place" component={NewPlace} />
  43. </Stack.Navigator>
  44. </RegistrationFormProvider>
  45. </NavigationContainer>
  46. </Provider>
  47. )
  48. }
  49. export default App;