Skip to content

Add Polymarket page and FIFA player headshots#2

Open
x-du wants to merge 11 commits into
26worldcup:mainfrom
x-du:main
Open

Add Polymarket page and FIFA player headshots#2
x-du wants to merge 11 commits into
26worldcup:mainfrom
x-du:main

Conversation

@x-du

@x-du x-du commented Jun 21, 2026

Copy link
Copy Markdown

Summary

  • Adds a new Market tab (next to Forecast) showing live FIFA World Cup winner odds from Polymarket's real-money prediction market.
  • Adds FIFA player headshots on team squad cards: official Digital Hub image URLs fetched in CI (optional --fetch-photos refresh), stored in player-photos.json, and linked directly from squad data — no image downloads, no runtime third-party requests beyond <img> loads from digitalhub.fifa.com.
  • Follows the project's data architecture: odds and photo URLs are written to static JSON in CI — no runtime API calls from the client for market or squad enrichment.

Polymarket (Market tab)

  • scripts/update.mjs: new fetchMarketOdds() step maps Polymarket team labels to FIFA codes, normalizes prices to sum to 100%, and records polymarket.com as a data source. The fetch is non-blocking — a failure preserves the previous JSON.
  • src/pages/Polymarket.tsx + polymarket.css: new lazily-loaded route /polymarket, wired into App.tsx, Layout.tsx (nav), and More.tsx.
  • src/data/DataContext.tsx: lazy loadMarketOdds() loader; src/types.ts: MarketOdds / MarketOutcome interfaces.
  • Localized all new strings across all 23 languages.
  • InfoDot: optional align prop + global tooltip CSS so header popovers render above the table and stay on-screen near edges.

Player photos (team pages)

  • scripts/update.mjs: fetchFifaPhotos() (with --fetch-photos) pulls PlayerPicture.PictureUrl from api.fifa.com; normal updates apply URLs from public/data/player-photos.json via shirt-number join.
  • public/data/player-photos.json: ~1,247 FIFA player id → Digital Hub URL lookup; "photo" field stamped on each squad player.
  • src/pages/TeamDetail.tsx + teamdetail.css: horizontal player cards with full-height headshot column; fifaPhotoUrl() adds on-the-fly crop/size transform params.
  • index.html: CSP img-src allows https://digitalhub.fifa.com.

Test plan

  • tsc -b and Biome pass.
  • Headless smoke test loads /polymarket without console/page errors.
  • Open a team page (e.g. /team/BRA) — player avatars load from Digital Hub; initials fallback when missing.
  • Visually verify Market tab and team cards in light/dark, RTL (Arabic), and a few locales.
  • Confirm CI data-update workflow populates market-odds.json; run node scripts/update.mjs --fetch-photos locally to refresh photo lookup when needed.

x-du and others added 2 commits June 21, 2026 15:25
Add a Market tab showing live World Cup winner odds from Polymarket's
public API, fetched in CI into static market-odds.json (no runtime
third-party requests). Includes win-chance/market-price/24h table,
localized copy across all 23 languages, and a reusable InfoDot tooltip
alignment fix so header popovers render above the table.

Co-authored-by: Cursor <cursoragent@cursor.com>
@x-du

x-du commented Jun 21, 2026

Copy link
Copy Markdown
Author

@tomchen could you take a look when you get a chance? Thanks!

x-du and others added 6 commits June 21, 2026 18:22
Show official digitalhub.fifa.com portrait URLs on team pages with a
redesigned squad card (number inline with name, full-height photo on the
right). Add a static player-photos.json lookup built via --fetch-photos;
the default update run only re-applies existing links and preserves them
across wiki squad refreshes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Point deploy.yml at the feature branch so the fork can publish player
headshots without merging to main. Leave update-data.yml on main unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the existing cron grid and cron-guard logic unchanged, but commit
refreshed JSON to feat/player-photos and redeploy Pages from that branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bring player photo URLs from FIFA Digital Hub into squad data and show
official headshots on team pages, without changing GitHub Actions workflows.

Co-authored-by: Cursor <cursoragent@cursor.com>
@x-du x-du changed the title Add Polymarket prediction-market page Add Polymarket page and FIFA player headshots Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant