Skip to content

Remove mockUserStats fallback when live stats API is unavailable #456

Description

@josephchimebuka

Problem

Dashboard.tsx passes stats || mockUserStats into StatsCard, so contributors and players see fabricated numbers whenever statsApi.getUserStats() returns null or before the fetch completes. The component header still carries a stale ISSUE comment about wiring live stats even though the fetch path already exists.

Scope

  • Stop silently substituting mockUserStats in the dashboard stats panel
  • Show an honest empty or retry state when live stats are unavailable
  • Keep mock fixtures for tests/Storybook only (not production UI fallback)
  • Update Dashboard.test.tsx expectations accordingly

Acceptance criteria

  • Connected wallet + successful API response renders live stats
  • Connected wallet + null/error response shows empty/error UI (no mock numbers)
  • Disconnected wallet does not render misleading stats
  • pnpm test and pnpm build pass

Files

  • src/pages/Dashboard.tsx
  • src/components/StatsCard.tsx
  • src/pages/Dashboard.test.tsx
  • src/data/mockData.ts (tests only)

Difficulty

intermediate

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfrontendFrontend/Stellar wave tracking

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions