From 8a7eceeb4fd26fdc3cf6250a4caa07c15a43a171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ra=CC=88dlinger?= Date: Tue, 12 Apr 2016 10:54:47 -0700 Subject: [PATCH] make NavigationHeader and NavigationHeaderTitle pointerEvents configurable Summary:I basically want to build a transparent NavigationHeader, so I need to be able to set the pointerEvents of the NavigationHeader. Closes https://github.com/facebook/react-native/pull/6881 Differential Revision: D3168620 Pulled By: ericvicenti fb-gh-sync-id: 679f3f5858142f468be329771ea281c31e1f0d40 fbshipit-source-id: 679f3f5858142f468be329771ea281c31e1f0d40 --- .../NavigationExperimental/NavigationHeader.js | 6 ++++-- .../NavigationExperimental/NavigationHeaderTitle.js | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js b/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js index 064986f9189..a0b1e78a1ab 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationHeader.js @@ -65,6 +65,7 @@ type Props = NavigationSceneRendererProps & { renderRightComponent: NavigationSceneRenderer, renderTitleComponent: NavigationSceneRenderer, style?: any; + viewProps?: any; }; type SubViewName = 'left' | 'title' | 'right'; @@ -99,6 +100,7 @@ class NavigationHeader extends React.Component { renderRightComponent: PropTypes.func, renderTitleComponent: PropTypes.func, style: View.propTypes.style, + viewProps: PropTypes.shape(View.propTypes), }; shouldComponentUpdate(nextProps: Props, nextState: any): boolean { @@ -110,7 +112,7 @@ class NavigationHeader extends React.Component { } render(): ReactElement { - const { scenes, style } = this.props; + const { scenes, style, viewProps } = this.props; const scenesProps = scenes.map(scene => { const props = NavigationPropTypes.extractSceneRendererProps(this.props); @@ -119,7 +121,7 @@ class NavigationHeader extends React.Component { }); return ( - + {scenesProps.map(this._renderLeft, this)} {scenesProps.map(this._renderTitle, this)} {scenesProps.map(this._renderRight, this)} diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js b/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js index 282f1df9c8e..1f4e14b5d9f 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js @@ -41,10 +41,11 @@ type Props = { children: ReactElement; style: any; textStyle: any; + viewProps: any; } -const NavigationHeaderTitle = ({ children, style, textStyle }: Props) => ( - +const NavigationHeaderTitle = ({ children, style, textStyle, viewProps }: Props) => ( + {children} );