-
Notifications
You must be signed in to change notification settings - Fork 842
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
[Docs] Adds a *NEW* badge to side nav items that are new #3283
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.
isNew
works. As an alternative. We could use dateIntroduced
or something, and then check last 60 days or something. It would only work against the build time (which is fine), but might be a neat little log over time. At least then you wouldn't have to manually change them.
Code looks good to me. Anyways, just a suggestion. I'm fine either way.
Preview documentation changes for this PR: https://eui.elastic.co/pr_3283/ |
Yeah that would be pretty cool. I think for now, at least this gets us the look/placement of the badge. We can certainly modify how it gets populated down the line. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3283/ |
This is still a very manual process (it's not automatic with releases) but...
When there is a new component added to the docs, you can now add the key
isNew: true
to the sections object (just below thetitle
in the_example.js
files). This will add the pink NEW badge in the side nav.Here are examples of the different states including truncation.
Also
I had to fix EuiSideNavItem's to pass down
className
on both itself and the icon otherwise custom classNames were getting overridden/ignored. Fixes part of #2380Checklist
[ ] Props have proper autodocs[ ] Added documentation examples[ ] Added or updated jest tests[ ] Checked for breaking changes and labeled appropriately[ ] Checked for accessibility including keyboard-only and screenreader modes