-
Notifications
You must be signed in to change notification settings - Fork 0
/
StockApp.js
44 lines (40 loc) · 1.67 KB
/
StockApp.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
import 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import DashboardScreen from './src/screens/Dashboard';
import DrawerIconLeft from './src/components/DrawerIcons';
import ToolbarIconGroup from './src/components/ToolbarIconGroup';
import { createContext, useState } from 'react';
import LeaderboardScreen from './src/screens/Leaderboard';
const Drawer = createDrawerNavigator();
export const AppContext = createContext()
export default function StockApp() {
const [currentAmount, setAmount] = useState(0)
return (
<AppContext.Provider value={{ currentAmount, setAmount }}>
<NavigationContainer>
<Drawer.Navigator screenOptions={({ navigation }) => ({
headerRight: () => <ToolbarIconGroup/>,
headerLeft: () => <DrawerIconLeft navigation={navigation} />
})}>
<Drawer.Screen
name="Dashboard"
component={DashboardScreen}
options={{
drawerLabel: 'Dashboard',
title: ''
}}
/>
<Drawer.Screen
name="Leaderboard"
component={LeaderboardScreen}
options={{
drawerLabel: 'Leaderboard',
title: ''
}}
/>
</Drawer.Navigator>
</NavigationContainer>
</AppContext.Provider>
)
}