-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
101 lines (95 loc) · 2.71 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import "react-native-gesture-handler";
import { useEffect } from "react";
import {
setBackgroundColorAsync,
setPositionAsync,
setButtonStyleAsync,
} from "expo-navigation-bar";
import { createStackNavigator } from "@react-navigation/stack";
import {
NavigationContainer,
NavigatorScreenParams,
} from "@react-navigation/native";
import { createDrawerNavigator } from "@react-navigation/drawer";
import { Feather } from "@expo/vector-icons";
import {
Accounts,
Help,
Home,
Onboarding,
Profile,
Settings,
SignIn,
SignUp,
Stats,
Transactions,
} from "./screens";
import { DrawerContent } from "./components";
import { StatusBar } from "expo-status-bar";
import { TouchableOpacity } from "react-native";
export type DrawerParamList = {
Home: undefined;
Profile: undefined;
Accounts: undefined;
Transactions: undefined;
Stats: undefined;
Settings: undefined;
Help: undefined;
};
export type StackParamList = {
Onboarding: undefined;
SignIn: undefined;
SignUp: undefined;
Main: NavigatorScreenParams<DrawerParamList>;
};
const Stack = createStackNavigator<StackParamList>();
const Drawer = createDrawerNavigator<DrawerParamList>();
const DrawerNavigator = () => {
return (
<Drawer.Navigator
screenOptions={{
headerShown: false,
drawerType: "slide",
overlayColor: "transparent",
drawerStyle: {
flex: 1,
width: "60%",
backgroundColor: "transparent",
},
sceneContainerStyle: {
backgroundColor: "transparent",
},
}}
initialRouteName="Home"
drawerContent={(props) => {
return <DrawerContent {...props} />;
}}
>
<Drawer.Screen name="Home" component={Home} />
<Drawer.Screen name="Profile" component={Profile} />
<Drawer.Screen name="Accounts" component={Accounts} />
<Drawer.Screen name="Transactions" component={Transactions} />
<Drawer.Screen name="Stats" component={Stats} />
<Drawer.Screen name="Settings" component={Settings} />
<Drawer.Screen name="Help" component={Help} />
</Drawer.Navigator>
);
};
export default function App() {
useEffect(() => {
setPositionAsync("absolute");
setBackgroundColorAsync("rgba(255, 255, 255, 0.01)");
setButtonStyleAsync("dark");
}, []);
return (
<NavigationContainer>
<StatusBar style="dark" />
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="Onboarding" component={Onboarding} />
<Stack.Screen name="SignIn" component={SignIn} />
<Stack.Screen name="SignUp" component={SignUp} />
<Stack.Screen name="Main" component={DrawerNavigator} />
</Stack.Navigator>
</NavigationContainer>
);
}