Skip to content

Commit

Permalink
Merge branch 'master' into dhinterlechner-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dhinterlechner authored Dec 23, 2024
2 parents c32e439 + f739c10 commit 0e80dc7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
2 changes: 2 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
56 changes: 36 additions & 20 deletions ts/features/payments/receipts/screens/ReceiptListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,39 @@ 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,
"PAYMENT_RECEIPT_DETAILS"
>;

type OperationResultEmptyProps = Pick<
OperationResultScreenContentProps,
"title" | "subtitle" | "pictogram"
>;

const AnimatedSectionList = Animated.createAnimatedComponent(
SectionList as new () => SectionList<NoticeListItem>
);
Expand All @@ -59,7 +67,6 @@ const ReceiptListScreen = () => {

const transactionsPot = useIOSelector(walletReceiptListPotSelector);
const isEmpty = useIOSelector(isPaymentsTransactionsEmptySelector);

const isLoading = pot.isLoading(transactionsPot);

const handleNavigateToTransactionDetails = (transaction: NoticeListItem) => {
Expand Down Expand Up @@ -163,14 +170,23 @@ const ReceiptListScreen = () => {
</>
);

const emptyProps: OperationResultEmptyProps =
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 ? (
<ReceiptFadeInOutAnimationView>
<OperationResultScreenContent
isHeaderVisible
title={I18n.t("features.payments.transactions.list.empty.title")}
subtitle={I18n.t("features.payments.transactions.list.empty.subtitle")}
pictogram="emptyArchive"
/>
<OperationResultScreenContent isHeaderVisible {...emptyProps} />
</ReceiptFadeInOutAnimationView>
) : undefined;

Expand Down

0 comments on commit 0e80dc7

Please sign in to comment.