Repository navigation
feat(Badge): support size variants (sm/md/lg) - #658
Merged
nonsobethel0-dev merged 2 commits intoSep 24, 2026
Merged
Conversation
Badge previously hardcoded px-2.5 py-0.5 text-[10px]. Add an optional size prop mapped to spacing/typography classes. Defaults to 'sm', which reproduces the previous styling so existing call sites are unchanged.
|
@Derinsolababy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
❌ Deploy Preview for boisterous-sunshine-dd4c4c failed.
|
nonsobethel0-dev
merged commit Sep 24, 2026
0e38c06
into
Parashield-Protocol:main
0 of 4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Badgecomponent hardcoded its dimensions (px-2.5 py-0.5 text-[10px]), so every badge in the app rendered at the same size regardless of context. This PR adds an optionalsizeprop.Changes
src/components/Badge.tsxBadgeSize = 'sm' | 'md' | 'lg'and optionalsizeprop.SIZE_CLASSESmap controlling gap, padding and font size:sm(default)gap-1 px-2.5 py-0.5 text-[10px]mdgap-1.5 px-3 py-1 text-xslggap-2 px-4 py-1.5 text-smsrc/components/__tests__/Badge.test.tsxsmand preserves the original classes.mdandlgclass application.Backwards compatibility
sizedefaults tosm, which produces exactly the previous classes, so all existing call sites (dashboard, policies, pools, oracle, ClaimStatus, PolicyCard, etc.) render identically. No call sites needed changing.Testing
npx vitest run src/components/__tests__/Badge.test.tsx→ 6/6 passing (3 existing + 3 new).tsc --noEmitreports no errors in Badge files.Usage
Closes #62
Closes #648
Closes #649
Closes #650