Skip to content

Migrate PaymentStatus and InvoiceStatus to use BaseStatus #1221

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Sia714
Copy link

@Sia714 Sia714 commented Jun 14, 2025

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!

@dosubot dosubot bot added refactoring testing Testing tasks labels Jun 14, 2025
@alexanmtz
Copy link
Member

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?

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

Successfully merging this pull request may close these issues.

2 participants