-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
103 lines (98 loc) · 3.37 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
import 'react-native-gesture-handler';
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View,SafeAreaView } from 'react-native';
import SignupScreen from './screens/SignupScreen'
import Login from './screens/LoginScreen';
import Store from './store/store';
import { useEffect } from 'react';
import { init } from './backend/Database';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import ResetPhraseScreen from './screens/ResetPhraseScreen';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Homepage from './screens/Homepage';
import AddDiary from './screens/AddDiaryScreen';
import InitalScreen from './screens/initialScreen';
import SettingScreen from './screens/SettingScreen';
import UserProfile from './screens/UserProfile';
import EditdiaryScreen from './screens/EditScreen';
import ContactUsScreen from './screens/ContactUsScreen';
export default function App() {
const Stack=createStackNavigator();
useEffect(()=>
{
async function initdb()
{
await init().then(console.log("db init ok"))
}
initdb();
},[])
return (
<Store>
<SafeAreaView style={{flex: 1}}>
<NavigationContainer>
<Stack.Navigator initialRouteName="LoginScreen">
<Stack.Screen
name="loginScreen"
component={Login}
options={{title: 'Login'}}
/>
<Stack.Screen
name="addDiary"
component={AddDiary}
options={{title: 'Add'}}
/>
<Stack.Screen
name="settingsPage"
component={SettingScreen}
options={{title: ''}}
/>
<Stack.Screen
name="homePage"
component={Homepage}
options={{title: ''}}
/>
<Stack.Screen
name="signupScreen"
component={SignupScreen}
options={{title: 'signup'}}
/>
<Stack.Screen
name="userProfile"
component={UserProfile}
options={{title: 'about you'}}
/>
<Stack.Screen
name="initialScreen"
component={InitalScreen}
options={{title: '',headerLeft:null}}
/>
<Stack.Screen
name="resetPhraseScreen"
component={ResetPhraseScreen}
options={{title: 'reset phrase'}}
/>
<Stack.Screen
name="editDiaryScreen"
component={EditdiaryScreen}
options={{title: 'edit'}}
/>
<Stack.Screen
name="contactUsScreen"
component={ContactUsScreen}
options={{title: ''}}
/>
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>
</Store>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});