-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
95 lines (86 loc) · 2.74 KB
/
Copy pathApp.js
File metadata and controls
95 lines (86 loc) · 2.74 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
import * as React from 'react';
import { View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack';
import Navigator from './Routes/Hometsack';
import PractionerStack from './Routes/PractionerStack';
import Header from './Screens/Header';
import Ionicons from 'react-native-vector-icons/Fontisto';
const Tab = createBottomTabNavigator();
const HomeStack = createStackNavigator();
const SettingsStack = createStackNavigator();
const Stack = createStackNavigator();
function PatientView() {
return <Navigator />;
}
function DoctorView() {
return <PractionerStack />;
}
function HomeStackScreen({ navigation, route }) {
console.log('navigation>>>>>>>>>>>>', route.state)
navigation.setOptions({ tabBarVisible: true })
setTimeout(function () { navigation.setOptions({ tabBarVisible: false }) }, 10500);
return (
<HomeStack.Navigator screenOptions={{
headerShown: false
}} initialRouteName="Patient Login">
<HomeStack.Screen
name="Patient Login"
component={PatientView}
screenOptions={{
headerShown: false
}}
/>
</HomeStack.Navigator>
);
}
function SettingsStackScreen({ navigation, route }) {
console.log('navigation>>>>>>>>>>>>', route.state)
navigation.setOptions({ tabBarVisible: true })
setTimeout(function () { navigation.setOptions({ tabBarVisible: false }) }, 10500);
return (
<SettingsStack.Navigator
screenOptions={{
headerShown: false
}}
>
<SettingsStack.Screen
name="Provider Login"
component={DoctorView}
/>
</SettingsStack.Navigator>
);
}
export default function App() {
return (
<>
<Header />
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Patient Login') {
iconName = focused
? 'bed-patient'
: 'bed-patient';
} else if (route.name === 'Provider Login') {
iconName = focused ? 'doctor' : 'doctor';
}
// You can return any component that you like here!
return <Ionicons name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: '#1DDCAF',
inactiveTintColor: 'gray',
}}
>
<Tab.Screen name="Patient Login" component={HomeStackScreen} />
<Tab.Screen name="Provider Login" component={SettingsStackScreen} />
</Tab.Navigator>
</NavigationContainer>
</>
);
}