-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
105 lines (86 loc) · 2.69 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
104
105
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import HomePage from './Screens/Homepage';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Fontisto } from '@expo/vector-icons';
import { FontAwesome } from '@expo/vector-icons';
import SearchScreen from './Screens/SearchScreen';
import SearchResults from './Screens/SearchResults';
import { createNativeStackNavigator } from "@react-navigation/native-stack";
const MainStack = createNativeStackNavigator();
export function ReactStackNavigation(){
return(
<MainStack.Navigator>
<MainStack.Screen name="SearchScreen"
component={SearchScreen}
options={()=>({
headerStyle:
{
backgroundColor:'#1DB953',
shadowColor: 'transparent',
elevation: 0,
},
headerShadowVisible:false,
headerShown:false
})
}
/>
<MainStack.Screen name="SearchResults"
component={SearchResults}
options={()=>({
headerStyle:
{
backgroundColor:'#1DB953',
shadowColor: 'transparent',
elevation: 0,
},
headerShadowVisible:false,
headerShown:false
})
}
/>
</MainStack.Navigator>
);
}
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon:({color,size})=>
{
if(route.name === 'Home'){
return <Fontisto name="film" size={size} color={color} />
}
else if(route.name === 'Search'){
return <FontAwesome name="search" size={size} color={color} />
}
},
tabBarActiveTintColor: 'tomato',
tabBarInactiveTintColor: 'gray',
"tabBarHideOnKeyboard": "true",
"tabBarStyle": [
{
"display": "flex"
},
null
]
})}
>
<Tab.Screen name='Home' component={HomePage} />
<Tab.Screen name='Search' component={ReactStackNavigation} />
</Tab.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#14171A',
alignItems: 'center',
justifyContent: 'center',
},
});