feat: add custom GH props

This commit is contained in:
osdnk
2019-06-12 18:01:17 +02:00
committed by satyajit.happy
parent 0f1fea3014
commit 35d7304533
2 changed files with 6 additions and 0 deletions

View File

@@ -90,6 +90,7 @@ type Props = {
contentContainerStyle?: ViewStyle;
renderDrawerContent: Renderer;
renderSceneContent: Renderer;
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
};
export default class DrawerView extends React.PureComponent<Props> {
@@ -488,6 +489,7 @@ export default class DrawerView extends React.PureComponent<Props> {
onGestureRef,
renderDrawerContent,
renderSceneContent,
gestureHandlerProps,
} = this.props;
const right = drawerPosition === 'right';
@@ -519,6 +521,7 @@ export default class DrawerView extends React.PureComponent<Props> {
onHandlerStateChange={this.handleGestureEvent}
hitSlop={hitSlop}
enabled={!locked}
{...gestureHandlerProps}
>
<Animated.View
onLayout={this.handleContainerLayout}

View File

@@ -27,6 +27,7 @@ type DrawerOptions = {
edgeWidth: number;
hideStatusBar?: boolean;
style?: ViewStyle;
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
};
type Props = {
@@ -202,6 +203,7 @@ export default class DrawerView extends React.PureComponent<Props, State> {
minSwipeDistance,
hideStatusBar,
statusBarAnimation,
gestureHandlerProps,
} = this.props.navigationConfig;
const activeKey = navigation.state.routes[navigation.state.index].key;
const { drawerLockMode } = this.props.descriptors[activeKey].options;
@@ -224,6 +226,7 @@ export default class DrawerView extends React.PureComponent<Props, State> {
onOpen={this.handleDrawerOpen}
onClose={this.handleDrawerClose}
onGestureRef={this.setDrawerGestureRef}
gestureHandlerProps={gestureHandlerProps}
drawerType={drawerType}
drawerPosition={this.props.navigationConfig.drawerPosition}
contentContainerStyle={contentContainerStyle}