arbret/frontend/app
counterweight b86b506d72
Refactor frontend: Add reusable hooks and components
- Created useAsyncData hook: Eliminates repetitive data fetching boilerplate
  - Handles loading, error, and data state automatically
  - Supports enabled/disabled fetching
  - Provides refetch function

- Created PageLayout component: Standardizes page structure
  - Handles loading state, authorization checks, header, error display
  - Reduces ~10 lines of boilerplate per page

- Created useMutation hook: Simplifies action handling
  - Manages loading state and errors for mutations
  - Supports success/error callbacks
  - Used for cancel, create, revoke actions

- Created ErrorDisplay component: Standardizes error UI
  - Consistent error banner styling across app
  - Integrated into PageLayout

- Created useForm hook: Foundation for form state management
  - Handles form data, validation, dirty checking
  - Ready for future form migrations

- Migrated pages to use new patterns:
  - invites/page.tsx: useAsyncData + PageLayout
  - trades/page.tsx: useAsyncData + PageLayout + useMutation
  - trades/[id]/page.tsx: useAsyncData
  - admin/price-history/page.tsx: useAsyncData + PageLayout
  - admin/invites/page.tsx: useMutation for create/revoke

Benefits:
- ~40% reduction in boilerplate code
- Consistent patterns across pages
- Easier to maintain and extend
- Better type safety

All tests passing (32 frontend, 33 e2e)
2025-12-25 21:30:35 +01:00
..
admin Refactor frontend: Add reusable hooks and components 2025-12-25 21:30:35 +01:00
api Refactor API layer into structured domain-specific modules 2025-12-25 20:32:11 +01:00
components Refactor frontend: Add reusable hooks and components 2025-12-25 21:30:35 +01:00
exchange Refactor API layer into structured domain-specific modules 2025-12-25 20:32:11 +01:00
generated lots of stuff 2025-12-23 17:03:51 +01:00
hooks Refactor frontend: Add reusable hooks and components 2025-12-25 21:30:35 +01:00
invites Refactor frontend: Add reusable hooks and components 2025-12-25 21:30:35 +01:00
login Add Prettier for TypeScript formatting 2025-12-21 21:59:26 +01:00
profile Refactor API layer into structured domain-specific modules 2025-12-25 20:32:11 +01:00
signup Refactor API layer into structured domain-specific modules 2025-12-25 20:32:11 +01:00
styles refactor(frontend): improve code quality and maintainability 2025-12-25 19:04:45 +01:00
trades Refactor frontend: Add reusable hooks and components 2025-12-25 21:30:35 +01:00
utils Refactor API layer into structured domain-specific modules 2025-12-25 20:32:11 +01:00
auth-context.tsx Refactor API layer into structured domain-specific modules 2025-12-25 20:32:11 +01:00
config.ts Add Prettier for TypeScript formatting 2025-12-21 21:59:26 +01:00
layout.tsx tests passing 2025-12-18 22:08:31 +01:00
page.tsx Phase 3.3: Add Admin Trades page 2025-12-22 20:06:16 +01:00