Skip to content

feat(support): implement faq and help center accordion ui#59

Merged
johdanike merged 4 commits into
SwiftChainn:mainfrom
Wisdom2788:feat/faq-page
Apr 28, 2026
Merged

feat(support): implement faq and help center accordion ui#59
johdanike merged 4 commits into
SwiftChainn:mainfrom
Wisdom2788:feat/faq-page

Conversation

@Wisdom2788
Copy link
Copy Markdown
Contributor

Closes #40

Summary

Implements the FAQ & Help Center UI with animated accordion components and full layered architecture per issue #40.

What was built

  • services/faqService.ts — API service calling GET /api/faq via axios to fetch categorised FAQ data
  • hooks/useFaq.ts — TanStack Query hook wrapping the service, exposes loading/error/data states
  • components/support/Accordion.tsx — single expandable item with smooth CSS max-height animation and full ARIA support (aria-expanded, aria-hidden, aria-controls, role="region")
  • components/support/Accordion.module.css — animation styles: max-height transition + chevron icon rotation on open/close
  • components/support/AccordionSection.tsx — renders a category heading and its list of accordion items
  • components/support/FaqHelpCenter.tsx — top-level component consuming useFaq, handles loading/error/empty states
  • components/providers/QueryProvider.tsx — TanStack Query client provider wired into root layout
  • app/faq/page.tsx — Next.js page route at /faq composing the full Help Center UI
  • services/__tests__/faqService.test.ts + components/support/__tests__/Accordion.test.tsx — 19 unit tests across 4 suites, all passing

Acceptance Criteria

  • ✅ Accordions animate smoothly — CSS max-height transition + chevron rotate(180deg) on open/close
  • ✅ Categorised sections (Drivers, Payments, Tracking) rendered via AccordionSection
  • ✅ Strict Component → Hook → Service layered architecture enforced throughout
  • ✅ Data sourced from backend API via faqService.getFaqs() calling GET /api/faq — no inline mock objects (error state on /faq confirms real API call is made)
  • ✅ 19/19 unit tests passing across 4 suites (screenshot attached)
  • ✅ Implementation screenshots attached — loading state and error state proving real API integration

Screenshots

Screenshot 2026-04-25 141356 Screenshot 2026-04-25 143512 Screenshot 2026-04-25 143540

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 25, 2026

@Wisdom2788 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Wisdom2788
Copy link
Copy Markdown
Contributor Author

The CI failure is a pre-existing infrastructure issue — next@16.1.6
requires node >=20.9.0 but the CI matrix includes node 18.x which
causes install failure. This same issue affected PR #52 which was
merged successfully.

All quality gates pass locally:
✅ build: clean — all 8 routes compile
✅ type-check: zero TypeScript errors
✅ tests: 19/19 passing across 4 suites
✅ No merge conflicts

Ready for review.

@johdanike
Copy link
Copy Markdown
Contributor

Resolve conflict @Wisdom2788

@Wisdom2788
Copy link
Copy Markdown
Contributor Author

Hi @johdanike — the CI pipeline is failing on all PRs due to two issues in .github/workflows/ci.yml:

  1. The matrix includes node-version: [18.x, 20.x] but next@16.1.6 requires node >=20.9.0.
    Node 18.x fails at install with EBADENGINE, cancelling the paired job.

  2. next lint in Next.js 16 requires an explicit directory argument.
    Running it without one causes: "Invalid project directory provided, no such directory: .../lint"

Suggested fix to .github/workflows/ci.yml:

strategy:
  matrix:
    node-version: [20.x, 22.x]  # Remove 18.x — unsupported by next@16

- name: Lint
  run: npm run lint -- --no-lint-during-builds  # or update package.json lint script

This would allow CI to pass on all incoming PRs. I don't mind submitting a separate PR fixing the workflow file if that helps.

@johdanike johdanike merged commit 7d4f542 into SwiftChainn:main Apr 28, 2026
0 of 2 checks passed
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.

Frontend: FAQ & Help Center UI

2 participants