From 84e92440fe0f4b32632ab670e1d9c1374970c788 Mon Sep 17 00:00:00 2001 From: "satyajit.happy" Date: Sun, 20 Oct 2019 05:22:18 +0200 Subject: [PATCH] fix: make headerShown option work --- src/views/Header/HeaderStyleInterpolator.tsx | 5 +++-- src/views/StackView/StackViewLayout.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/Header/HeaderStyleInterpolator.tsx b/src/views/Header/HeaderStyleInterpolator.tsx index f7d541220..775e2325a 100644 --- a/src/views/Header/HeaderStyleInterpolator.tsx +++ b/src/views/Header/HeaderStyleInterpolator.tsx @@ -6,8 +6,9 @@ function hasHeader(scene: Scene) { if (!scene) { return true; } - const { descriptor } = scene; - return descriptor.options.header !== null; + const { header, headerShown } = scene.descriptor.options; + + return header !== null && headerShown !== false; } const crossFadeInterpolation = ( diff --git a/src/views/StackView/StackViewLayout.tsx b/src/views/StackView/StackViewLayout.tsx index cd2f27ff6..a2cf83ca5 100644 --- a/src/views/StackView/StackViewLayout.tsx +++ b/src/views/StackView/StackViewLayout.tsx @@ -956,7 +956,7 @@ class StackViewLayout extends React.Component { // When using a floating header, we need to add some top // padding on the scene. const { options } = scene.descriptor; - const hasHeader = options.header !== null; + const hasHeader = options.header !== null && options.headerShown !== false; const headerMode = this.getHeaderMode(); let floatingContainerStyle: ViewStyle = StyleSheet.absoluteFill as ViewStyle;