-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
163 lines (151 loc) · 4.86 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import 'react-native-gesture-handler';
import React from 'react';
import { Button, Text, View } from 'react-native';
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import Login from './components/Login'
import HomeScreen from './components/HomeScreen';
import ParentHomeScreen from './components/ParentHomeScreen';
import Parentallowance from './components/Parentallowance';
import TakeAPicture from "./components/TakeAPicture";
import Kidrequest from "./components/Kidrequest";
import Kidconfirm from "./components/Kidconfirm";
import Kidpay from "./components/Kidpay";
import Kidcard from "./components/Kidcard";
import colors from './assets/colors/colors';
import { FontAwesome, MaterialCommunityIcons } from '@expo/vector-icons';
function Profile({ navigation }) {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Profile!</Text>
<Button title="Back to login :)" onPress={() => navigation.navigate('Login')} />
<Button title="To parent user flow ..." onPress={() => navigation.navigate('Parent Login')} />
</View>
);
}
const Stack = createStackNavigator();
function ParentStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="Parent Home Tabs" component={ParentTabs} options={{ headerShown: false }} />
</Stack.Navigator>
);
}
function LoginStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="Home Tabs" component={MyTabs} options={{ headerShown: false }} />
<Stack.Screen name="Parent Login" component={ParentStack} options={{ headerShown: false }} />
</Stack.Navigator>
);
}
function PaymentStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Take Picture of Item" component={TakeAPicture} options={{ headerShown: false }} />
<Stack.Screen name="Send Request" component={Kidrequest} />
<Stack.Screen name="Pending Authorization" component={Kidconfirm} />
<Stack.Screen name="Confirm Payment" component={Kidpay} />
<Stack.Screen name="Pay with Card" component={Kidcard} />
</Stack.Navigator>
);
}
const Tab = createMaterialBottomTabNavigator();
function MyTabs() {
return (
<Tab.Navigator
initialRouteName="Home"
activeColor="#f1fffa"
labelStyle={{ fontSize: 12 }}
style={{ backgroundColor: colors.mintBackground }}
barStyle={{ backgroundColor: '#18944c' }}
>
<Tab.Screen
name="Home"
component={HomeScreen}
options={{
tabBarLabel: 'Home',
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="home" color={color} size={26} />
),
}}
/>
<Tab.Screen
name="PaymentAuthorization"
component={PaymentStack}
options={{
tabBarLabel: 'Payment',
tabBarIcon: ({ color }) => (
<FontAwesome name="credit-card" size={22} color={color} />
),
}}
/>
<Tab.Screen
name="Profile"
component={Profile}
options={{
tabBarVisible: false,
tabBarLabel: 'Profile',
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="account" color={color} size={26} />
),
}}
/>
</Tab.Navigator>
);
}
function ParentTabs() {
return (
<Tab.Navigator
initialRouteName="Parent Home"
activeColor="#f1fffa"
labelStyle={{ fontSize: 12 }}
style={{ backgroundColor: colors.mintBackground }}
barStyle={{ backgroundColor: '#18944c' }}
>
<Tab.Screen
name="Parent Home"
component={ParentHomeScreen}
options={{
tabBarVisible: false,
tabBarLabel: 'Parent Home',
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="home" color={color} size={26} />
),
}}
/>
<Tab.Screen
name="Parent Allowance"
component={Parentallowance}
options={{
tabBarVisible: false,
tabBarLabel: 'Parent Allowance',
tabBarIcon: ({ color }) => (
<FontAwesome name="credit-card" size={22} color={color} />
),
}}
/>
<Tab.Screen
name="Profile"
component={Profile}
options={{
tabBarVisible: false,
tabBarLabel: 'Profile',
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="account" color={color} size={26} />
),
}}
/>
</Tab.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<LoginStack />
</NavigationContainer>
);
}