-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
52 lines (48 loc) · 1.83 KB
/
App.tsx
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
import {clusterApiUrl} from '@solana/web3.js';
import React from 'react';
import {SafeAreaView, StyleSheet} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {
ConnectionProvider,
RPC_ENDPOINT,
} from './components/providers/ConnectionProvider';
import {AuthorizationProvider} from './components/providers/AuthorizationProvider';
import {UmiProvider} from './components/providers/UmiProvider';
import MainScreen from './screens/MainScreen';
import EventsScreen from './screens/EventsScreen';
import MyTicketsScreen from './screens/MyTicketsScreen';
import TicketScannerScreen from './screens/TicketScannerScreen';
import constants from './util/constants';
const Stack = createNativeStackNavigator();
const endpoint = constants.PUBLIC_RPC || 'https://api.devnet.solana.com';
export default function App() {
return (
<NavigationContainer>
<ConnectionProvider
config={{commitment: 'processed'}}
endpoint={clusterApiUrl(RPC_ENDPOINT)}>
<AuthorizationProvider>
<UmiProvider endpoint={endpoint}>
<SafeAreaView style={styles.shell}>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home" component={MainScreen} />
<Stack.Screen name="Events" component={EventsScreen} />
<Stack.Screen name="MyTickets" component={MyTicketsScreen} />
<Stack.Screen
name="TicketScanner"
component={TicketScannerScreen}
/>
</Stack.Navigator>
</SafeAreaView>
</UmiProvider>
</AuthorizationProvider>
</ConnectionProvider>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
shell: {
height: '100%',
},
});