From 54ed367476e9e5c1b5b68587ed3937aa54ac7c3b Mon Sep 17 00:00:00 2001
From: Emanuele Dall'Ara <71103219+LeleDallas@users.noreply.github.com>
Date: Fri, 20 Dec 2024 09:53:55 +0100
Subject: [PATCH 1/4] chore: update locales
---
locales/en/index.yml | 2 ++
locales/it/index.yml | 2 ++
2 files changed, 4 insertions(+)
diff --git a/locales/en/index.yml b/locales/en/index.yml
index 8c2b33fac22..d279e122d65 100644
--- a/locales/en/index.yml
+++ b/locales/en/index.yml
@@ -3240,6 +3240,8 @@ features:
empty:
title: Nessuna ricevuta trovata
subtitle: Se stai cercando la ricevuta di un avviso pagoPA che hai pagato in passato, rivolgiti all’ente creditore.
+ emptyPayer:
+ title: Qui vedrai le ricevute dei pagamenti fatti in app
details:
payPal:
banner:
diff --git a/locales/it/index.yml b/locales/it/index.yml
index 640a6ab0a72..5d1e2965228 100644
--- a/locales/it/index.yml
+++ b/locales/it/index.yml
@@ -3240,6 +3240,8 @@ features:
empty:
title: Nessuna ricevuta trovata
subtitle: Se stai cercando la ricevuta di un avviso pagoPA che hai pagato in passato, rivolgiti all’ente creditore.
+ emptyPayer:
+ title: Qui vedrai le ricevute dei pagamenti fatti in app
details:
payPal:
banner:
From 8a945455113ba7ec65f0fb60244e2ba216132498 Mon Sep 17 00:00:00 2001
From: Emanuele Dall'Ara <71103219+LeleDallas@users.noreply.github.com>
Date: Fri, 20 Dec 2024 10:01:07 +0100
Subject: [PATCH 2/4] refactor: empty transaction payer screen content
---
.../receipts/screens/ReceiptListScreen.tsx | 27 ++++++++++++++-----
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/ts/features/payments/receipts/screens/ReceiptListScreen.tsx b/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
index 95d1f2d51f8..f7ee874bccf 100644
--- a/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
+++ b/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
@@ -1,5 +1,6 @@
import {
Divider,
+ IOPictograms,
IOStyles,
ListItemHeader
} from "@pagopa/io-app-design-system";
@@ -59,7 +60,6 @@ const ReceiptListScreen = () => {
const transactionsPot = useIOSelector(walletReceiptListPotSelector);
const isEmpty = useIOSelector(isPaymentsTransactionsEmptySelector);
-
const isLoading = pot.isLoading(transactionsPot);
const handleNavigateToTransactionDetails = (transaction: NoticeListItem) => {
@@ -163,14 +163,27 @@ const ReceiptListScreen = () => {
>
);
+ const emptyProps: {
+ title: string;
+ subtitle?: string;
+ pictogram: IOPictograms;
+ } =
+ noticeCategory === "payer"
+ ? {
+ title: I18n.t("features.payments.transactions.list.emptyPayer.title"),
+ pictogram: "empty"
+ }
+ : {
+ title: I18n.t("features.payments.transactions.list.empty.title"),
+ subtitle: I18n.t(
+ "features.payments.transactions.list.empty.subtitle"
+ ),
+ pictogram: "emptyArchive"
+ };
+
const EmptyStateList = isEmpty ? (
-
+
) : undefined;
From d9cbd7f98a6102496de3ca3bb36873df8d392a79 Mon Sep 17 00:00:00 2001
From: Emanuele Dall'Ara <71103219+LeleDallas@users.noreply.github.com>
Date: Mon, 23 Dec 2024 10:21:49 +0100
Subject: [PATCH 3/4] refactor: change request
---
.../receipts/screens/ReceiptListScreen.tsx | 41 ++++++++++---------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/ts/features/payments/receipts/screens/ReceiptListScreen.tsx b/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
index f7ee874bccf..214384a8860 100644
--- a/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
+++ b/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
@@ -1,6 +1,5 @@
import {
Divider,
- IOPictograms,
IOStyles,
ListItemHeader
} from "@pagopa/io-app-design-system";
@@ -13,25 +12,28 @@ import Animated, {
useSharedValue
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
-import { useIODispatch, useIOSelector } from "../../../../store/hooks";
-import { PaymentsReceiptParamsList } from "../navigation/params";
-import { getPaymentsReceiptAction } from "../store/actions";
-import { walletReceiptListPotSelector } from "../store/selectors";
-import { useIONavigation } from "../../../../navigation/params/AppParamsList";
-import { isPaymentsTransactionsEmptySelector } from "../../home/store/selectors";
-import { ReceiptListItemTransaction } from "../components/ReceiptListItemTransaction";
+import { NoticeListItem } from "../../../../../definitions/pagopa/biz-events/NoticeListItem";
+import {
+ OperationResultScreenContent,
+ OperationResultScreenContentProps
+} from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
-import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
-import { groupTransactionsByMonth } from "../utils";
import I18n from "../../../../i18n";
-import { PaymentsReceiptRoutes } from "../navigation/routes";
-import { NoticeListItem } from "../../../../../definitions/pagopa/biz-events/NoticeListItem";
+import { useIONavigation } from "../../../../navigation/params/AppParamsList";
+import { useIODispatch, useIOSelector } from "../../../../store/hooks";
+import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
+import { isPaymentsTransactionsEmptySelector } from "../../home/store/selectors";
import * as analytics from "../analytics";
-import { ReceiptsCategoryFilter } from "../types";
-import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { ReceiptFadeInOutAnimationView } from "../components/ReceiptFadeInOutAnimationView";
+import { ReceiptListItemTransaction } from "../components/ReceiptListItemTransaction";
import { ReceiptLoadingList } from "../components/ReceiptLoadingList";
import { ReceiptSectionListHeader } from "../components/ReceiptSectionListHeader";
+import { PaymentsReceiptParamsList } from "../navigation/params";
+import { PaymentsReceiptRoutes } from "../navigation/routes";
+import { getPaymentsReceiptAction } from "../store/actions";
+import { walletReceiptListPotSelector } from "../store/selectors";
+import { ReceiptsCategoryFilter } from "../types";
+import { groupTransactionsByMonth } from "../utils";
export type ReceiptListScreenProps = RouteProp<
PaymentsReceiptParamsList,
@@ -163,11 +165,12 @@ const ReceiptListScreen = () => {
>
);
- const emptyProps: {
- title: string;
- subtitle?: string;
- pictogram: IOPictograms;
- } =
+ type OperationResultEmptyProps = Pick<
+ OperationResultScreenContentProps,
+ "title" | "subtitle" | "pictogram"
+ >;
+
+ const emptyProps: OperationResultEmptyProps =
noticeCategory === "payer"
? {
title: I18n.t("features.payments.transactions.list.emptyPayer.title"),
From 1d03d3146f8011d5e7f581a1df51d62e04a468e4 Mon Sep 17 00:00:00 2001
From: Emanuele Dall'Ara <71103219+LeleDallas@users.noreply.github.com>
Date: Mon, 23 Dec 2024 10:31:20 +0100
Subject: [PATCH 4/4] refactor: move type definition outside hook
---
.../payments/receipts/screens/ReceiptListScreen.tsx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ts/features/payments/receipts/screens/ReceiptListScreen.tsx b/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
index 214384a8860..789b1386e7c 100644
--- a/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
+++ b/ts/features/payments/receipts/screens/ReceiptListScreen.tsx
@@ -40,6 +40,11 @@ export type ReceiptListScreenProps = RouteProp<
"PAYMENT_RECEIPT_DETAILS"
>;
+type OperationResultEmptyProps = Pick<
+ OperationResultScreenContentProps,
+ "title" | "subtitle" | "pictogram"
+>;
+
const AnimatedSectionList = Animated.createAnimatedComponent(
SectionList as new () => SectionList
);
@@ -165,11 +170,6 @@ const ReceiptListScreen = () => {
>
);
- type OperationResultEmptyProps = Pick<
- OperationResultScreenContentProps,
- "title" | "subtitle" | "pictogram"
- >;
-
const emptyProps: OperationResultEmptyProps =
noticeCategory === "payer"
? {