gitpay icon indicating copy to clipboard operation
gitpay copied to clipboard

Migrate PaymentStatus and InvoiceStatus to use BaseStatus

Open Sia714 opened this issue 8 months ago β€’ 1 comments

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 PaymentStatus with BaseStatus
  • Replaced custom logic in InvoiceStatus with BaseStatus
  • 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

  1. Run Storybook:

    npm run storybook
    
  2. Navigate to:

    • Atoms/Status/Payments/PaymentStatus
    • Atoms/Status/Invoice/InvoiceStatus
  3. Confirm that all status variants look and behave as expected


Screenshots

πŸ“„ InvoiceStatus

Status Label Screenshot
pending 🟑 Pending pending
draft πŸ“ Draft draft
open πŸ“‚ Open open
paid πŸ’° Paid paid
failed ❌ Failed failed
uncollectible 🚫 Uncollectible uncollectible
void πŸ—‘οΈ Void void
refunded πŸ” Refunded refunded
loading ⏳ Loading loading

πŸ’Έ PaymentStatus Fancy Table

Status Label Screenshot
open πŸ“‚ Open open
pending 🟑 Pending pending
succeeded βœ… Succeeded succeeded
failed ❌ Failed failed
expired πŸ•“ Expired expired
canceled 🚫 Canceled canceled
refunded πŸ” Refunded refunded
unknown ❓ Unknown unknown
loading ⏳ Loading loading

Checklist

  • [ ] Code tested and works as expected
  • [ ] Uses BaseStatus in 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 PaymentStatus and InvoiceStatus were used to match the new structure required by BaseStatus.
  • Functionality is the same β€” just cleaner, more scalable, and consistent πŸ’…

Let me know if anything should be changed or if I missed a scenario!

Sia714 avatar Jun 14 '25 18:06 Sia714

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?

alexanmtz avatar Jun 19 '25 21:06 alexanmtz

@Sia714 I had to solve the conflicts and create a new PR: https://github.com/worknenjoy/gitpay/pull/1236

Thanks for the contribution πŸ™

alexanmtz avatar Jul 10 '25 18:07 alexanmtz