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

Commit

Permalink
fix: reuse types from react-native-paper
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Oct 29, 2019
1 parent 5d374dc commit 4d56405
Showing 1 changed file with 17 additions and 33 deletions.
50 changes: 17 additions & 33 deletions src/types.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { StyleProp, ViewStyle } from 'react-native';
import { BottomNavigation } from 'react-native-paper';
import {
NavigationRoute,
NavigationState,
Expand Down Expand Up @@ -38,45 +39,28 @@ export type NavigationMaterialBottomTabOptions = {
}) => void;
};

export type NavigationMaterialBottomTabConfig = {
/**
* Whether the shifting style is used, the active tab appears wider and the inactive tabs won't have a label.
* By default, this is `true` when you have more than 3 tabs.
*/
shifting?: boolean;
/**
* Whether to show labels in tabs. When `false`, only icons will be displayed.
*/
labeled?: boolean;
/**
* Custom color for icon and label in the active tab.
*/
activeColor?: string;
export type NavigationMaterialBottomTabConfig = Partial<
Omit<
React.ComponentProps<typeof BottomNavigation>,
| 'navigationState'
| 'onIndexChange'
| 'onTabPress'
| 'renderScene'
| 'renderLabel'
| 'renderIcon'
| 'getAccessibilityLabel'
| 'getBadge'
| 'getColor'
| 'getLabelText'
| 'getTestID'
>
> & {
activeColorLight?: string;
activeColorDark?: string;
/**
* Custom color for icon and label in the inactive tab.
*/
inactiveColor?: string;
inactiveColorLight?: string;
inactiveColorDark?: string;
/**
* Whether the bottom navigation bar is hidden when keyboard is shown.
* On Android, this works best when [`windowSoftInputMode`](https://developer.android.com/guide/topics/manifest/activity-element#wsoft) is set to `adjustResize`.
*/
keyboardHidesNavigationBar?: boolean;
/**
* Style for the bottom navigation bar.
* You can set a bottom padding here if you have a translucent navigation bar on Android:
*
* ```js
* barStyle={{ paddingBottom: 48 }}
* ```
*/
barStyle?: StyleProp<ViewStyle>;
barStyleLight?: StyleProp<ViewStyle>;
barStyleDark?: StyleProp<ViewStyle>;
style?: StyleProp<ViewStyle>;
};

export type NavigationTabScreenProps<
Expand Down

0 comments on commit 4d56405

Please sign in to comment.