Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move NotificationView render location to no longer avoid keyboard
Browse files Browse the repository at this point in the history
The NotificationView should be rendered outside of the keyboard tracking
so it doesn't move when the keyboard is open.
samholmes committed Jan 25, 2024
1 parent c735e15 commit 6aac66b
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions src/components/common/SceneWrapper.tsx
Original file line number Diff line number Diff line change
@@ -192,34 +192,32 @@ export function SceneWrapper(props: SceneWrapperProps): JSX.Element {
const info: SceneWrapperInfo = { insets, insetStyle, undoInsetStyle, hasTabs, isKeyboardOpen }

return (
<MaybeAnimatedView when={avoidKeyboard} style={[styles.sceneContainer, layoutStyle, insetStyle, { maxHeight: keyboardAnimation, padding }]}>
<DotsBackground
accentColors={accentColors}
overrideDots={overrideDots}
backgroundGradientColors={backgroundGradientColors}
backgroundGradientStart={backgroundGradientStart}
backgroundGradientEnd={backgroundGradientEnd}
/>
<MaybeAnimatedScrollView
when={scroll && !avoidKeyboard}
style={[layoutStyle, { padding }]}
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
contentContainerStyle={insetStyle}
onScroll={hasTabs || hasHeader ? handleScroll : () => {}}
// Fixes middle-floating scrollbar issue
scrollIndicatorInsets={{ right: 1 }}
>
<MaybeView when={!scroll && !avoidKeyboard} style={[styles.sceneContainer, layoutStyle, insetStyle, { padding }]}>
{isFuncChildren ? children(info) : children}
</MaybeView>
</MaybeAnimatedScrollView>
{renderFooter != null || hasNotifications ? (
<>
{hasNotifications ? <NotificationView hasTabs={hasTabs} navigation={navigation} /> : null}
{renderFooter != null && !hasTabs ? <SceneFooter>{renderFooter(info)}</SceneFooter> : null}
</>
) : null}
</MaybeAnimatedView>
<>
<MaybeAnimatedView when={avoidKeyboard} style={[styles.sceneContainer, layoutStyle, insetStyle, { maxHeight: keyboardAnimation, padding }]}>
<DotsBackground
accentColors={accentColors}
overrideDots={overrideDots}
backgroundGradientColors={backgroundGradientColors}
backgroundGradientStart={backgroundGradientStart}
backgroundGradientEnd={backgroundGradientEnd}
/>
<MaybeAnimatedScrollView
when={scroll && !avoidKeyboard}
style={[layoutStyle, { padding }]}
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
contentContainerStyle={insetStyle}
onScroll={hasTabs || hasHeader ? handleScroll : () => {}}
// Fixes middle-floating scrollbar issue
scrollIndicatorInsets={{ right: 1 }}
>
<MaybeView when={!scroll && !avoidKeyboard} style={[styles.sceneContainer, layoutStyle, insetStyle, { padding }]}>
{isFuncChildren ? children(info) : children}
</MaybeView>
</MaybeAnimatedScrollView>
{renderFooter != null && !hasTabs ? <SceneFooter>{renderFooter(info)}</SceneFooter> : null}
</MaybeAnimatedView>
{hasNotifications ? <NotificationView hasTabs={hasTabs} navigation={navigation} /> : null}
</>
)
}

0 comments on commit 6aac66b

Please sign in to comment.