diff --git a/.gitignore b/.gitignore index 18be5d21..1faaa763 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,12 @@ test-results/ playwright-report/ playwright/.cache/ +# ─── Jest snapshots & cache ─────────────────────────────────── +__snapshots__/ +*.snap +.jest-cache/ +jest_cache/ + # ─── Docker ────────────────────────────────────────────────── .docker/ diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index ce982ace..bdb72ea0 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -6,6 +6,7 @@ import type { Metadata } from 'next'; import { Inter } from 'next/font/google'; import { Header } from '../components/layout/Header'; +import { ToastProvider } from '../components/ui/ToastProvider'; import './globals.css'; const inter = Inter({ subsets: ['latin'] }); @@ -19,8 +20,10 @@ export default function RootLayout({ children }: { children: React.ReactNode }): return (
-Fighter A
+{market.fighter_a}
+{(market.odds_a / 100).toFixed(1)}%
+Fighter B
+{market.fighter_b}
+{(market.odds_b / 100).toFixed(1)}%
+No bets yet.
- ) : ( -| Bettor | -Side | -Amount | -Time | -
|---|---|---|---|
| - - {truncate(bet.tx_hash)} - - | -{sideLabel(bet.side)} | -{bet.amount_xlm} XLM | -- {new Date(bet.placed_at).toLocaleTimeString()} - | -
Oracle:{' '}
+ {/* #797: Stellar Explorer link for oracle account */}
Resolution TX:{' '}
+ {/* #797: Stellar Explorer link for resolution tx */}
{
- if (dismissedError && claimTxStatus.status !== 'error') {
- setDismissedError(false);
- }
- }, [claimTxStatus.status, dismissedError]);
-
- // Show toast unless it's an error and user dismissed it
- const displayStatus = dismissedError && claimTxStatus.status === 'error'
- ? { hash: null, status: 'idle' as const, error: null }
- : claimTxStatus;
-
- const handleDismiss = () => {
- if (claimTxStatus.status === 'error') {
- setDismissedError(true);
+ if (claimTxStatus.status === 'success') {
+ toast.success('Winnings claimed successfully!');
+ } else if (claimTxStatus.status === 'error') {
+ toast.error(claimTxStatus.error ?? 'Claim failed. Please try again.');
}
- };
+ }, [claimTxStatus.status]);
if (!isConnected) {
return (
@@ -104,8 +93,6 @@ export default function PortfolioPage(): JSX.Element {
No bets yet. {toast.message}Bet History
+
+
+
+
+
+
+ {paginated.map((bet) => {
+ // Bets have no bettor_address; use tx_hash as identifier
+ const isOwn = walletAddress
+ ? bet.tx_hash.toLowerCase().startsWith(walletAddress.slice(0, 6).toLowerCase())
+ : false;
+
+ return (
+ Bettor
+ Outcome
+ Amount
+ Time
+
+
+ );
+ })}
+
+
+
+ {truncateTx(bet.tx_hash)}
+
+ {isOwn && (
+ (you)
+ )}
+
+
+
+ {sideLabel(bet.side)}
+
+
+ {bet.amount_xlm} XLM
+
+ {timeAgo(bet.placed_at)}
+
+