-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemo2.js
125 lines (108 loc) · 3.15 KB
/
Demo2.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
import * as React from 'react';
import { View, Text ,Button} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
const Stack = createStackNavigator();
const UserStack = createStackNavigator();
const HospitalStack = createStackNavigator();
function HomeScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
<Button
title="Go to User"
onPress={() => navigation.navigate('User')}
/>
<Button
title="Go to Hospital"
onPress={() => navigation.navigate('Hospital')}
/>
</View>
);
}
function UserHomeScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>USER Home Screen</Text>
</View>
);
}
function HospitalHomeScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>HOSPITAL Home Screen</Text>
</View>
);
}
function LoginScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Login Screen</Text>
<Button
title="Go to Signin"
onPress={() => navigation.navigate('Signin')}
/>
</View>
);
}
function SigninScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Signin Screen</Text>
{/* <Button
title="Go to User"
onPress={() => navigation.navigate('User')}
/> */}
</View>
);
}
function UserScreen() {
return (
<UserStack.Navigator >
<UserStack.Screen name="Login" component={LoginScreen} />
<UserStack.Screen name="Signin" component={SigninScreen} />
</UserStack.Navigator>
);
}
function HospitalLoginScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Hospital Login Screen</Text>
<Button
title="Go to Signin"
onPress={() => navigation.navigate('HospitalSignin')}
/>
</View>
);
}
function HospitalSigninScreen({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Hospital Signin Screen</Text>
{/* <Button
title="Go to User"
onPress={() => navigation.navigate('User')}
/> */}
</View>
);
}
function HospitalScreen() {
return (
<HospitalStack.Navigator >
<HospitalStack.Screen name="HospitalLogin" component={HospitalLoginScreen} />
<HospitalStack.Screen name="HospitalSignin" component={HospitalSigninScreen} />
</HospitalStack.Navigator>
);
}
function App() {
return (
<NavigationContainer>
<Stack.Navigator headerMode='none'>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="User" component={UserScreen} />
<Stack.Screen name="Hospital" component={HospitalScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;