Skip to content

Comments

refactor: decompose OrganisationServicesAccordion into focused components#251

Merged
james-cross merged 1 commit intostagingfrom
refactor/organisation-services-accordion-decomposition
Feb 19, 2026
Merged

refactor: decompose OrganisationServicesAccordion into focused components#251
james-cross merged 1 commit intostagingfrom
refactor/organisation-services-accordion-decomposition

Conversation

@james-cross
Copy link
Collaborator

Summary

Breaks down the 836-line OrganisationServicesAccordion monolith into six focused components, each with a single responsibility. Replaces inline CSS variable styles with Tailwind utility classes and eliminates deeply nested IIFEs.

Changes

  • Extract ServiceTypeBadges (75 lines) - consolidates duplicate badge rendering for phone, 24/7, appointment, and accommodation type indicators
  • Extract AccommodationDetails (256 lines) - all accommodation info sections (contact, cost, resident criteria, facilities, support) with helper sub-components
  • Extract ServiceAddress (62 lines) - address display with Google Maps and Apple Maps links
  • Extract ServiceLocationDetails (110 lines) - composes sub-components for a single location's details
  • Extract ServiceLocationPicker (122 lines) - multi-location buttons with distance and open/closed status
  • Simplify orchestrator (232 lines) - retains grouping logic and state management, delegates rendering to extracted components
  • Replace 77 inline style declarations with Tailwind utility classes (text-brand-k, bg-brand-b, border-l-brand-h, bg-[#f0f9f7], etc.)

Testing

  • All 466 unit tests pass
  • TypeScript type-check clean
  • No lint errors
  • Production build succeeds

…ents

- Extract ServiceTypeBadges, AccommodationDetails, ServiceAddress,
  ServiceLocationDetails, and ServiceLocationPicker components
- Consolidate duplicate badge rendering into single ServiceTypeBadges
- Replace inline styles with Tailwind utility classes throughout
- Eliminate deeply nested IIFEs with declarative JSX and helper components
@james-cross james-cross merged commit 27bb5c7 into staging Feb 19, 2026
6 checks passed
@james-cross james-cross deleted the refactor/organisation-services-accordion-decomposition branch February 19, 2026 20:41
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.

1 participant