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

Commit

Permalink
fix: don't set a header height when a custom header is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Aug 18, 2019
1 parent 4e2afa0 commit 1b82e25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
6 changes: 4 additions & 2 deletions packages/stack/src/views/Header/HeaderContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
) : (
Expand Down
15 changes: 4 additions & 11 deletions packages/stack/src/views/Header/HeaderSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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]}
Expand Down

0 comments on commit 1b82e25

Please sign in to comment.