-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
52 lines (47 loc) · 1.58 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
import React from 'react'
import 'react-native-get-random-values'
import {NavigationContainer} from '@react-navigation/native'
import {ThemeProvider} from '@rneui/themed'
import {createStackNavigator} from '@react-navigation/stack'
import {Home} from './screens/Home'
import BillView from './screens/BillView/index'
import AppTheme from './theme'
import NewBillModal from './screens/modals/NewBillModal'
import AddNewItemModal from './screens/modals/AddNewItemModal'
const RootStack = createStackNavigator()
export default function App() {
return (
<ThemeProvider theme={AppTheme}>
<NavigationContainer>
<RootStack.Navigator>
<RootStack.Group>
<RootStack.Screen
name="Home"
component={Home}
options={{title: 'My Saved Bills'}}
/>
<RootStack.Screen
name="BillView"
component={BillView}
options={({route}) => ({
title: route.params.bill?.name ?? 'Bill',
})}
/>
</RootStack.Group>
<RootStack.Group screenOptions={{presentation: 'modal'}}>
<RootStack.Screen
name="NewBillModal"
options={{title: 'Create a new Bill'}}
component={NewBillModal}
/>
<RootStack.Screen
name="AddNewItemModal"
options={{title: 'Add a new Item'}}
component={AddNewItemModal}
/>
</RootStack.Group>
</RootStack.Navigator>
</NavigationContainer>
</ThemeProvider>
)
}