How to use the react-native-paper.BottomNavigation.SceneMap function in react-native-paper

To help you get started, we’ve selected a few react-native-paper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HenryQuan / WoWs-Info-Re / wowsinfo / src / ui / page / Home / Home.tsx View on Github external
this.state = {
      index: 0,
      routes: [
        { key: 'wiki', title: langs.home_tab_wiki!, icon: 'book' },
        { key: 'website', title: langs.home_tab_website!, icon: 'web' },
        { key: 'search', title: langs.home_tab_search!, icon: 'magnify' },
        { key: 'rs', title: langs.home_tab_rs!, icon: 'poll' },
        { key: 'main', title: langs.home_tab_main!, icon: 'account' },
      ],
      loading: true,
      error: ''
    };
  }

  renderScene = BottomNavigation.SceneMap({
    wiki: () => ,
    website: () => ,
    search: () => ,
    rs: () => ,
    main: () => ,
  });

  handleIndexChange = (index: number) => this.setState({ index });

  render() {
    const { rootView } = styles;
    // TODO: render a bottom navigation
    return (
github callstack / react-native-paper / example / src / Examples / BottomNavigationExample.tsx View on Github external
render() {
    return (
       this.setState({ index })}
        // @ts-ignore
        renderScene={BottomNavigation.SceneMap({
          album: PhotoGallery,
          library: PhotoGallery,
          favorites: PhotoGallery,
          purchased: PhotoGallery,
        })}
      />
    );
  }
}
github callstack / react-native-paper / example / src / Examples / BottomNavigationExample.tsx View on Github external
render() {
    return (
       this.setState({ index })}
        // @ts-ignore
        renderScene={BottomNavigation.SceneMap({
          album: PhotoGallery,
          library: PhotoGallery,
          favorites: PhotoGallery,
          purchased: PhotoGallery,
        })}
      />
    );
  }
}
github cometchat-pro-samples / react-native-chat-app / chatApp / src / HomeScreen.js View on Github external
render() {
        return (
            
        );
    }

    _handleIndexChange = index => this.setState({index});

    _renderScene = BottomNavigation.SceneMap({
        single: Contacts,
        groups: Groups,
    });
}

const styles = StyleSheet.create({
    container: {
        flex: 1
    },
    item: {
        padding: 15,
        fontSize: 18,
        height: 70,
        flexDirection: 'row',
        justifyContent: 'flex-start',
        alignItems: 'center',
github Tosuke / submarine / src / navigators / Main.tsx View on Github external
import React, { useState, useMemo } from 'react'
import { BottomNavigation, SceneProps } from 'react-native-paper'
import { AppBottomNavigation } from '../components/atoms/AppBottomNavigation'
import { HomeScreen } from '../components/pages/HomeScreen'
import { PreferencesScreen } from '../components/pages/Preferences'
import { withNavigationOptions } from '../components/hocs/withNavigationOption'

const routes = [
  { key: 'home', title: 'ホーム', icon: 'home' },
  { key: 'preferences', title: '設定', icon: 'settings' },
]

const scenes = BottomNavigation.SceneMap({
  home: HomeScreen as React.ComponentType>,
  preferences: PreferencesScreen as React.ComponentType>,
})

const MainTabImpl: React.FC = () => {
  const [index, updateIndex] = useState(0)
  const state = useMemo(
    () => ({
      index,
      routes,
    }),
    [index],
  )

  return (