feat(frontend): build portfolio page, bet history table, countdown ti…#806
Merged
Merged
Conversation
…mer, and fighter card BetHistoryTable (src/components/bet/BetHistoryTable.tsx) - Add filter tabs: All / Active / Won / Lost / Pending Claim - Add sortable columns: Amount (XLM) and Date with asc/desc toggle - Add pagination (10 rows/page) with prev/next controls and row count - Add columns: Market (fighter names), My Bet, Amount, Odds, Status, Payout, Date, Action - Claim button on Pending Claim rows calls onClaim(market_id) - Accept optional markets map for resolving fighter names from market_id CountdownTimer (src/components/ui/CountdownTimer.tsx) - Rewrite to use own setInterval instead of useMarketCountdown hook - Format as DD:HH:MM:SS, updating every second - Clean up interval on unmount - Show 'Betting Closed' when target time is reached - Accept label prop for context (e.g. 'Betting closes in') - Rename prop scheduled_at -> targetDate; update callers in MarketCard and MarketDetailContent FighterCard (src/components/market/FighterCard.tsx) [new] - Show fighter name, implied odds (%), and pool amount in XLM - Optional photoUrl via next/image with 🥊 emoji fallback - Trophy icon overlay when isWinner=true - Amber ring border + 'Your pick' badge when isUserBet=true Portfolio page (src/app/portfolio/page.tsx) - Add BettorStats summary: Total Staked, Won, Lost, Win Rate, Pending Claims count - Add Claim All button iterating pending_claims deduped by market_id (one tx each) - Redirect to ConnectPrompt when wallet not connected - Show empty state with link to browse markets when no bets placed - Merge all bets (pending + active + past) into single BetHistoryTable with markets map
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.
closes #777
closes #778
closes #776
closes #779
…mer, and fighter card
BetHistoryTable (src/components/bet/BetHistoryTable.tsx)
CountdownTimer (src/components/ui/CountdownTimer.tsx)
FighterCard (src/components/market/FighterCard.tsx) [new]
Portfolio page (src/app/portfolio/page.tsx)
Closes
Closes #
What this PR does
Testing
Screenshots (frontend changes only)
Checklist
docs/contributing.mdcargo test/npm test)cargo clippy/npm run lint)console.logorunwrap()left in production paths