mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-28 12:25:21 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user