-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
51 lines (47 loc) · 1.23 KB
/
App.js
File metadata and controls
51 lines (47 loc) · 1.23 KB
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
import React, { useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import BusNow from './screens/BusNow';
import Bussit from './screens/Bussit';
import { init } from './database';
const Stack = createStackNavigator();
function App() {
useEffect(() => {
// Initialize the SQLite database
init()
.then(() => {
console.log('Database initialized successfully');
})
.catch((err) => {
console.log('Database initialization failed:', err);
});
}, []);
return (
<NavigationContainer>
<Stack.Navigator
initialRouteName="BusNow"
screenOptions={{
headerStyle: {
backgroundColor: '#0B3B24',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
}}
>
<Stack.Screen
name="BusNow"
component={BusNow}
options={{ title: 'BusNow' }}
/>
<Stack.Screen
name="Bussit"
component={Bussit}
options={{ title: 'Bussit' }}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;