react-navigation-tabs#BottomTabBar JavaScript Examples

The following examples show how to use react-navigation-tabs#BottomTabBar. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainNavigator.js    From real-frontend with GNU General Public License v3.0 6 votes vote down vote up
tabNavigator = (screenProps) => createBottomTabNavigator({
  HomeStack: HomeStack(screenProps),
  SearchStack: SearchStack(screenProps),
  NotificationsStack: NotificationsStack(screenProps),
  DatingStack: DatingStack(screenProps),
  ProfileStack: ProfileStack(screenProps),
}, {
  tabBarOptions: {
    showLabel: false,
    style: {
      backgroundColor: '#F9F9F9',
    },
  },
  tabBarComponent: props => (
    <BottomTabBar
      {...props}
      style={{
        backgroundColor: props.screenProps.theme.colors.backgroundPrimary,
      }}
    />
  ),
})
Example #2
Source File: MainTabNavigator.js    From expo-soundcloud-clone with MIT License 5 votes vote down vote up
TabBarComponent = props => {
  return (
    <React.Fragment>
      <BottomTabBar {...props} />
    </React.Fragment>
  );
}
Example #3
Source File: routes.js    From haven with MIT License 4 votes vote down vote up
MainTab = createBottomTabNavigator(
  {
    Shop: {
      screen: ShopTab,
      navigationOptions: {
        tabBarOnPress: ({ defaultHandler }) => {
          eventTracker.trackEvent('MainNavigationTap-Discover');
          defaultHandler();
        },
        tabBarIcon: ({ focused }) => (
          <Feather name="shopping-cart" size={23} color={focused ? '#00bf65' : '#969696'} />
        ),
      },
    },
    Feed: {
      screen: FeedTab,
      navigationOptions: {
        tabBarOnPress: ({ defaultHandler }) => {
          eventTracker.trackEvent('MainNavigationTap-Social');
          defaultHandler();
        },
        tabBarIcon: ({ focused }) => (
          <Feather name="users" size={23} color={focused ? '#00bf65' : '#969696'} />
        ),
      },
    },
    Plus: {
      screen: () => null,
      navigationOptions: {
        tabBarOnPress: ({ defaultHandler }) => {
          eventTracker.trackEvent('MainNavigationTap-Create');
          defaultHandler();
        },
        tabBarIcon: () => <PlusButton />,
      },
    },
    Chat: {
      screen: ChatsTab,
      navigationOptions: {
        tabBarOnPress: ({ defaultHandler }) => {
          eventTracker.trackEvent('MainNavigationTap-Chat');
          defaultHandler();
        },
        tabBarIcon: ({ focused }) => <ChatNavIcon focused={focused} />,
      },
    },
    Me: {
      screen: MeTab,
      navigationOptions: {
        tabBarOnPress: ({ defaultHandler }) => {
          eventTracker.trackEvent('MainNavigationTap-Me');
          defaultHandler();
        },
        tabBarIcon: ({ focused }) => <ProfilePicture focused={focused} />,
      },
    },
  },
  {
    tabBarPosition: 'bottom',
    swipeEnabled: false,
    lazy: false,
    tabBarComponent: props => (
      <BottomTabBar
        {...props}
        onTabPress={(tabInfo) => {
        if (tabInfo.route.routeName === 'Me') {
          const resetTabAction = NavigationActions.navigate({
            routeName: 'Me',
            action: StackActions.reset({
              index: 0,
              actions: [NavigationActions.navigate({ routeName: 'WalletMain' })],
            }),
          });
          props.navigation.dispatch(resetTabAction);
        } else {
          props.onTabPress(tabInfo);
        }
      }}
      />
    ),
    animationEnabled: false,
    removeClippedSubviews: true,
    tabBarOptions: {
      showLabel: false,
      activeTintColor: '#000000',
      tabStyle: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
  },
)