-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
69 lines (62 loc) · 3.12 KB
/
App.js
File metadata and controls
69 lines (62 loc) · 3.12 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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { TransactionProvider } from './context/TransactionContext';
import { UserProvider } from './context/UserContext';
import { COLORS } from './utils/theme';
// Screens
import LoginScreen from './screens/LoginScreen';
import SignupScreen from './screens/SignupScreen';
import DashboardScreen from './screens/DashboardScreen';
import AddMoneyScreen from './screens/AddMoneyScreen';
import SendMoneyScreen from './screens/SendMoneyScreen';
import AirtimeScreen from './screens/AirtimeScreen';
import DataScreen from './screens/DataScreen';
import TransactionHistoryScreen from './screens/TransactionHistoryScreen';
import TransactionDetailScreen from './screens/TransactionDetailScreen';
import ProfileScreen from './screens/ProfileScreen';
import ChangePasswordScreen from './screens/ChangePasswordScreen';
import PayBillsStack from './screens/PayBillsStack';
const Stack = createNativeStackNavigator();
export default function App() {
return (
<UserProvider>
<TransactionProvider>
<NavigationContainer>
<Stack.Navigator
initialRouteName="Login"
screenOptions={{
headerStyle: { backgroundColor: COLORS.primary }, // header background
headerTintColor: '#fff', // title & back button color
headerTitleStyle: { fontWeight: 'bold' },
}}
>
{/* Hide header for Login and Signup */}
<Stack.Screen
name="Login"
component={LoginScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Signup"
component={SignupScreen}
options={{ headerShown: false }}
/>
{/* Screens with headers */}
<Stack.Screen name="Dashboard" component={DashboardScreen} options={{ title: 'Dashboard' }} />
<Stack.Screen name="AddMoney" component={AddMoneyScreen} options={{ title: 'Add Money' }} />
<Stack.Screen name="SendMoney" component={SendMoneyScreen} options={{ title: 'Send Money' }} />
<Stack.Screen name="TransactionHistory" component={TransactionHistoryScreen} options={{ title: 'Transactions' }} />
<Stack.Screen name="TransactionDetail" component={TransactionDetailScreen} options={{ title: 'Transaction Detail'}}/>
<Stack.Screen name="Profile" component={ProfileScreen} options={{ title: 'Profile' }} />
<Stack.Screen name="ChangePassword" component={ChangePasswordScreen} options={{ title: 'Change Password' }} />
{/* Nested stack */}
<Stack.Screen name="PayBillsStack" component={PayBillsStack} options={{ headerShown: false }} />
<Stack.Screen name="Airtime" component={AirtimeScreen} options={{ title: 'Buy Airtime' }} />
<Stack.Screen name="Data" component={DataScreen} options={{ title: 'Buy Data' }} />
</Stack.Navigator>
</NavigationContainer>
</TransactionProvider>
</UserProvider>
);
}