Skip to content

Commit

Permalink
Revert "docs: adding createMaterialBottomTabNavigator into docusaurus" (
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak authored May 3, 2023
1 parent 3c6af02 commit dbb98e0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 93 deletions.
2 changes: 0 additions & 2 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ const config = {
BottomNavigation: {
BottomNavigation: 'BottomNavigation/BottomNavigation',
BottomNavigationBar: 'BottomNavigation/BottomNavigationBar',
createMaterialBottomTabNavigator:
'../react-navigation/navigators/createMaterialBottomTabNavigator',
},
Button: {
Button: 'Button/Button',
Expand Down
Binary file removed docs/static/screenshots/material-bottom-tabs.gif
Binary file not shown.
7 changes: 0 additions & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export { default as TextInput } from './components/TextInput/TextInput';
export { default as ToggleButton } from './components/ToggleButton';
export { default as SegmentedButtons } from './components/SegmentedButtons/SegmentedButtons';
export { default as Tooltip } from './components/Tooltip/Tooltip';
export { createMaterialBottomTabNavigator } from './react-navigation';

export {
Caption,
Expand Down Expand Up @@ -149,12 +148,6 @@ export type { Props as TextProps } from './components/Typography/Text';
export type { Props as SegmentedButtonsProps } from './components/SegmentedButtons/SegmentedButtons';
export type { Props as ListImageProps } from './components/List/ListImage';
export type { Props as TooltipProps } from './components/Tooltip/Tooltip';
export type {
MaterialBottomTabNavigationEventMap,
MaterialBottomTabNavigationOptions,
MaterialBottomTabNavigationProp,
MaterialBottomTabScreenProps,
} from './react-navigation';

export type {
MD2Theme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
} from '../types';
import MaterialBottomTabView from '../views/MaterialBottomTabView';

export type MaterialBottomTabNavigatorProps = DefaultNavigatorOptions<
type Props = DefaultNavigatorOptions<
ParamListBase,
TabNavigationState<ParamListBase>,
MaterialBottomTabNavigationOptions,
Expand All @@ -27,84 +27,6 @@ export type MaterialBottomTabNavigatorProps = DefaultNavigatorOptions<
TabRouterOptions &
MaterialBottomTabNavigationConfig;

// This is just Docusaurus can parse the type and show it in the docs
export type Props = {
/**
* Event which fires on tapping on the tab in the tab bar.
*/
tabPress: { data: undefined; canPreventDefault: true };

/**
* Event which fires on long pressing on the tab in the tab bar.
*/
onTabLongPress: { data: undefined; canPreventDefault: true };

/**
* Title text for the screen.
*/
title?: string;

/**
* Color of the tab bar when this tab is active. Only used when `shifting` is `true`.
*/
tabBarColor?: string;

/**
* Label text of the tab displayed in the navigation bar. When undefined, scene title is used.
*/
tabBarLabel?: string;

/**
* String referring to an icon in the `MaterialCommunityIcons` set, or a
* function that given { focused: boolean, color: string } returns a React.Node to display in the navigation bar.
*/
tabBarIcon?:
| string
| ((props: { focused: boolean; color: string }) => React.ReactNode);

/**
* Badge to show on the tab icon, can be `true` to show a dot, `string` or `number` to show text.
*/
tabBarBadge?: boolean | number | string;

/**
* Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.
*/
tabBarAccessibilityLabel?: string;

/**
* ID to locate this tab button in tests.
*/
tabBarButtonTestID?: string;
} & MaterialBottomTabNavigatorProps;

/**
* A material-design themed tab bar on the bottom of the screen that lets you switch between different routes with animation. Routes are lazily initialized - their screen components are not mounted until they are first focused.
*
* This is a convenient wrapper which provides prebuilt [React Navigation's Bottom Tabs Navigator](https://reactnavigation.org/docs/bottom-tab-navigator/) integration so users can easily import it and use and don’t want to deal with setting up a custom tab bar.
*
* <div class="screenshots">
* <img class="medium" src="screenshots/material-bottom-tabs.gif" />
* </div>
*
* ## Usage
* ```js
* import * as React from 'react';
* import { createMaterialBottomTabNavigator } from 'react-native-paper';
*
* const Tab = createMaterialBottomTabNavigator();
*
* function MyTabs() {
* return (
* <Tab.Navigator>
* <Tab.Screen name="Home" component={HomeScreen} />
* <Tab.Screen name="Settings" component={SettingsScreen} />
* </Tab.Navigator>
* );
* }
* export default MyTabs;
* ```
*/
function MaterialBottomTabNavigator({
id,
initialRouteName,
Expand Down Expand Up @@ -142,12 +64,9 @@ function MaterialBottomTabNavigator({
);
}

MaterialBottomTabNavigator.displayName = 'createMaterialBottomTabNavigator';
export default createNavigatorFactory<
TabNavigationState<ParamListBase>,
MaterialBottomTabNavigationOptions,
MaterialBottomTabNavigationEventMap,
React.ComponentType<MaterialBottomTabNavigatorProps> /** Hack to sutisfies TS given the Prop type created for Docusaurus */
>(
MaterialBottomTabNavigator as React.ComponentType<MaterialBottomTabNavigatorProps>
);
typeof MaterialBottomTabNavigator
>(MaterialBottomTabNavigator);

0 comments on commit dbb98e0

Please sign in to comment.