Refactor Components #29
Reference in New Issue
Block a user
Delete Branch "adilallo/maintenance/RefactorComponents"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrate components to container/presentation pattern
Overview
This PR migrates all remaining components to the container/presentation pattern, separating logic (containers) from presentation (views). This improves testability, reusability, and maintainability. The migration includes 50+ components, with special attention to restoring QuoteBlock and LogoWall to match their original implementations exactly.
Changes
Component Migrations
Component Structure
Each migrated component now follows the pattern:
[ComponentName]/index.tsx- Re-exports container for backward compatibility[ComponentName].container.tsx- Contains logic, hooks, state management[ComponentName].view.tsx- Pure presentation component[ComponentName].types.ts- TypeScript interfacesKey Restorations
sourceinstead ofauthorRole), hanging quotes styling, and error handling with fallback avatarsBug Fixes
Documentation
docs/guides/container-presentation-pattern.mddocs/README.mdanddocs/CUSTOM_HOOKS.mdto reference new patternScreenshots
How to Test
npm test # Unit tests (305 passed)
npm run e2e # E2E tests (124 passed)
npm run e2e:performance # Performance tests (8 passed)
npm run visual:test # Visual regression (20 passed)