-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
125 lines (117 loc) · 3.94 KB
/
App.js
File metadata and controls
125 lines (117 loc) · 3.94 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
import 'react-native-gesture-handler'
import {StatusBar} from 'expo-status-bar'
import React, {useEffect, useState} from 'react'
import {NavigationContainer} from '@react-navigation/native'
import {createStackNavigator} from '@react-navigation/stack'
// pages
import HomeScreen from './screens/HomeScreen'
import LoginScreen from './screens/LoginScreen'
import RegisterScreen from './screens/RegisterScreen'
import AddScreen from './screens/AddScreen'
import UpdateScreen from './screens/UpdateScreen'
import AllTransactions from './screens/AllTransactions'
import Profile from './screens/Profile'
import EditProfile from './screens/EditProfile'
import ChartScreen from './screens/ChartScreen'
import ExportScreen from './screens/ExportScreen'
import ImportScreen from './screens/ImportScreen'
import TransactionDetail from './screens/TransactionDetail'
import HelpScreen from './screens/HelpScreen'
import PrivacyScreen from './screens/PrivacyScreen'
import TermScreen from './screens/TermScreen'
import SettingScreen from './screens/SettingScreen'
//provider
import FilterContext from './components/FilterContext'
export const FilterProvider = ({ children }) => {
const [filter, setFilter] = useState([]);
return (
<FilterContext.Provider
value={{
filter,
setFilter,
}}
>
{children}
</FilterContext.Provider>
);
};
const Stack = createStackNavigator()
export default function App() {
const globalScreenOptions = {
headerStyle: {
backgroundColor: '#DDD5F1',
backgroundColor: '#00A86B',
// backgroundColor: '#51A3B1',#00A86B
},
headerTitleStyle: {
color: '#fff',
},
headerTintColor: 'black',
}
// function Home() {
// return (
// <Drawer.Navigator>
// <Drawer.Screen name="Home" component={Home} />
// <Drawer.Screen name="article" component={Article} />
// </Drawer.Navigator>
// )
// }
// function Article() {
// return (
// <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
// <Text>Article Screen</Text>
// </View>
// );
// }
const ProfileStack = ({navigation}) => (
<Stack.Navigator>
<Stack.Screen
name="Profile"
component={Profile}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="EditProfile"
component={EditProfile}
options={{
headerTitle: 'Edit Profile',
headerShown:false,
headerBackTitleVisible: false,
headerTitleAlign: 'center',
headerStyle: {
backgroundColor: '#fff',
shadowColor: '#fff',
elevation: 0,
},
}}
/>
</Stack.Navigator>
);
return (
<FilterProvider>
<NavigationContainer>
<StatusBar style='dark' />
<Stack.Navigator screenOptions={globalScreenOptions}>
<Stack.Screen name='Login' component={LoginScreen} />
<Stack.Screen name='Register' component={RegisterScreen} />
<Stack.Screen name='Home' component={HomeScreen} />
<Stack.Screen name='Transaction' component={TransactionDetail} />
<Stack.Screen name='Add' component={AddScreen} />
<Stack.Screen name='Update' component={UpdateScreen} />
<Stack.Screen name='All' component={AllTransactions} />
<Stack.Screen name='Profile' component={ProfileStack} />
<Stack.Screen name='EditProfile' component={EditProfile} />
<Stack.Screen name='Chart' component={ChartScreen} />
<Stack.Screen name='Export' component={ExportScreen}/>
<Stack.Screen name='Import' component={ImportScreen}/>
<Stack.Screen name='Help' component={HelpScreen}/>
<Stack.Screen name='Privacy' component={PrivacyScreen}/>
<Stack.Screen name='Terms & Definitions' component={TermScreen}/>
<Stack.Screen name='Setting' component={SettingScreen}/>
</Stack.Navigator>
</NavigationContainer>
</FilterProvider>
)
}