Migrate PaymentStatus and InvoiceStatus to use BaseStatus
Closes [Gitpay issue #123](https://onlydust.com/projects/gitpay/issues/123)
Whatβs inside this PR
Refactored PaymentStatus and InvoiceStatus to use the shared BaseStatus component β making things cleaner, more reusable, and easier to maintain.
Changes Made
- Replaced custom logic in
PaymentStatuswithBaseStatus - Replaced custom logic in
InvoiceStatuswithBaseStatus - Updated props wherever these components are used
- Cleaned up their respective Storybook files
- Verified that all status variants render correctly (screenshots below π½)
How to Test
-
Run Storybook:
npm run storybook -
Navigate to:
-
Atoms/Status/Payments/PaymentStatus -
Atoms/Status/Invoice/InvoiceStatus
-
-
Confirm that all status variants look and behave as expected
Screenshots
π InvoiceStatus
| Status | Label | Screenshot |
|---|---|---|
pending |
π‘ Pending | |
draft |
π Draft | |
open |
π Open | |
paid |
π° Paid | |
failed |
β Failed | |
uncollectible |
π« Uncollectible | |
void |
ποΈ Void | |
refunded |
π Refunded | |
loading |
β³ Loading |
πΈ PaymentStatus Fancy Table
| Status | Label | Screenshot |
|---|---|---|
open |
π Open | |
pending |
π‘ Pending | |
succeeded |
β Succeeded | |
failed |
β Failed | |
expired |
π Expired | |
canceled |
π« Canceled | |
refunded |
π Refunded | |
unknown |
β Unknown | |
loading |
β³ Loading |
Checklist
- [ ] Code tested and works as expected
- [ ] Uses
BaseStatusin both components - [ ] Props updated in all usage locations
- [ ] Storybook renders correctly for all variants
- [ ] No breaking changes introduced
- [ ] Follows code style and standards
Notes
- We updated the props passed wherever
PaymentStatusandInvoiceStatuswere used to match the new structure required byBaseStatus. - Functionality is the same β just cleaner, more scalable, and consistent π
Let me know if anything should be changed or if I missed a scenario!
Hey @Sia714 , it looks great! Thanks for the PR
We just need now to solve some merge conflicts, because recently we normalized the code formatting, can you check, please?
@Sia714 I had to solve the conflicts and create a new PR: https://github.com/worknenjoy/gitpay/pull/1236
Thanks for the contribution π