parent
72dec22409
commit
4a2f62c594
@ -1,29 +1,35 @@
|
|||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import { NavigationContainer } from 'react-native';
|
import { NavigationContainer } from '@react-navigation/native';
|
||||||
|
import Home from '../screens/spot';
|
||||||
|
import FavoritePage from '../screens/favoritePage';
|
||||||
|
import { createStackNavigator } from '@react-navigation/stack';
|
||||||
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||||
|
|
||||||
export default function Navigation() {
|
export default function StackNavigation() {
|
||||||
const BottomTabNavigator = createBottomTabNavigator();
|
const Stack = createBottomTabNavigator();
|
||||||
return (
|
return (
|
||||||
<NavigationContainer>
|
<NavigationContainer>
|
||||||
<BottomTabNavigator.Navigator initialRouteName="Favorite">
|
<Stack.Navigator initialRouteName="Home"
|
||||||
<BottomTabNavigator.Screen name="Home" component={Home}
|
screenOptions={{
|
||||||
options={{
|
|
||||||
title: 'Home',
|
}}>
|
||||||
tabBarIcon: ({color}) => <TabBarIcon name="hear" color={color}/>,
|
<Stack.Screen
|
||||||
}}/>
|
name="Home"
|
||||||
<BottomTabNavigator.Screen name="Favoris" component={Favorite}
|
component={FavoritePage}
|
||||||
options={{
|
options={{ headerShown: false }}
|
||||||
title: 'Favoris',
|
/>
|
||||||
tabBarIcon: ({color}) => <TabBarIcon name="hear" color={color}/>,
|
<Stack.Screen
|
||||||
}}/>
|
name="Favoris"
|
||||||
</BottomTabNavigator.Navigator>
|
component={FavoritePage}
|
||||||
|
options={{ headerShown: false }}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="Settings"
|
||||||
|
component={FavoritePage}
|
||||||
|
options={{ headerShown: false }}
|
||||||
|
/>
|
||||||
|
</Stack.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function TabBarIcon(props: {
|
|
||||||
name: React.ComponentProps<typeof FontAwesome>['name'];
|
|
||||||
color: string;
|
|
||||||
}) {
|
|
||||||
return <FontAwesome size={30} {...props} />;
|
|
||||||
}
|
|
Loading…
Reference in new issue