feat: cancellation phase UI for nextjs-evm and react-evm examples#74
Merged
Conversation
EByrdS
force-pushed
the
cancellation-phase
branch
from
April 22, 2026 12:50
312d174 to
84f38f7
Compare
WillSewell
reviewed
Apr 24, 2026
| <p className="text-amber-700 text-sm mt-1"> | ||
| The "Cancel Bid" button is only active when the contract is in the Cancellation stage (stage | ||
| 2). To test this feature, deploy your own contract and call{" "} | ||
| <code className="font-mono bg-amber-100 px-1 rounded">unsafeSetStage(2)</code> to move it to the |
Contributor
There was a problem hiding this comment.
I think instead of using this, we should be encouraging users to progress the sale in the normal way (i.e. openCancellation). And then to test again, they can just deploy a new contract.
It's now possible to do this via the Founder dashboard rather than by calling the contract directly so I think recommending that first but also linking to the contract docs here is probably best.
CancelCard destructures entityState from useSaleContract but the hook only exposed the derived currentTotalRaw scalar. Add entityState as a return value in both react-evm and nextjs-evm hooks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Exposes cancelBid and contractStage from useSaleContract in both react-svm and nextjs-svm - Updates settlement_sale IDL to include the cancel_bid instruction - Fixes pkce-store singleton to survive Next.js hot module reloads (globalThis instead of module-scoped var) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename "cancelled" phase to "cancellation" throughout all 4 frameworks (EVM/SVM, React/Next.js) - Replace red banner/card styling with neutral amber for the cancellation period - CancelCard: hide committed amount when 0, show "No active commitment to cancel" instead - CancelCard: update testing instructions to reference founder's dashboard + openCancellation, link to contract docs - CommitCard: add warning + disabled state when contract is not in Commitment stage (openCommitment) - Run prettier on all modified files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WillSewell
previously approved these changes
May 5, 2026
WillSewell
previously approved these changes
May 5, 2026
EByrdS
marked this pull request as ready for review
May 5, 2026 16:27
WillSewell
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CancelCardcomponent to bothnextjs-evmandreact-evmexample apps, mirroring the structure ofCommitCardbut for the cancellation flowuseSaleContract(and the react-evm equivalenthooks.ts) with acancelBid()contract call and acontractStagereadDetails
New:
CancelCardcomponentcancelBid()on the settlement contract (no permit required)contractStage === 2(Cancellation); otherwise shows an amber warning instructing the developer to deploy their own contract and callunsafeSetStage(2)Hook changes
cancelBid()— simulates then submits thecancelBidcontract callcontractStage— polls the contract'sstage()getter every 3 secondsDemo control bar
saleIsLive: boolean→salePhase: "presale" | "live" | "cancelled"(persisted inlocalStorage)CancelCard; no Sonar eligibility gate (the cancel action is purely contract-side)🤖 Generated with Claude Code