-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
51 lines (46 loc) · 1.45 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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { FontAwesome } from '@expo/vector-icons';
import FavouritesList from './Screens/FavouriteList';
import CountriesList from './Screens/WorldCountiresList';
import DetailsScreen from './Screens/CountryDetails';
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
// Stack Navigation for countries list and details
const CountriesStack = () => {
return (
<Stack.Navigator>
<Stack.Screen name="Countries" component={CountriesList} />
<Stack.Screen name="CountryDetails" component={DetailsScreen} />
</Stack.Navigator>
);
};
// Tab navigation for displaying main screen
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator>
<Tab.Screen
name="List"
component={CountriesStack}
options={{
tabBarIcon: () => (
<FontAwesome name="list" size={20} color={"blue"} />
),
}}
/>
<Tab.Screen
name="Favourites"
component={FavouritesList}
options={{
tabBarIcon: () => (
<FontAwesome name="heart" color={"blue"} size={20} />
),
}}
/>
</Tab.Navigator>
</NavigationContainer>
);
}