-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
86 lines (71 loc) · 2.43 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// import { StatusBar } from 'expo-status-bar';
// import React from 'react';
// import { StyleSheet, Text, View } from 'react-native';
// export default function App() {
// return (
// <View style={styles.container}>
// <Text>Open up App.js to start working on your app!</Text>
// <StatusBar style="auto" />
// </View>
// );
// }
// const styles = StyleSheet.create({
// container: {
// flex: 1,
// backgroundColor: '#fff',
// alignItems: 'center',
// justifyContent: 'center',
// },
// });
import { StatusBar } from 'expo-status-bar';
//import './App.css';
import React, { useState } from "react";
import LoginPage from './pages/LoginPage';
import RoutePage from './pages/RoutePage';
import SettingsPage from './pages/SettingsPage';
import { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import {Button} from 'react-native-paper';
import {IsLoggedProvider} from './context/IsLoggedState';
import {SettingsProvider} from './context/SettingsState';
import {HttpClientProvider} from './context/HTTPClientState';
const theme = {
...DefaultTheme,
roundness: 2,
colors: {
...DefaultTheme.colors,
primary: '#3498db',
accent: '#f1c40f',
},
};
function App() {
const Stack = createNativeStackNavigator();
return (
<SettingsProvider value={{endpoint:"http://checkpointapp.gtec.udc.es:3031",uuid:"D7F8B7E3-559A-4AF8-8715-3A56C4030F64"}}>
<HttpClientProvider>
<IsLoggedProvider>
<NavigationContainer>
<PaperProvider theme={theme}>
<Stack.Navigator initialRouteName="Login">
<Stack.Screen name="Login" component={LoginPage} options={({ navigation, route }) => ({
headerRight: () => (
<Button
onPress={() => navigation.push('Settings')}
icon="cog"
title="Info"
mode="contained"
labelStyle={{color:'white'}}
>Settings</Button>
)})} />
<Stack.Screen name="Route" component={RoutePage} />
<Stack.Screen name="Settings" component={SettingsPage} />
</Stack.Navigator>
</PaperProvider>
</NavigationContainer>
</IsLoggedProvider>
</HttpClientProvider>
</SettingsProvider>
);
}
export default App;