-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
135 lines (120 loc) · 4.33 KB
/
App.js
File metadata and controls
135 lines (120 loc) · 4.33 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { BottomSheetModalProvider, } from '@gorhom/bottom-sheet';
import { PortalProvider } from '@gorhom/portal';
import Transactions from './screens/transactions/Transactions';
import AddTransaction from './screens/transactions/AddTransaction';
import Categories from './screens/categories/Categories';
import AddCategory from './screens/categories/AddCategory';
import Budgets from './screens/budgets/Budgets';
import AddBudget from './screens/budgets/AddBudget';
import Insights from './screens/insights/Insights';
import { useFonts } from "expo-font";
import Icon from 'react-native-vector-icons/Octicons';
import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
function App() {
const [fontsLoaded] = useFonts({
SourceSansProRegular: require("./assets/fonts/source-sans-pro.regular.ttf"),
SourceSansProSemiBold: require("./assets/fonts/source-sans-pro.semibold.ttf"),
SourceSansProBold: require("./assets/fonts/source-sans-pro.bold.ttf"),
});
if (!fontsLoaded) {
return null;
}
const Tab = createBottomTabNavigator();
const Stack = createStackNavigator();
const TransactionsStack = () => (
<Stack.Navigator>
<Stack.Screen name="TransactionsOverview" component={Transactions} options={
{
title: 'Transactions',
headerShadowVisible: false,
}
} />
<Stack.Screen name="AddTransaction" component={AddTransaction} options={
{
title: 'Add Transaction',
headerShadowVisible: false,
presentation: 'modal',
}
} />
</Stack.Navigator>
);
const CategoriesStack = () => (
<Stack.Navigator>
<Stack.Screen name="CategoriesOverview" component={Categories} options={
{
title: 'Categories',
headerShadowVisible: false,
}
} />
<Stack.Screen name="AddCategory" component={AddCategory} options={
{
title: 'Add Category',
headerShadowVisible: false,
presentation: 'modal',
headerBackTitle: 'Cancel',
}
} />
</Stack.Navigator>
);
const BudgetsStack = () => (
<Stack.Navigator>
<Stack.Screen name="BudgetsOverview" component={Budgets} options={
{
title: 'Budgets',
headerShadowVisible: false,
}
} />
<Stack.Screen name="AddBudget" component={AddBudget} options={
{
title: 'Add Budget',
headerShadowVisible: false,
presentation: 'modal',
headerBackTitle: 'Cancel'
}
} />
</Stack.Navigator>
);
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<NavigationContainer>
<BottomSheetModalProvider>
<PortalProvider>
<Tab.Navigator>
<Tab.Screen name="Transactions" component={TransactionsStack} options={{
headerShown: false,
tabBarIcon: ({ color, size }) => (
<Icon name="arrow-switch" color={color} size={size} />
),
}} />
<Tab.Screen name="Budgets" component={BudgetsStack} options={{
headerShown: false,
tabBarLabel: 'Budgets',
tabBarIcon: ({ color, size }) => (
<MaterialIcon name="piggy-bank-outline" color={color} size={size} />
),
}} />
<Tab.Screen name="Insights" component={Insights} options={{
tabBarLabel: 'Insights',
tabBarIcon: ({ color, size }) => (
<Icon name="light-bulb" color={color} size={size} />
),
}} />
<Tab.Screen name="Categories" component={CategoriesStack} options={{
headerShown: false,
tabBarIcon: ({ color, size }) => (
<Icon name="stack" color={color} size={size} />
),
}} />
</Tab.Navigator>
</PortalProvider>
</BottomSheetModalProvider>
</NavigationContainer>
</GestureHandlerRootView>
);
}
export default App;