diff --git a/locales/en/index.yml b/locales/en/index.yml index 43350d48fbb..e0e59a0642b 100644 --- a/locales/en/index.yml +++ b/locales/en/index.yml @@ -1013,6 +1013,11 @@ wallet: title: Vuoi pagare in app? content: Scopri quali sono i metodi che puoi aggiungere al tuo portafoglio. cta: Scopri di più + error: + title: Si è verificato un errore + subtitle: Riprova o contatta l'assistenza + primaryButton: Chiudi + secondaryButton: Riprova wallet: Wallet refreshWallet: Refresh the Wallet favourite: diff --git a/locales/it/index.yml b/locales/it/index.yml index 87e81440b7b..f5a8d5b56b3 100644 --- a/locales/it/index.yml +++ b/locales/it/index.yml @@ -1013,6 +1013,11 @@ wallet: title: Vuoi pagare in app? content: Scopri quali sono i metodi che puoi aggiungere al tuo portafoglio. cta: Scopri di più + error: + title: Si è verificato un errore + subtitle: Riprova o contatta l'assistenza + primaryButton: Chiudi + secondaryButton: Riprova wallet: Portafoglio refreshWallet: Aggiorna il Portafoglio favourite: diff --git a/ts/features/walletV3/details/screens/WalletDetailsScreen.tsx b/ts/features/walletV3/details/screens/WalletDetailsScreen.tsx index 2eec49f09b4..d371306e44b 100644 --- a/ts/features/walletV3/details/screens/WalletDetailsScreen.tsx +++ b/ts/features/walletV3/details/screens/WalletDetailsScreen.tsx @@ -1,12 +1,11 @@ import * as React from "react"; -import { RouteProp, useRoute } from "@react-navigation/native"; +import { RouteProp, useNavigation, useRoute } from "@react-navigation/native"; import { useDispatch } from "react-redux"; import { IOLogoPaymentExtType } from "@pagopa/io-app-design-system"; import * as O from "fp-ts/lib/Option"; import { pipe } from "fp-ts/lib/function"; import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay"; -import WorkunitGenericFailure from "../../../../components/error/WorkunitGenericFailure"; import { PaymentCardBig } from "../../../../components/ui/cards/payment/PaymentCardBig"; import { useIOSelector } from "../../../../store/hooks"; import { idPayAreInitiativesFromInstrumentLoadingSelector } from "../../../idpay/wallet/store/reducers"; @@ -22,6 +21,12 @@ import { import { walletDetailsGetInstrument } from "../store/actions"; import { UIWalletInfoDetails } from "../types/UIWalletInfoDetails"; import { getDateFromExpiryDate } from "../../../../utils/dates"; +import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent"; +import I18n from "../../../../i18n"; +import { + AppParamsList, + IOStackNavigationProp +} from "../../../../navigation/params/AppParamsList"; export type WalletDetailsScreenNavigationParams = Readonly<{ walletId: string; @@ -71,6 +76,7 @@ const generateCardHeaderTitle = (details?: UIWalletInfoDetails) => { */ const WalletDetailsScreen = () => { const route = useRoute(); + const navigation = useNavigation>(); const dispatch = useDispatch(); const { walletId } = route.params; const walletDetails = useIOSelector(walletDetailsInstrumentSelector); @@ -82,6 +88,30 @@ const WalletDetailsScreen = () => { idPayAreInitiativesFromInstrumentLoadingSelector ); + const WalletDetailsGenericFailure = () => ( + navigation.pop() + }} + secondaryAction={{ + label: I18n.t("wallet.methodDetails.error.secondaryButton"), + accessibilityLabel: I18n.t( + "wallet.methodDetails.error.secondaryButton" + ), + onPress: handleOnRetry + }} + /> + ); + + const handleOnRetry = () => { + dispatch(walletDetailsGetInstrument.request({ walletId })); + }; + React.useEffect(() => { dispatch(walletDetailsGetInstrument.request({ walletId })); }, [walletId, dispatch]); @@ -122,7 +152,7 @@ const WalletDetailsScreen = () => { ); } else if (isErrorWalletDetails) { - return ; + return ; } return null; };