-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackNavigation.tsx
More file actions
96 lines (92 loc) · 3.93 KB
/
StackNavigation.tsx
File metadata and controls
96 lines (92 loc) · 3.93 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
import 'react-native-gesture-handler';
import { StyleSheet, Text, View, SafeAreaView, Image, ImageBackground, ActivityIndicator, TouchableOpacity } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import LoginScreen from './pages/login';
import SignupScreen from './pages/signup';
import Slider from './pages/sliders';
import Intro from './pages/intro';
import HomeScreen from './pages/home';
// import GifBackground from './pages/splash';
import AboutScreen from './pages/about';
import React,{useEffect,useState} from 'react';
// import { useUserData } from './pages/authHelpers';
const CustomTabBarButton = ({ accessibilityState, children, onPress }) => {
const focused = accessibilityState.selected;
return (
<TouchableOpacity
onPress={onPress}
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: focused ? 'mediumpurple' : 'transparent',
}}
>
{children}
</TouchableOpacity>
);
};
const Tab = createBottomTabNavigator();
const StackNavigation = () => {
const [isLogged, setIsLogged] = useState(false);
return (
<Tab.Navigator initialRouteName={isLogged ? 'Home' : 'Intro'}
screenOptions={{
tabBarShowLabel: false,
tabBarStyle: {
display: 'flex',
},
headerStyle: {
backgroundColor: 'white',
},
headerTintColor: 'white',
headerTitleAlign: 'center',
headerTitleStyle: {
fontWeight: 'bold',
color: 'black',
},
}}
>
<Tab.Screen
name="About"
component={AboutScreen}
options={{ headerShown: true, tabBarStyle: { display: 'none' },
tabBarVisible: false, }} // Hide the header for this screen
/>
<Tab.Screen
name="Intro"
component={Intro}
options={{ headerShown: false, tabBarStyle: { display: 'none' },
tabBarVisible: false, }} // Hide the header for this screen
/>
<Tab.Screen
name="Learn more"
component={Slider}
options={{ headerShown: false,tabBarStyle: { display: 'none' },
tabBarVisible: false, }} // Hide the header for this screen
/>
<Tab.Screen
name="Login"
component={LoginScreen}
options={{ headerShown: false,tabBarStyle: { display: 'none' },
tabBarVisible: false, }} // Hide the header for this screen
/>
<Tab.Screen
name="Signup"
component={SignupScreen}
options={{ headerShown: false,tabBarStyle: { display: 'none' },
tabBarVisible: false, }} // Hide the header for this screen
/>
</Tab.Navigator>
);
};
export default StackNavigation;
// <Tab.Screen
// name="Splash"
// component={GifBackground}
// options={{ headerShown: false, tabBarStyle: { display: 'none' },
// tabBarVisible: false, }} // Hide the header for this screen
// />