Skip to content

Frontend: Add campaign detail page improvements — participants, contract state, share #317

@CelestinaBeing

Description

@CelestinaBeing

Summary

The campaign detail page (frontend/src/CampaignDetail.jsx) renders basic metadata from the API but lacks critical live on-chain information: current participant count, remaining cap, time window countdown, and a share/copy link button. These are expected features of any production campaign page.

Problem

The current detail page shows off-chain metadata only:

  • No live participant count from contract
  • No cap remaining indicator (e.g. "142 / 500 spots taken")
  • No time window countdown ("Ends in 2d 4h 15m")
  • No share button (copy URL, share to Twitter/Discord)
  • No visual progress bar for campaign fill rate

Acceptance Criteria

  • Fetch and display on-chain state alongside API metadata on campaign detail load:
    • get_participant_count() → "X participants registered"
    • get_max_cap() → "X / Y spots" with a progress bar (or "Unlimited" if cap = 0)
    • get_window() → countdown timer if campaign hasn't started; time-remaining if active
    • is_active() → status badge (Active / Paused / Inactive)
  • Add a "Share" button that copies the campaign URL to clipboard with a toast confirmation
  • Add pre-built share links: Twitter, Discord (copy formatted message), Telegram
  • Show a skeleton/loading state while on-chain data fetches
  • Show a "Contract not linked" placeholder section if campaignContractId is null
  • Add unit tests for the countdown timer logic and on-chain state display

References

  • frontend/src/CampaignDetail.jsx
  • frontend/src/stellar.jscheckParticipantStatus()
  • frontend/src/components/StatusBadge.jsx

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions