Fix/495 legal disclaimer integration#2
Open
Whiznificent wants to merge 3 commits into
Open
Conversation
368997d to
e565b28
Compare
…ation and fund release flows
…view and VaultValueCard
fd02dd5 to
6ab9777
Compare
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.
fix(KingFRANKHOOD#495): Integrate LegalDisclaimerModal into trade creation and fund deposit flows
Problem
A LegalDisclaimerModal component displaying loss-sharing terms existed in the codebase but was never connected to any user flow. Users could create trades and deposit funds without ever seeing or acknowledging the legal terms — a compliance gap.
What was fixed
Trade Creation (Step3Review.tsx)
Clicking Lock Funds & Create Trade now opens the LegalDisclaimerModal before any transaction is signed or submitted. The modal shows the buyer/seller loss-sharing percentages and the trade value in cNGN. The Stellar transaction only proceeds after the user clicks Accept & Proceed. Clicking Decline returns the user to the review screen with nothing submitted.
Fund Deposit (
page.tsx
)
Clicking the Deposit button now opens the LegalDisclaimerModal before the existing confirmation modal. Loss ratio and trade value are pulled directly from the trade record. Only after accepting does the deposit confirmation flow continue.
UI Barrel (
index.ts
)
Exported LegalDisclaimerModal from the shared UI index so it can be imported cleanly across the app.
CI Fix (Step3Review.test.tsx)
The existing tests expected the loading state to appear immediately on submit click. With the disclaimer gate in place, that flow changed. Updated tests to:
Mock LegalDisclaimerModal with a lightweight stub
Click through Accept & Proceed before asserting loading state
Fix an incorrect assertion (USDC → cNGN) in the authorization message test
Add 3 new tests covering disclaimer show, hide on decline, and no API call on decline
Closes KingFRANKHOOD#495