-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Badge component #703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I left some minor comments for you.
Will you be creating a new minor version or are we going to batch this PR with some others?
src/new-components/badge/badge.tsx
Outdated
const variantClassName = styles[`badge-${variant}`] | ||
|
||
return ( | ||
<Box {...rest} className={classNames(styles.badge, variantClassName)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Box
actually implements classNames under the hood (ref), so this could be simplified:
<Box {...rest} className={classNames(styles.badge, variantClassName)}> | |
<Box {...rest} className={[styles.badge, variantClassName]}> |
<Column width="content"> | ||
<Badge variant="neutral">Upgrade</Badge> | ||
</Column> | ||
<Column width="content"> | ||
<Badge variant="positive">Experiment</Badge> | ||
</Column> | ||
<Column width="content"> | ||
<Badge variant="color">Beta</Badge> | ||
</Column> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 I wonder if it would be better to use the variant as the label... I might be having a slow day, but it took me a second to figure out which variant is which 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally wanted to match the mocks, but yeah this would make it easier to understand.
Thanks @pawelgrimm! I've addressed your feedback, please have another look 🙏
I usually add a changelog entry to next and only bump versions after changes are merged, in case other changes need to go in in the meantime 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
I think that's ok, but I wonder if we can refine this process a bit more. After all, it's possible that after merging to master, but before creating the release, someone else merges to master. Then, if you were to push changes to create your release without realizing that additional merged happened, you would end up creating a release that includes changes you hadn't accounted for. Unlikely at the current pace of development, but not impossible 🤔 It would be very nice if we could include some identifier in a PR that specifies the type of version bump and a changelog entry and then have the CI take care of creating and releasing the new version based on the current state of |
@pawelgrimm Ernesto created an issue here to get the conversation started: #675 Hopefully, we can prioritize an internal DO to tackle this 👍 |
Co-authored-by: Paweł Grimm <developer@pawelgrimm.com>
ff606ac
to
0dabd85
Compare
Short description
This adds a badge component with 3 variants available:
Figma: https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Library---Web?node-id=9038%3A280583
PR Checklist
npm run validate
and made sure no errors / warnings were shownCHANGELOG.md
package.json
andpackage-lock.json
(npm --no-git-tag-version version <major|minor|patch>
) refnpm run build-all
)Versioning
New feature: minor