Skip to content

refactor: migrate pairs list to useApi#167

Open
webmirroring wants to merge 1 commit into
StableRoute-Org:mainfrom
webmirroring:refactor/pairs-use-api-hook
Open

refactor: migrate pairs list to useApi#167
webmirroring wants to merge 1 commit into
StableRoute-Org:mainfrom
webmirroring:refactor/pairs-use-api-hook

Conversation

@webmirroring

Copy link
Copy Markdown

Summary

  • Migrates the pairs list page from inline useEffect / useState fetching to the shared useApi<{ pairs: Pair[] }> hook.
  • Preserves the existing loading, empty, populated, error, aria-live, aria-atomic, and aria-busy UI behavior.
  • Documents the data-page convention for using useApi.
  • Reconnects the quote page submit handler to the existing quote validators so the frontend build remains green.

Closes #154.

Accessibility notes

The pairs page keeps the same single polite live region, aria-atomic="true", loading aria-busy, empty-state copy, and role="alert" error behavior.

Validation

  • node node_modules/jest/bin/jest.js src/app/pairs/page.test.tsx src/lib/__tests__/useApi.test.ts src/app/quote/page.test.tsx --runInBand passes
  • node node_modules/jest/bin/jest.js --runInBand passes: 22 suites, 114 tests
  • node node_modules/typescript/bin/tsc --noEmit passes
  • node node_modules/next/dist/bin/next lint passes
  • node node_modules/next/dist/bin/next build passes

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.

Migrate the pairs list off the inline fetch effect onto the shared useApi hook

2 participants