Closed danilo-moreira-brisa closed 5 months ago
This update harmonizes the Badge component by incorporating theme-based styling and enhancing its flexibility. The refactor focuses on refining enums, improving styling logic, and ensuring code consistency to boost the Badge component's maintainability and adaptability within the project.
File Path | Change Summary |
---|---|
src/components/badge/badge.test.tsx , src/components/badge/badge.tsx , src/components/badge/styles.ts |
Updated to use theme-based styling, refactored BadgeType enum, and improved badge rendering logic. |
src/components/tag/tag.tsx |
Minor adjustments including import reordering and string literal formatting. |
src/stories/badge/badge.stories.tsx |
Renamed Negative story to Danger and reordered imports. |
src/components/tab/tab.test.tsx , src/components/tabGroup/tabGroup.test.tsx |
Updated test files to use renderWithTheme for rendering components. |
src/components/tab/tab.tsx |
Reordered imports and introduced getIconSize function for dynamic icon sizing based on TabSizes . |
In the land of code where rabbits play,
Badges gleam in a vibrant array.
🎨 With themes and styles, a refactor's delight,
Crafting a future both bold and bright.
🐇 I hop through the changes, with a tweak,
For a codebase unique, chic, and sleek.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
BadgeComponent
.Refactor
BadgeType
enum value from'negative'
to `'danger' in badge components.BadgeStyles
to use atypeColors
function for color variations.tag.tsx
for code cleanliness (reordering imports and updating string literals).Negative
story toDanger
in badge stories for consistency.Style