Override forceInset on DrawerItems. (#2872)

Fixes second part of issue #2854.

`itemsContainerForceInset` takes the same object as `forceInset` on SafeAreaView. It overrides the SafeAreaView container in DrawerItems.
This commit is contained in:
Dave Pack
2017-11-01 15:48:39 -07:00
committed by GitHub
parent 313ec7ab76
commit c5f8eb20d8
2 changed files with 4 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ type Props = {
getLabel: (scene: DrawerScene) => ?(React.Node | string),
renderIcon: (scene: DrawerScene) => ?React.Node,
onItemPress: (info: DrawerItem) => void,
itemsContainerForceInset?: Object,
itemsContainerStyle?: ViewStyleProp,
itemStyle?: ViewStyleProp,
labelStyle?: TextStyleProp,
@@ -46,12 +47,13 @@ const DrawerNavigatorItems = ({
getLabel,
renderIcon,
onItemPress,
itemsContainerForceInset = { horizontal: 'never', top: 'always' },
itemsContainerStyle,
itemStyle,
labelStyle,
iconContainerStyle,
}: Props) => (
<SafeAreaView forceInset={{ horizontal: 'never', top: 'always' }}>
<SafeAreaView forceInset={itemsContainerForceInset}>
<View style={[styles.container, itemsContainerStyle]}>
{items.map((route: NavigationRoute, index: number) => {
const focused = activeItemKey === route.key;