Skip to content

Commit

Permalink
fix: assistance flow actionsheet contains extra space on header (#6513)
Browse files Browse the repository at this point in the history
## Short description
This PR fixes a minor issue caused by latest fix on header-status banner
integration.

## How to test
Check the UI resiliency with or without a Status banner or in any screen
presented as an ActionSheet
  • Loading branch information
CrisTofani authored Dec 6, 2024
1 parent 6d87026 commit 3591b9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ts/components/ui/IOScrollView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ export const IOScrollView = ({
)
}));

const ignoreSafeAreaMargin = React.useMemo(() => {
if (alertProps !== undefined) {
return true;
}
return headerConfig?.ignoreSafeAreaMargin;
}, [headerConfig?.ignoreSafeAreaMargin, alertProps]);

/* Set custom header with `react-navigation` library using
`useLayoutEffect` hook */

Expand All @@ -259,7 +266,7 @@ export const IOScrollView = ({
header: () => (
<HeaderSecondLevel
{...headerConfig}
ignoreSafeAreaMargin={!!alertProps}
ignoreSafeAreaMargin={ignoreSafeAreaMargin}
scrollValues={scrollValues}
/>
),
Expand All @@ -271,7 +278,7 @@ export const IOScrollView = ({
navigation,
scrollPositionAbsolute,
snapOffset,
alertProps
ignoreSafeAreaMargin
]);

const RefreshControlComponent = refreshControlProps ? (
Expand Down
2 changes: 2 additions & 0 deletions ts/components/ui/IOScrollViewWithLargeHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const IOScrollViewWithLargeHeader = forwardRef<View, Props>(
contextualHelp,
contextualHelpMarkdown,
faqCategories,
ignoreSafeAreaMargin = false,
includeContentMargins = false,
headerActionsProp = {},
excludeEndContentMargin,
Expand All @@ -90,6 +91,7 @@ export const IOScrollViewWithLargeHeader = forwardRef<View, Props>(
};

const headerProps: ComponentProps<typeof HeaderSecondLevel> = {
ignoreSafeAreaMargin,
...useHeaderProps(
canGoback
? {
Expand Down

0 comments on commit 3591b9a

Please sign in to comment.