From c52d19bec82ff0c45ba666ce727dbfcbbccfdc4d Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Thu, 21 May 2020 15:31:34 +0200 Subject: [PATCH] chore: add example to hide and show bottom tab bar --- example/src/Screens/BottomTabs.tsx | 50 ++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/example/src/Screens/BottomTabs.tsx b/example/src/Screens/BottomTabs.tsx index b2b4e5ed..ed24c391 100644 --- a/example/src/Screens/BottomTabs.tsx +++ b/example/src/Screens/BottomTabs.tsx @@ -1,7 +1,11 @@ import * as React from 'react'; -import { Platform } from 'react-native'; +import { View, ScrollView, StyleSheet, Platform } from 'react-native'; +import { Button } from 'react-native-paper'; import { MaterialCommunityIcons } from '@expo/vector-icons'; -import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; +import { + createBottomTabNavigator, + BottomTabNavigationProp, +} from '@react-navigation/bottom-tabs'; import TouchableBounce from '../Shared/TouchableBounce'; import Albums from '../Shared/Albums'; import Contacts from '../Shared/Contacts'; @@ -23,6 +27,36 @@ type BottomTabParams = { Chat: undefined; }; +const scrollEnabled = Platform.select({ web: true, default: false }); + +const AlbumsScreen = ({ + navigation, +}: { + navigation: BottomTabNavigationProp; +}) => { + return ( + + + + + + + + ); +}; + const BottomTabs = createBottomTabNavigator(); export default function BottomTabsScreen() { @@ -62,7 +96,7 @@ export default function BottomTabsScreen() { /> ); } + +const styles = StyleSheet.create({ + buttons: { + flexDirection: 'row', + padding: 8, + }, + button: { + margin: 8, + }, +});