fix: don't set a header height when a custom header is specified

This commit is contained in:
satyajit.happy
2019-06-14 14:56:58 +02:00
parent 4e2afa0799
commit 1b82e25bb4
2 changed files with 8 additions and 13 deletions

View File

@@ -84,13 +84,15 @@ export default function HeaderContainer({
isFocused ? 'auto' : 'no-hide-descendants'
}
style={[
{ height: getDefaultHeaderHeight(layout) },
mode === 'float' ? StyleSheet.absoluteFill : null,
mode === 'screen' && options.header !== undefined
? null
: { height: getDefaultHeaderHeight(layout) },
options.headerStyle,
]}
>
{options.header !== undefined ? (
options.header == null ? null : (
options.header === null ? null : (
options.header(props)
)
) : (

View File

@@ -125,7 +125,8 @@ export default class HeaderSegment extends React.Component<Props, State> {
<HeaderBackButton {...props} />
),
headerBackground,
headerStatusBarHeight,
// @ts-ignore
headerStatusBarHeight = getStatusBarHeight(layout.width > layout.height),
headerRight: right,
headerBackImage: backImage,
headerBackTitle: leftLabel,
@@ -168,16 +169,8 @@ export default class HeaderSegment extends React.Component<Props, State> {
{headerBackground()}
</Animated.View>
) : null}
<View
pointerEvents="none"
style={{
height:
headerStatusBarHeight !== undefined
? headerStatusBarHeight
: getStatusBarHeight(layout.width > layout.height),
}}
/>
<View pointerEvents="box-none" style={[styles.container]}>
<View pointerEvents="none" style={{ height: headerStatusBarHeight }} />
<View pointerEvents="box-none" style={styles.container}>
{onGoBack ? (
<Animated.View
style={[styles.left, leftButtonStyle, leftContainerStyle]}