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

Commit

Permalink
feat: add custom GH props
Browse files Browse the repository at this point in the history
  • Loading branch information
osdnk authored and satya164 committed Aug 18, 2019
1 parent 0f1fea3 commit 35d7304
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/drawer/src/views/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -488,6 +489,7 @@ export default class DrawerView extends React.PureComponent<Props> {
onGestureRef,
renderDrawerContent,
renderSceneContent,
gestureHandlerProps,
} = this.props;

const right = drawerPosition === 'right';
Expand Down Expand Up @@ -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}
Expand Down
3 changes: 3 additions & 0 deletions packages/drawer/src/views/DrawerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type DrawerOptions = {
edgeWidth: number;
hideStatusBar?: boolean;
style?: ViewStyle;
gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
};

type Props = {
Expand Down Expand Up @@ -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;
Expand All @@ -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}
Expand Down

0 comments on commit 35d7304

Please sign in to comment.