Skip to content

Conversation

@egdev6
Copy link
Owner

@egdev6 egdev6 commented Jul 22, 2025

This pull request introduces enhancements to the Avatar and Dropdown components, focusing on code modularity, customization options, and usability improvements. The Avatar component now supports a rounded prop for customizable shapes, while badge-related functionality has been removed. The Dropdown component has been refactored to improve maintainability and includes enhanced hover and focus styles. Additionally, utility hooks (useAvatar and useDropdown) have been added for better separation of concerns.

Avatar Component Changes:

  • Refactored Avatar logic into useAvatar hook: Centralized logic for size, text, and rounded classes, simplifying the Avatar component's implementation. (src/components/atoms/avatar/useAvatar.ts, src/components/atoms/avatar/useAvatar.tsR1-R33)
  • Added rounded prop for customization: Introduced a new rounded prop ('md', 'full', 'none') for avatar shape customization. Removed badge-related props (hasBadge, badgeContent, badgeClassName). (src/components/atoms/avatar/types.ts, src/components/atoms/avatar/types.tsL12-R13)
  • Updated stories for avatars: Replaced badge examples with rounded examples in Avatar.stories.tsx. (src/components/atoms/avatar/Avatar.stories.tsx, src/components/atoms/avatar/Avatar.stories.tsxL73-R83)

Dropdown Component Changes:

  • Refactored Dropdown logic into useDropdown hook: Moved dropdown configuration and accessibility logic into a dedicated hook for improved readability and modularity. (src/components/atoms/dropdown/useDropdown.ts, src/components/atoms/dropdown/useDropdown.tsR1-R40)
  • Improved hover and focus styles: Enhanced visual feedback for dropdown items and submenus with updated outline styles. (src/components/atoms/dropdown/Dropdown.tsx, [1] [2]

Miscellaneous Changes:

@egdev6 egdev6 requested a review from Copilot July 22, 2025 20:52
@netlify
Copy link

netlify bot commented Jul 22, 2025

Deploy Preview for egdev6-design-system ready!

Name Link
🔨 Latest commit 1e99635
🔍 Latest deploy log https://app.netlify.com/projects/egdev6-design-system/deploys/687ffb4eb1587c00089324fc
😎 Deploy Preview https://deploy-preview-68--egdev6-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Avatar and Dropdown components to improve maintainability and customization. The changes introduce utility hooks for better separation of concerns and enhance component functionality.

  • Extracted component logic into custom hooks (useAvatar and useDropdown) for better code organization
  • Added rounded prop to Avatar component while removing badge functionality
  • Enhanced Dropdown hover/focus styles and reduced IconButton padding

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/components/atoms/icon-button/types.ts Reduced padding from px-2 py-2 to px-1 py-1 for more compact design
src/components/atoms/dropdown/useDropdown.ts New hook extracting dropdown configuration and accessibility logic
src/components/atoms/dropdown/Dropdown.tsx Refactored to use useDropdown hook and added hover outline styles
src/components/atoms/avatar/useAvatar.ts New hook extracting avatar size, text, and rounded class logic
src/components/atoms/avatar/types.ts Added rounded prop type and removed badge-related props
src/components/atoms/avatar/Avatar.tsx Refactored to use useAvatar hook and removed badge functionality
src/components/atoms/avatar/Avatar.stories.tsx Updated stories to showcase rounded prop instead of badge examples

@egdev6 egdev6 merged commit 4dad46c into main Jul 22, 2025
4 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.

2 participants