Skip to content

[Frontend] activity-content.tsx and incoming-content.tsx duplicate the same fetch/loading/error scaffolding with no shared hook #1085

Description

@grantfox-oss

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Why this matters

frontend/src/app/activity/activity-content.tsx and frontend/src/app/incoming/incoming-content.tsx both implement their own loading/error/empty-state handling around a data fetch, following the same shape. Duplicated scaffolding means a bug fix (e.g. an error-state edge case) has to be applied twice and can drift, exactly the kind of duplication already flagged for other pairs in this codebase.

Acceptance criteria

  • Extract a shared useAsyncPageData-style hook or shared presentational wrapper for loading/error/empty states
  • Migrate both pages to use it
  • Confirm existing tests for both pages still pass

Files to touch

  • frontend/src/app/activity/activity-content.tsx
  • frontend/src/app/incoming/incoming-content.tsx
  • frontend/src/hooks/

Out of scope

  • Rewriting the data-fetching library used
  • Changing the visual design of loading/error states

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasksrefactorRefactoring existing code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions