Skip to content

Commit dbb98e0

Browse files
authored
Revert "docs: adding createMaterialBottomTabNavigator into docusaurus" (#3869)
1 parent 3c6af02 commit dbb98e0

File tree

4 files changed

+3
-93
lines changed

4 files changed

+3
-93
lines changed

docs/docusaurus.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ const config = {
7575
BottomNavigation: {
7676
BottomNavigation: 'BottomNavigation/BottomNavigation',
7777
BottomNavigationBar: 'BottomNavigation/BottomNavigationBar',
78-
createMaterialBottomTabNavigator:
79-
'../react-navigation/navigators/createMaterialBottomTabNavigator',
8078
},
8179
Button: {
8280
Button: 'Button/Button',
-180 KB
Binary file not shown.

src/index.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export { default as TextInput } from './components/TextInput/TextInput';
5555
export { default as ToggleButton } from './components/ToggleButton';
5656
export { default as SegmentedButtons } from './components/SegmentedButtons/SegmentedButtons';
5757
export { default as Tooltip } from './components/Tooltip/Tooltip';
58-
export { createMaterialBottomTabNavigator } from './react-navigation';
5958

6059
export {
6160
Caption,
@@ -149,12 +148,6 @@ export type { Props as TextProps } from './components/Typography/Text';
149148
export type { Props as SegmentedButtonsProps } from './components/SegmentedButtons/SegmentedButtons';
150149
export type { Props as ListImageProps } from './components/List/ListImage';
151150
export type { Props as TooltipProps } from './components/Tooltip/Tooltip';
152-
export type {
153-
MaterialBottomTabNavigationEventMap,
154-
MaterialBottomTabNavigationOptions,
155-
MaterialBottomTabNavigationProp,
156-
MaterialBottomTabScreenProps,
157-
} from './react-navigation';
158151

159152
export type {
160153
MD2Theme,

src/react-navigation/navigators/createMaterialBottomTabNavigator.tsx

Lines changed: 3 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type {
1818
} from '../types';
1919
import MaterialBottomTabView from '../views/MaterialBottomTabView';
2020

21-
export type MaterialBottomTabNavigatorProps = DefaultNavigatorOptions<
21+
type Props = DefaultNavigatorOptions<
2222
ParamListBase,
2323
TabNavigationState<ParamListBase>,
2424
MaterialBottomTabNavigationOptions,
@@ -27,84 +27,6 @@ export type MaterialBottomTabNavigatorProps = DefaultNavigatorOptions<
2727
TabRouterOptions &
2828
MaterialBottomTabNavigationConfig;
2929

30-
// This is just Docusaurus can parse the type and show it in the docs
31-
export type Props = {
32-
/**
33-
* Event which fires on tapping on the tab in the tab bar.
34-
*/
35-
tabPress: { data: undefined; canPreventDefault: true };
36-
37-
/**
38-
* Event which fires on long pressing on the tab in the tab bar.
39-
*/
40-
onTabLongPress: { data: undefined; canPreventDefault: true };
41-
42-
/**
43-
* Title text for the screen.
44-
*/
45-
title?: string;
46-
47-
/**
48-
* Color of the tab bar when this tab is active. Only used when `shifting` is `true`.
49-
*/
50-
tabBarColor?: string;
51-
52-
/**
53-
* Label text of the tab displayed in the navigation bar. When undefined, scene title is used.
54-
*/
55-
tabBarLabel?: string;
56-
57-
/**
58-
* String referring to an icon in the `MaterialCommunityIcons` set, or a
59-
* function that given { focused: boolean, color: string } returns a React.Node to display in the navigation bar.
60-
*/
61-
tabBarIcon?:
62-
| string
63-
| ((props: { focused: boolean; color: string }) => React.ReactNode);
64-
65-
/**
66-
* Badge to show on the tab icon, can be `true` to show a dot, `string` or `number` to show text.
67-
*/
68-
tabBarBadge?: boolean | number | string;
69-
70-
/**
71-
* Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.
72-
*/
73-
tabBarAccessibilityLabel?: string;
74-
75-
/**
76-
* ID to locate this tab button in tests.
77-
*/
78-
tabBarButtonTestID?: string;
79-
} & MaterialBottomTabNavigatorProps;
80-
81-
/**
82-
* 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.
83-
*
84-
* 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.
85-
*
86-
* <div class="screenshots">
87-
* <img class="medium" src="screenshots/material-bottom-tabs.gif" />
88-
* </div>
89-
*
90-
* ## Usage
91-
* ```js
92-
* import * as React from 'react';
93-
* import { createMaterialBottomTabNavigator } from 'react-native-paper';
94-
*
95-
* const Tab = createMaterialBottomTabNavigator();
96-
*
97-
* function MyTabs() {
98-
* return (
99-
* <Tab.Navigator>
100-
* <Tab.Screen name="Home" component={HomeScreen} />
101-
* <Tab.Screen name="Settings" component={SettingsScreen} />
102-
* </Tab.Navigator>
103-
* );
104-
* }
105-
* export default MyTabs;
106-
* ```
107-
*/
10830
function MaterialBottomTabNavigator({
10931
id,
11032
initialRouteName,
@@ -142,12 +64,9 @@ function MaterialBottomTabNavigator({
14264
);
14365
}
14466

145-
MaterialBottomTabNavigator.displayName = 'createMaterialBottomTabNavigator';
14667
export default createNavigatorFactory<
14768
TabNavigationState<ParamListBase>,
14869
MaterialBottomTabNavigationOptions,
14970
MaterialBottomTabNavigationEventMap,
150-
React.ComponentType<MaterialBottomTabNavigatorProps> /** Hack to sutisfies TS given the Prop type created for Docusaurus */
151-
>(
152-
MaterialBottomTabNavigator as React.ComponentType<MaterialBottomTabNavigatorProps>
153-
);
71+
typeof MaterialBottomTabNavigator
72+
>(MaterialBottomTabNavigator);

0 commit comments

Comments
 (0)