From ea4c74b8ccc081ff1d9a7eba455dcb74fafbbd17 Mon Sep 17 00:00:00 2001 From: Federico Mastrini Date: Mon, 19 Aug 2024 17:40:51 +0200 Subject: [PATCH] chore(IT Wallet): [SIW-1465] Fix header in eID preview screen (#6085) ## Short description This PR adds the correct close button in the eID preview screen header ## List of changes proposed in this pull request - Added `ForceScrollDownView` in the `ItwIssuanceEidPreviewScreen` - Manually added `HeaderSecondLevel` component via the `navigation.setOption` function ## How to test Start the eID issuance flow. In the eID preview screen, check that the close button is correctly displayed and, when it is pressed, it shows the dismiss dialog ## Preview --------- Co-authored-by: Mario Perrotta --- .../screens/ItwIssuanceEidPreviewScreen.tsx | 93 ++++++++++++------- 1 file changed, 61 insertions(+), 32 deletions(-) diff --git a/ts/features/itwallet/issuance/screens/ItwIssuanceEidPreviewScreen.tsx b/ts/features/itwallet/issuance/screens/ItwIssuanceEidPreviewScreen.tsx index 80ef6a989c1..d3275397c76 100644 --- a/ts/features/itwallet/issuance/screens/ItwIssuanceEidPreviewScreen.tsx +++ b/ts/features/itwallet/issuance/screens/ItwIssuanceEidPreviewScreen.tsx @@ -1,9 +1,16 @@ -import { ContentWrapper } from "@pagopa/io-app-design-system"; +import { + ForceScrollDownView, + H2, + HeaderSecondLevel, + IOVisualCostants, + VSpacer +} from "@pagopa/io-app-design-system"; import * as O from "fp-ts/lib/Option"; import { constNull, pipe } from "fp-ts/lib/function"; import React from "react"; +import { StyleSheet, View } from "react-native"; import LoadingScreenContent from "../../../../components/screens/LoadingScreenContent"; -import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader"; +import { FooterActions } from "../../../../components/ui/FooterActions"; import { useDebugInfo } from "../../../../hooks/useDebugInfo"; import I18n from "../../../../i18n"; import { useIONavigation } from "../../../../navigation/params/AppParamsList"; @@ -49,12 +56,6 @@ const ContentView = ({ eid }: ContentViewProps) => { const dispatch = useIODispatch(); const navigation = useIONavigation(); - React.useLayoutEffect(() => { - navigation.setOptions({ - headerShown: true - }); - }, [navigation]); - useDebugInfo({ parsedCredential: eid.parsedCredential }); @@ -84,31 +85,59 @@ const ContentView = ({ eid }: ContentViewProps) => { ); }; + React.useLayoutEffect(() => { + navigation.setOptions({ + headerShown: true, + header: () => ( + + ) + }); + }, [navigation, dismissDialog]); + return ( - - + + +

{I18n.t("features.itWallet.issuance.eidPreview.title")}

+ -
-
+ + + + ); }; + +const styles = StyleSheet.create({ + scroll: { + flexGrow: 1 + }, + contentWrapper: { + flexGrow: 1, + paddingHorizontal: IOVisualCostants.appMarginDefault + } +});