Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 4d56405

Browse files
committed
fix: reuse types from react-native-paper
1 parent 5d374dc commit 4d56405

File tree

1 file changed

+17
-33
lines changed

1 file changed

+17
-33
lines changed

src/types.tsx

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { StyleProp, ViewStyle } from 'react-native';
2+
import { BottomNavigation } from 'react-native-paper';
23
import {
34
NavigationRoute,
45
NavigationState,
@@ -38,45 +39,28 @@ export type NavigationMaterialBottomTabOptions = {
3839
}) => void;
3940
};
4041

41-
export type NavigationMaterialBottomTabConfig = {
42-
/**
43-
* Whether the shifting style is used, the active tab appears wider and the inactive tabs won't have a label.
44-
* By default, this is `true` when you have more than 3 tabs.
45-
*/
46-
shifting?: boolean;
47-
/**
48-
* Whether to show labels in tabs. When `false`, only icons will be displayed.
49-
*/
50-
labeled?: boolean;
51-
/**
52-
* Custom color for icon and label in the active tab.
53-
*/
54-
activeColor?: string;
42+
export type NavigationMaterialBottomTabConfig = Partial<
43+
Omit<
44+
React.ComponentProps<typeof BottomNavigation>,
45+
| 'navigationState'
46+
| 'onIndexChange'
47+
| 'onTabPress'
48+
| 'renderScene'
49+
| 'renderLabel'
50+
| 'renderIcon'
51+
| 'getAccessibilityLabel'
52+
| 'getBadge'
53+
| 'getColor'
54+
| 'getLabelText'
55+
| 'getTestID'
56+
>
57+
> & {
5558
activeColorLight?: string;
5659
activeColorDark?: string;
57-
/**
58-
* Custom color for icon and label in the inactive tab.
59-
*/
60-
inactiveColor?: string;
6160
inactiveColorLight?: string;
6261
inactiveColorDark?: string;
63-
/**
64-
* Whether the bottom navigation bar is hidden when keyboard is shown.
65-
* On Android, this works best when [`windowSoftInputMode`](https://developer.android.com/guide/topics/manifest/activity-element#wsoft) is set to `adjustResize`.
66-
*/
67-
keyboardHidesNavigationBar?: boolean;
68-
/**
69-
* Style for the bottom navigation bar.
70-
* You can set a bottom padding here if you have a translucent navigation bar on Android:
71-
*
72-
* ```js
73-
* barStyle={{ paddingBottom: 48 }}
74-
* ```
75-
*/
76-
barStyle?: StyleProp<ViewStyle>;
7762
barStyleLight?: StyleProp<ViewStyle>;
7863
barStyleDark?: StyleProp<ViewStyle>;
79-
style?: StyleProp<ViewStyle>;
8064
};
8165

8266
export type NavigationTabScreenProps<

0 commit comments

Comments
 (0)