Skip to content

feat(frontend): build portfolio page, bet history table, countdown ti…#806

Merged
GoSTEAN merged 1 commit into
Netwalls:mainfrom
Dafuriousis:feat/portfolio-ui-components
May 28, 2026
Merged

feat(frontend): build portfolio page, bet history table, countdown ti…#806
GoSTEAN merged 1 commit into
Netwalls:mainfrom
Dafuriousis:feat/portfolio-ui-components

Conversation

@Dafuriousis
Copy link
Copy Markdown
Contributor

closes #777
closes #778
closes #776
closes #779

…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

Closes

Closes #

What this PR does

Testing

Screenshots (frontend changes only)

Checklist

  • I have read docs/contributing.md
  • My code follows the naming conventions in the guidelines
  • I have added or updated tests for my changes
  • All tests pass locally (cargo test / npm test)
  • Lint passes (cargo clippy / npm run lint)
  • No console.log or unwrap() left in production paths
  • No secrets committed

…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
@GoSTEAN GoSTEAN merged commit e6dd0b9 into Netwalls:main May 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants