Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { FooterActions } from "@pagopa/io-app-design-system";
import {
FooterActions,
useFooterActionsMeasurements
} from "@pagopa/io-app-design-system";
import * as E from "fp-ts/lib/Either";
import { pipe } from "fp-ts/lib/function";
import { FunctionComponent, memo, useCallback, useState } from "react";
Expand Down Expand Up @@ -36,6 +39,11 @@ const TosWebviewComponent: FunctionComponent<Props> = ({
}: Props) => {
const [hasError, setHasError] = useState(false);

const showFooter = shouldRenderFooter && onAcceptTos;

const { footerActionsMeasurements, handleFooterActionsMeasurements } =
useFooterActionsMeasurements();

const handleError = useCallback(() => {
handleLoadEnd();
setHasError(true);
Expand Down Expand Up @@ -65,7 +73,15 @@ const TosWebviewComponent: FunctionComponent<Props> = ({
<TosWebviewErrorComponent handleRetry={handleRetry} />
) : (
<>
<View style={{ flex: 1 }} testID="toSWebViewContainer">
<View
style={{
flex: 1,
paddingBottom: showFooter
? footerActionsMeasurements.safeBottomAreaHeight
: 0
}}
testID="toSWebViewContainer"
>
<WebView
androidCameraAccessDisabled={true}
androidMicrophoneAccessDisabled={true}
Expand All @@ -81,8 +97,10 @@ const TosWebviewComponent: FunctionComponent<Props> = ({
)}
/>
</View>
{shouldRenderFooter && onAcceptTos && (
{showFooter && (
<FooterActions
transparent
onMeasure={handleFooterActionsMeasurements}
actions={{
type: "SingleButton",
primary: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exports[`TosWebviewComponent The snapshot for the TosWebviewComponent Should ren
style={
{
"flex": 1,
"paddingBottom": 0,
}
}
testID="toSWebViewContainer"
Expand Down
Loading