Skip to content

Commit

Permalink
Fix insets when notifications are not enabled for a scene
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-edge committed Mar 22, 2024
1 parent c1b7fc3 commit 5216f8f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/common/SceneWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ function SceneWrapperComponent(props: SceneWrapperProps): JSX.Element {

// Calculate app insets considering the app's header, tab-bar,
// notification area, etc:
const maybeNotificationHeight = hasNotifications ? notificationHeight : 0

const maybeHeaderHeight = hasHeader ? headerBarHeight : 0
// Ignore tab bar height when keyboard is open because it is rendered behind it
const maybeTabBarHeight = hasTabs && !isKeyboardOpen ? MAX_TAB_BAR_HEIGHT : 0
Expand All @@ -170,10 +172,19 @@ function SceneWrapperComponent(props: SceneWrapperProps): JSX.Element {
() => ({
top: safeAreaInsets.top + maybeHeaderHeight,
right: safeAreaInsets.right,
bottom: maybeInsetBottom + notificationHeight + maybeTabBarHeight + footerHeight,
bottom: maybeInsetBottom + maybeNotificationHeight + maybeTabBarHeight + footerHeight,
left: safeAreaInsets.left
}),
[footerHeight, maybeHeaderHeight, maybeInsetBottom, notificationHeight, maybeTabBarHeight, safeAreaInsets.left, safeAreaInsets.right, safeAreaInsets.top]
[
footerHeight,
maybeHeaderHeight,
maybeInsetBottom,
maybeNotificationHeight,
maybeTabBarHeight,
safeAreaInsets.left,
safeAreaInsets.right,
safeAreaInsets.top
]
)

// This is a convenient styles object which may be applied as
Expand Down

0 comments on commit 5216f8f

Please sign in to comment.