Skip to content

fix: resolve #407 — Export player as a trading card image#509

Open
SlncTrZ wants to merge 4 commits into
zengm-games:masterfrom
SlncTrZ:CntrB/improve/quality/create-tradingcard-component-for-player-
Open

fix: resolve #407 — Export player as a trading card image#509
SlncTrZ wants to merge 4 commits into
zengm-games:masterfrom
SlncTrZ:CntrB/improve/quality/create-tradingcard-component-for-player-

Conversation

@SlncTrZ
Copy link
Copy Markdown

@SlncTrZ SlncTrZ commented May 10, 2026

Summary

fix: resolve #407 — Export player as a trading card image

Problem

Severity: High | File: src/components/TradingCard.tsx

Adds a new React component that renders a compact "trading card" style summary of a player’s key stats, awards, and basic info. This component will be used to generate the downloadable image. It accepts a player object and optional styling flags (e.g., theme, sport type) to adapt the design for Basketball GM, Football GM, etc.

Solution

Implement as a functional component using inline styles or CSS modules for consistent printing/capture. Include: player name, team, jersey number, position, overall/potential ratings, key season/career stats (points, rebounds, assists, etc. – sport‑dependent), notable awards (MVP, championships, all‑star selections), and a subtle background graphic. Use a fixed width (e.g., 400px) and auto height. Provide a className or data‑html2canvas‑ignore for elements that should not be captured. Add a ref to allow parent component to measure and capture.

Changes

  • src/components/TradingCard.tsx (new)
  • src/components/TradingCard.module.css (new)
  • src/utils/exportImage.ts (new)
  • package.json (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced"

SlncTrZ added 4 commits May 11, 2026 02:51
Fixes zengm-games#407

Signed-off-by: Dinh Truong (SlncTrZ) <46520299+SlncTrZ@users.noreply.github.com>
Fixes zengm-games#407

Signed-off-by: Dinh Truong (SlncTrZ) <46520299+SlncTrZ@users.noreply.github.com>
Fixes zengm-games#407

Signed-off-by: Dinh Truong (SlncTrZ) <46520299+SlncTrZ@users.noreply.github.com>
Fixes zengm-games#407

Signed-off-by: Dinh Truong (SlncTrZ) <46520299+SlncTrZ@users.noreply.github.com>
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.

Export player as a trading card image

1 participant