Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: [IOBP-1091] Paid in app empty state screen #6575

Merged
merged 7 commits into from
Dec 23, 2024

Conversation

LeleDallas
Copy link
Contributor

Short description

This pull request includes updates to localization files and enhancements to the ReceiptListScreen component. The most important changes is refactoring the empty state logic in the receipt list screen.

List of changes proposed in this pull request

  • Refactored the empty state logic to use a new emptyProps object based on the noticeCategory.
  • Added emptyPayer locale for displaying payment receipts made in the app.

How to test

  • In Pagamenti tap on Vedi tutte
  • Ensure that the Pagate in app tab is display correct empty state

Preview

Screen.Recording.2024-12-20.at.10.06.52.mov

@LeleDallas LeleDallas added the IO-Bonus e pagamenti IO - Bonus e pagamenti label Dec 20, 2024
@LeleDallas LeleDallas self-assigned this Dec 20, 2024
Copy link
Contributor

github-actions bot commented Dec 20, 2024

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOBP-1091

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 49.29%. Comparing base (9321272) to head (1d03d31).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...es/payments/receipts/screens/ReceiptListScreen.tsx 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6575      +/-   ##
==========================================
- Coverage   49.29%   49.29%   -0.01%     
==========================================
  Files        1555     1555              
  Lines       32119    32122       +3     
  Branches     7312     7268      -44     
==========================================
  Hits        15834    15834              
- Misses      16236    16250      +14     
+ Partials       49       38      -11     
Files with missing lines Coverage Δ
...es/payments/receipts/screens/ReceiptListScreen.tsx 3.12% <0.00%> (-0.16%) ⬇️

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9321272...1d03d31. Read the comment docs.

Comment on lines 166 to 170
const emptyProps: {
title: string;
subtitle?: string;
pictogram: IOPictograms;
} =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed you’ve defined a custom type for emptyProps. Since these properties are closely tied to OperationResultScreenContent, I suggest creating a derived type using Pick. This will make the code more maintainable and consistent with the component’s actual props. Example:

type OperationResultEmptyProps = Pick<
  typeof OperationResultScreenContent.propTypes,
  "title" | "subtitle" | "pictogram"
>;

This also helps avoid duplicating definitions if the props change in the future. Let me know what do you think about.

Copy link
Contributor Author

@LeleDallas LeleDallas Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to use OperationResultScreenContentProps type instead of typeof OperationResultScreenContent.propTypes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it makes more sense. I saw that the type OperationResultScreenContentProps was not exported. So in this case it's better to export it and use it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can find it here d9cbd7f

Comment on lines 168 to 171
type OperationResultEmptyProps = Pick<
OperationResultScreenContentProps,
"title" | "subtitle" | "pictogram"
>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you declare the type definition outside the component hook?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@Hantex9 Hantex9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO-Bonus e pagamenti IO - Bonus e pagamenti
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants