-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
60 lines (53 loc) · 1.54 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
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { StatusBar } from "expo-status-bar";
import { Pressable, StyleSheet, Text, View } from "react-native";
import HomeScreen from "./screens/HomeScreen";
import ExpenseDetailScreen from "./screens/ExpenseDetailScreen";
import { NavigationContainer } from "@react-navigation/native";
import { createDrawerNavigator } from "@react-navigation/drawer";
import DrawerScreen from "./screens/DrawerScreen";
export default function App() {
const Drawer = createDrawerNavigator();
function MyDrawer() {
return (
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={HomeScreen} />
<Drawer.Screen name="Profile" component={DrawerScreen} />
</Drawer.Navigator>
);
}
const Stack = createNativeStackNavigator();
function MyStack() {
return (
<Stack.Navigator initialRouteName="Home" screenOptions={{ headerShown: false }}>
<Stack.Screen
name="Home"
component={MyDrawer}
options={{
headerRight: () => {
return (
<Pressable
onPress={() => {
console.log("Dummy test");
}}
>
<Text>Press Me</Text>
</Pressable>
);
},
}}
/>
<Stack.Screen name="Details" component={ExpenseDetailScreen} />
</Stack.Navigator>
);
}
return <NavigationContainer>{MyStack()}</NavigationContainer>;
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});