Skip to content

Refactor/extract demo components to modules#219

Merged
ibrahimcesar merged 3 commits intomainfrom
refactor/extract-demo-components-to-modules
Nov 15, 2025
Merged

Refactor/extract demo components to modules#219
ibrahimcesar merged 3 commits intomainfrom
refactor/extract-demo-components-to-modules

Conversation

@ibrahimcesar
Copy link
Copy Markdown
Owner

No description provided.

Ibrahim Cesar Nogueira Bevilacqua and others added 3 commits November 15, 2025 17:09
… modules

This refactoring improves maintainability and organization of the demo application by:

## Component Modularization
- Created `/demo/components/` folder structure with:
  - `Header.js` - Page header with title, description, and version info
  - `Footer.js` - Footer with resource links
  - `Navigation.js` - Quick navigation component
  - `/examples/` folder containing 11 separate example components

- Reduced `demo/pages/index.js` from 1,249 lines to 178 lines (86% reduction)
- Each example is now self-contained in its own file for easier maintenance

## CSS Module Extraction
- Created dedicated CSS module files:
  - `Navigation.module.css` - Navigation component styles
  - `Footer.module.css` - Footer component styles
  - `EventsExample.module.css` - EventsExample component styles (40+ classes)

- Removed all inline styles from:
  - Navigation.js (reduced from 54 to 24 lines)
  - Footer.js (removed all inline styles)
  - EventsExample.js (removed 150+ lines of inline style objects)

## Benefits
- βœ… Better code organization and separation of concerns
- βœ… Easier to locate and edit specific examples
- βœ… Cleaner git diffs for future changes
- βœ… Improved performance (styles compiled at build time)
- βœ… Consistent styling pattern across all components
- βœ… Better maintainability with scoped CSS modules

## Technical Details
- All functionality preserved - no breaking changes
- Proper use of CSS modules with scoped class names
- Template literals for combining multiple CSS classes
- Maintained all existing component features and event handlers

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added 5rem padding-bottom to .madeWidth class to improve visual
spacing at the bottom of the page.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Merged latest changes from main branch, incorporating the publishConfig
addition for npm package publication settings.

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ibrahimcesar ibrahimcesar merged commit 17dfa7f into main Nov 15, 2025
5 of 7 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

size-limit report πŸ“¦

Path Size
ES Module 3.05 KB (0%)
CommonJS 3.02 KB (0%)
CSS 1.05 KB (0%)

Comment thread demo/components/examples/EventsExample.js Dismissed
Comment thread demo/components/examples/EventsExample.js Dismissed
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.

2 participants