Skip to content

feat(frontend): Wire Activity Feed to Real API (#822)#1034

Open
lui62233 wants to merge 1 commit intoSolFoundry:mainfrom
lui62233:feat/activity-feed-real-api
Open

feat(frontend): Wire Activity Feed to Real API (#822)#1034
lui62233 wants to merge 1 commit intoSolFoundry:mainfrom
lui62233:feat/activity-feed-real-api

Conversation

@lui62233
Copy link
Copy Markdown

Fixes Bounty #822 - Wire Activity Feed to Real API Data

Changes

  • useActivity.ts (new): React Query hook that fetches GET /api/activity
    • Refetches every 30 seconds (per acceptance criteria)
    • 5s timeout — non-critical path, fast fail is acceptable
    • Returns empty array on error → triggers MOCK_EVENTS fallback
    • retry: false for graceful degradation
  • ActivityFeed.tsx: Export ActivityEvent type for reuse by the hook
  • HomePage.tsx: Wire useActivity() hook → pass events prop to ActivityFeed

Acceptance Criteria

  • Activity feed shows real events from the API
  • Events update without page refresh (30s auto-refetch)
  • Shows MOCK_EVENTS when API is unavailable (graceful fallback)

Notes

  • If /api/activity does not yet exist in the backend, the component degrades to MOCK_EVENTS — consistent with existing demo-mode behavior
  • Follow-up backend work (issue 🏭 Bounty T1: Wire Activity Feed to Real API Data #822 owner) can wire the actual endpoint without changing the frontend contract

…SolFoundry#822)

- Add useActivity hook: fetches GET /api/activity every 30s
- Export ActivityEvent type from ActivityFeed for reuse
- ActivityFeed shows real events when API responds, MOCK_EVENTS when offline
- Graceful degradation: empty array fallback ensures MOCK_EVENTS are used
  when API is unavailable (consistent with existing demo-mode behavior)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-wallet PR is missing a Solana wallet for bounty payout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants