From 214eeb13fba1a26d47165b3cf21958e3e414fef3 Mon Sep 17 00:00:00 2001 From: Arseny Yankovsky Date: Thu, 1 Mar 2018 22:42:19 +0100 Subject: [PATCH] Allow modification of SafeAreaView props (#3496) * SafeAreaView fix * Updated to only allow modification of forceInset property of SafeAreaView --- flow/react-navigation.js | 10 ++++++++++ src/views/Header/Header.js | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/flow/react-navigation.js b/flow/react-navigation.js index 9fd23f8..df4e716 100644 --- a/flow/react-navigation.js +++ b/flow/react-navigation.js @@ -48,6 +48,15 @@ declare module 'react-navigation' { // react-native/Libraries/Animated/src/nodes/AnimatedValue.js declare type AnimatedValue = Object; + declare type HeaderForceInset = { + horizontal?: string, + vertical?: string, + left?: string, + right?: string, + top?: string, + bottom?: string, + }; + /** * Next, all the type declarations */ @@ -341,6 +350,7 @@ declare module 'react-navigation' { headerPressColorAndroid?: string, headerRight?: React$Node, headerStyle?: ViewStyleProp, + headerForceInset?: HeaderForceInset, headerBackground?: React$Node | React$ElementType, gesturesEnabled?: boolean, gestureResponseDistance?: { vertical?: number, horizontal?: number }, diff --git a/src/views/Header/Header.js b/src/views/Header/Header.js index 8c8d548..789bba6 100644 --- a/src/views/Header/Header.js +++ b/src/views/Header/Header.js @@ -473,11 +473,11 @@ class Header extends React.PureComponent { safeHeaderStyle, ]; + const { headerForceInset } = options; + const forceInset = headerForceInset || { top: 'always', bottom: 'never' }; + return ( - + {options.headerBackground} {appBar}