-
Notifications
You must be signed in to change notification settings - Fork 1
/
docnavigation.js
77 lines (67 loc) · 3.16 KB
/
docnavigation.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
import React, { useState, useEffect } from 'react';
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import AsyncStorage from '@react-native-async-storage/async-storage';
import DocHome from './adminScreens/DocHome';
import Schedule from './adminScreens/Schedule';
import Doctorprofile from './adminScreens/Doctorprofile';
import DocSetup from './adminSetup/DocSetup';
import Location from './adminSetup/Location';
import Specialization from './adminSetup/Specialization';
import Experience from './adminSetup/Exp';
import About from './adminSetup/Abt';
import PhoneEdit from './Edit/DocSetup';
import LocationEdit from './Edit/Location';
import SpecializationEdit from './Edit/Specialization';
import ExperienceEdit from './Edit/Exp';
import AboutEdit from './Edit/Abt';
const Stack = createNativeStackNavigator();
const FirsLaunch = () => {
const [isFirstLaunch, setIsFirstLaunch] = useState(null);
useEffect(() => {
AsyncStorage.getItem('alreadyLaunched').then(value => {
if (value == null) {
AsyncStorage.setItem('alreadyLaunched', 'true');
setIsFirstLaunch(true);
} else {
setIsFirstLaunch(false);
}
})
}, []);
if (isFirstLaunch === null) {
return null;
} else if (isFirstLaunch === true) {
return (
<Stack.Navigator>
<Stack.Screen name="DocSetup" component={DocSetup} options={{ headerShown: false }} />
<Stack.Screen name="Location" component={Location} options={{ headerShown: false }} />
<Stack.Screen name="Specialization" component={Specialization} options={{ headerShown: false }} />
<Stack.Screen name="Experience" component={Experience} options={{ headerShown: false }} />
<Stack.Screen name="About" component={About} options={{ headerShown: false }} />
<Stack.Screen name="DocHome" component={DocHome} options={{ headerShown: false }} />
<Stack.Screen name="Doctorprofile" component={Doctorprofile} options={{ headerShown: false }} />
<Stack.Screen name="Schedule" component={Schedule} options={{ headerShown: false }} />
</Stack.Navigator>
);
} else {
return (
<Stack.Navigator>
<Stack.Screen name="DocHome" component={DocHome} options={{ headerShown: false }} />
<Stack.Screen name="Schedule" component={Schedule} options={{ headerShown: false }} />
<Stack.Screen name="PhoneEdit" component={PhoneEdit} options={{ headerShown: false }} />
<Stack.Screen name="LocationEdit" component={LocationEdit} options={{ headerShown: false }} />
<Stack.Screen name="SpecializationEdit" component={SpecializationEdit} options={{ headerShown: false }} />
<Stack.Screen name="ExperienceEdit" component={ExperienceEdit} options={{ headerShown: false }} />
<Stack.Screen name="AboutEdit" component={AboutEdit} options={{ headerShown: false }} />
<Stack.Screen name="Doctorprofile" component={Doctorprofile} options={{ headerShown: false }} />
</Stack.Navigator>
);
}
};
export default function App() {
return (
<NavigationContainer>
<FirsLaunch />
</NavigationContainer>
);
}