Skip to content

feat: add campaign discovery / marketplace list at /campaigns - #238

Merged
Dannyswiss1 merged 1 commit into
Cylo-Traders:masterfrom
LamsOfJos:feat/campaign-marketplace-list
Aug 29, 2026
Merged

feat: add campaign discovery / marketplace list at /campaigns#238
Dannyswiss1 merged 1 commit into
Cylo-Traders:masterfrom
LamsOfJos:feat/campaign-marketplace-list

Conversation

@LamsOfJos

Copy link
Copy Markdown
Contributor

Campaign discovery / marketplace list (#142)

CampaignsPage (pages/index.tsx) was a static PlaceholderPage — the app
had no page anywhere for an investor to browse available campaigns. Every
other flow (funding, detail, dashboard) assumed you already had a campaign id.
This adds a real, live list at /campaigns.

Changes

File What
hooks/useAllCampaigns.ts (new) Discovers every campaign from ProductionEscrowContract event history and fetches current state via get_campaign. Same event-scan approach as useAdminCampaigns.ts but without the ACTIONABLE_STATUSES admin filter; sorted newest-id-first, guarded by isEscrowConfigured(), unresolvable ids skipped instead of failing the whole load.
pages/CampaignsPage.tsx (new) Real list page. Card grid where each card shows <StatusBadge> + a role="progressbar" funding bar and links to /campaigns/:id. Handles loading (CampaignCardsSkeleton), error (message + Retry via refetch), empty (no campaigns yet + create CTA), and not-configured (env-var hint) states. Status filter chips built on STATUS_META, shown only when >1 status is present.
App.tsx <Route path="/campaigns" element={<CampaignsPage />} /> added to the AppLayout group (nav already linked there).
pages/index.tsx Placeholder CampaignsPage removed; now export { CampaignsPage } from './CampaignsPage', matching the ActivityFeedPage/FarmerProfilePage pattern.
hooks/contract/queryKeys.ts Added allCampaigns query key.
__tests__/CampaignsPage.test.tsx (new) Asserts the list renders with correct /campaigns/:id hrefs, plus the empty / error / loading states.

Acceptance criteria

  • /campaigns renders a real, live list of on-chain campaigns, not placeholder copy
  • Each campaign card links to a working /campaigns/:id detail page
  • Empty (no campaigns yet) and error (RPC/backend failure) states both handled

Verification

  • tsc --noEmit — clean
  • eslint — clean on all touched files
  • Full test suite — 88/88 pass (20 files), including 4 new page tests

Closes #142

@Dannyswiss1
Dannyswiss1 merged commit b188dca into Cylo-Traders:master Aug 29, 2026
1 check failed
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.

No campaign discovery / marketplace list page exists

2 participants