Skip to content

feat: contributor withdraw application with confirmation modal and on… - #508

Merged
FaveTeamz merged 2 commits into
FaveTeamz:mainfrom
NancieDev:feature/contributor-withdraw-application
Jul 31, 2026
Merged

feat: contributor withdraw application with confirmation modal and on…#508
FaveTeamz merged 2 commits into
FaveTeamz:mainfrom
NancieDev:feature/contributor-withdraw-application

Conversation

@NancieDev

Copy link
Copy Markdown
Contributor

…-chain tx

  • Add WithdrawConfirmModal: lightweight confirmation dialog (no fee display) built on existing Modal component with Cancel / Confirm withdrawal buttons
  • Add useWithdraw hook: full on-chain flow
    1. Fetch account sequence from Horizon
    2. POST /api/transactions/withdraw → unsigned XDR
    3. Freighter signTransaction(xdr)
    4. POST /api/transactions/submit → broadcast On success calls onSuccess(issueId); on failure calls onError(msg)
  • DashboardPage: add Pending applications section that fetches from /api/contributors/:address/applications and renders each as an ApplicationRow with a Withdraw button (disabled if status=assigned). Integrates WithdrawConfirmModal + ToastContainer for feedback. Success decrements global cap counter via dashboard refresh.
  • OrgIssuesPage: replace old DELETE-based handleWithdraw with the new on-chain useWithdraw flow + WithdrawConfirmModal. Add ToastContainer for success/error feedback; remove alert() calls.
  • tests/unit/WithdrawConfirmModal.test.tsx: unit tests covering closed state, rendered content, confirm/cancel callbacks, and loading state.

Closes #withdraw-confirm

Summary

Closes #289

…-chain tx

- Add WithdrawConfirmModal: lightweight confirmation dialog (no fee display)
  built on existing Modal component with Cancel / Confirm withdrawal buttons
- Add useWithdraw hook: full on-chain flow
  1. Fetch account sequence from Horizon
  2. POST /api/transactions/withdraw → unsigned XDR
  3. Freighter signTransaction(xdr)
  4. POST /api/transactions/submit → broadcast
  On success calls onSuccess(issueId); on failure calls onError(msg)
- DashboardPage: add Pending applications section that fetches from
  /api/contributors/:address/applications and renders each as an
  ApplicationRow with a Withdraw button (disabled if status=assigned).
  Integrates WithdrawConfirmModal + ToastContainer for feedback.
  Success decrements global cap counter via dashboard refresh.
- OrgIssuesPage: replace old DELETE-based handleWithdraw with the new
  on-chain useWithdraw flow + WithdrawConfirmModal. Add ToastContainer
  for success/error feedback; remove alert() calls.
- tests/unit/WithdrawConfirmModal.test.tsx: unit tests covering closed
  state, rendered content, confirm/cancel callbacks, and loading state.

Closes #withdraw-confirm
@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@NancieDev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@FaveTeamz
FaveTeamz merged commit 45a440b into FaveTeamz:main Jul 31, 2026
7 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Withdraw Application Flow

2 participants