Skip to content

Commit

Permalink
delete safe area to render correctly the footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladirico committed May 13, 2024
1 parent 8b11592 commit b2da8f1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 56 deletions.
71 changes: 34 additions & 37 deletions ts/screens/onboarding/OnboardingTosScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
IOToast,
VSpacer
} from "@pagopa/io-app-design-system";
import { SafeAreaView } from "react-native-safe-area-context";
import LoadingSpinnerOverlay from "../../components/LoadingSpinnerOverlay";
import { ContextualHelpPropsMarkdown } from "../../components/screens/BaseScreenComponent";
import TosWebviewComponent from "../../components/TosWebviewComponent";
Expand Down Expand Up @@ -128,43 +127,41 @@ const OnboardingTosScreen = () => {

return (
<LoadingSpinnerOverlay isLoading={isLoading || isUpdatingProfile}>
<SafeAreaView edges={["bottom"]} style={IOStyles.flex}>
<View style={IOStyles.horizontalContentPadding}>
<H2
accessible={true}
accessibilityRole="header"
testID="screen-content-header-title"
>
{I18n.t("profile.main.privacy.privacyPolicy.title")}
</H2>
<VSpacer size={16} />
<View style={IOStyles.horizontalContentPadding}>
<H2
accessible={true}
accessibilityRole="header"
testID="screen-content-header-title"
>
{I18n.t("profile.main.privacy.privacyPolicy.title")}
</H2>
<VSpacer size={16} />
</View>
{!hasAcceptedCurrentTos && (
<View
style={IOStyles.horizontalContentPadding}
testID={"currentToSNotAcceptedView"}
>
<AlertDS
viewRef={viewRef}
testID="currentToSNotAcceptedText"
variant="info"
content={
hasAcceptedOldTosVersion
? I18n.t("profile.main.privacy.privacyPolicy.updated")
: I18n.t("profile.main.privacy.privacyPolicy.infobox")
}
/>
</View>
{!hasAcceptedCurrentTos && (
<View
style={IOStyles.horizontalContentPadding}
testID={"currentToSNotAcceptedView"}
>
<AlertDS
viewRef={viewRef}
testID="currentToSNotAcceptedText"
variant="info"
content={
hasAcceptedOldTosVersion
? I18n.t("profile.main.privacy.privacyPolicy.updated")
: I18n.t("profile.main.privacy.privacyPolicy.infobox")
}
/>
</View>
)}
<TosWebviewComponent
flow={flow}
handleLoadEnd={handleLoadEnd}
handleReload={handleReload}
webViewSource={{ uri: privacyUrl }}
shouldRenderFooter={!isLoading}
onAcceptTos={onAcceptTos}
/>
</SafeAreaView>
)}
<TosWebviewComponent
flow={flow}
handleLoadEnd={handleLoadEnd}
handleReload={handleReload}
webViewSource={{ uri: privacyUrl }}
shouldRenderFooter={!isLoading}
onAcceptTos={onAcceptTos}
/>
</LoadingSpinnerOverlay>
);
};
Expand Down
35 changes: 16 additions & 19 deletions ts/screens/profile/TosScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* This screen is used as Privacy screen From Profile section.
*/
import React, { useState } from "react";
import { SafeAreaView } from "react-native-safe-area-context";
import { H2, IOStyles } from "@pagopa/io-app-design-system";
import { View } from "react-native";
import LoadingSpinnerOverlay from "../../components/LoadingSpinnerOverlay";
Expand Down Expand Up @@ -49,24 +48,22 @@ const TosScreen = () => {

return (
<LoadingSpinnerOverlay isLoading={isLoading}>
<SafeAreaView edges={["bottom"]} style={IOStyles.flex}>
<View style={IOStyles.horizontalContentPadding}>
<H2
accessible={true}
accessibilityRole="header"
testID="screen-content-header-title"
>
{I18n.t("profile.main.privacy.privacyPolicy.title")}
</H2>
</View>
<TosWebviewComponent
flow={flow}
handleLoadEnd={handleLoadEnd}
handleReload={handleReload}
webViewSource={{ uri: privacyUrl }}
shouldRenderFooter={false}
/>
</SafeAreaView>
<View style={IOStyles.horizontalContentPadding}>
<H2
accessible={true}
accessibilityRole="header"
testID="screen-content-header-title"
>
{I18n.t("profile.main.privacy.privacyPolicy.title")}
</H2>
</View>
<TosWebviewComponent
flow={flow}
handleLoadEnd={handleLoadEnd}
handleReload={handleReload}
webViewSource={{ uri: privacyUrl }}
shouldRenderFooter={false}
/>
</LoadingSpinnerOverlay>
);
};
Expand Down

0 comments on commit b2da8f1

Please sign in to comment.