- more
This commit is contained in:
@@ -13,9 +13,20 @@ import ImageDetail from './screens/ImageDetail.js';
|
||||
import Item from './screens/Item.js';
|
||||
import Marketplace from './screens/Marketplace.js';
|
||||
import Profile from './screens/Profile.container.js';
|
||||
import Register from './screens/Register.js';
|
||||
import Register from './screens/Register.container.js';
|
||||
import SignInOrRegister from './screens/SignInOrRegister.js';
|
||||
|
||||
const tabBarVisibility = ({ navigation }) => {
|
||||
let tabBarVisible = true;
|
||||
if (navigation.state.index > 0) {
|
||||
tabBarVisible = false;
|
||||
}
|
||||
|
||||
return {
|
||||
tabBarVisible,
|
||||
};
|
||||
};
|
||||
|
||||
export const SignInOrRegisterStack = createStackNavigator({
|
||||
SignInOrRegister: {
|
||||
screen: SignInOrRegister,
|
||||
@@ -35,6 +46,33 @@ export const SignInOrRegisterStack = createStackNavigator({
|
||||
},
|
||||
});
|
||||
|
||||
SignInOrRegisterStack.navigationOptions = tabBarVisibility;
|
||||
|
||||
export const ProfileStack = createStackNavigator({
|
||||
Profile: {
|
||||
screen: Profile,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
header: <AppHeader navigation={navigation} />,
|
||||
}),
|
||||
},
|
||||
SignInOrRegister: {
|
||||
screen: SignInOrRegister,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
header: null,
|
||||
gesturesEnabled: false,
|
||||
}),
|
||||
},
|
||||
Register: {
|
||||
screen: Register,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
header: null,
|
||||
gesturesEnabled: false,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
ProfileStack.navigationOptions = tabBarVisibility;
|
||||
|
||||
export const AuctionStack = createStackNavigator({
|
||||
Auction: {
|
||||
screen: Auction,
|
||||
@@ -60,6 +98,8 @@ export const AuctionStack = createStackNavigator({
|
||||
},
|
||||
});
|
||||
|
||||
AuctionStack.navigationOptions = tabBarVisibility;
|
||||
|
||||
export const BazaarStack = createStackNavigator({
|
||||
Bazaar: {
|
||||
screen: Marketplace,
|
||||
@@ -93,12 +133,13 @@ export const BazaarStack = createStackNavigator({
|
||||
},
|
||||
});
|
||||
|
||||
BazaarStack.navigationOptions = tabBarVisibility;
|
||||
|
||||
export const EventsStack = createStackNavigator({
|
||||
Events: {
|
||||
screen: Events,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
header: <AppHeader navigation={navigation} />,
|
||||
tabBarVisible: false,
|
||||
gesturesEnabled: false,
|
||||
}),
|
||||
},
|
||||
@@ -106,12 +147,13 @@ export const EventsStack = createStackNavigator({
|
||||
screen: Event,
|
||||
navigationOptions: ({ navigation }) => ({
|
||||
header: <AppHeader navigation={navigation} />,
|
||||
tabBarVisible: false,
|
||||
gesturesEnabled: false,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
EventsStack.navigationOptions = tabBarVisibility;
|
||||
|
||||
export const Tabs = createBottomTabNavigator({
|
||||
Event: {
|
||||
screen: EventsStack,
|
||||
@@ -141,7 +183,7 @@ export const Tabs = createBottomTabNavigator({
|
||||
},
|
||||
},
|
||||
Profile: {
|
||||
screen: Profile,
|
||||
screen: ProfileStack,
|
||||
navigationOptions: {
|
||||
tabBarLabel: 'Profile',
|
||||
tabBarIcon: ({ tintColor }) => (
|
||||
@@ -149,4 +191,4 @@ export const Tabs = createBottomTabNavigator({
|
||||
),
|
||||
},
|
||||
},
|
||||
});
|
||||
}, { initialRouteName: 'Event' });
|
||||
|
||||
Reference in New Issue
Block a user