-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiHeaderLinks] Providing more flexibility in display #4046
Conversation
- No importing of external doc examples - All Elastic logos - Remove all actual links that might send the user to the index page - Only the first example shows all the popovers - The Full screen demo has the rest
Then update `popoverBreakpoints` prop in EuiHeaderLinks to also allow for `all` and `none`.
cf00811
to
e74cc24
Compare
import HeaderAppMenu from './header_app_menu'; | ||
import HeaderUserMenu from './header_user_menu'; | ||
import HeaderSpacesMenu from './header_spaces_menu'; |
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.
All these imports to to be directly declared in this file. Now the CodeSandbox works 🎉
|
||
import HeaderUserMenu from './header_user_menu'; | ||
import HeaderSpacesMenu from './header_spaces_menu'; | ||
import HeaderUpdates from './header_updates'; |
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.
Again moved the HeaderUpdates component directly in this file. It still needs an actual example all on its own, but that will take time.
Preview documentation changes for this PR: https://eui.elastic.co/pr_4046/ |
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.
It looks good! 🎉
I looked at the code and tested the docs and sandboxes. I just added a suggestion to replace the <Link>
from react-router-dom
.
Preview documentation changes for this PR: https://eui.elastic.co/pr_4046/ |
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.
One small change requested.
Also, I'm curious what the use case for all/none in show/hide is? Seems like it would be easier to not include the content at all (when wanting to never show or always hide) or not wrap with a show/hide tag when it should always be included.
I agree that it seems odd to allow such a value, but I found that it makes it much easier (on the EUI side) to support the inclusion or exclusion of responsive breakpoints entirely. So in EuiHeaderLinks, I can allow customization of when to show/hide the popover version via:
And then be able to pass that exact value to the EuiHide/ShowFor components without needing to do some extra calculation/logic to handle those cases. It's more of an ease of use for us internally than it might necessarily be for consumers, but it doesn't hurt to provide it at that level instead of hiding behind a service. |
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.
Thanks for the usage info for show/hide breakpoints - figured it was something like that, wanted to double check. Everything LGTM!
Preview documentation changes for this PR: https://eui.elastic.co/pr_4046/ |
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! 🎉
Preview documentation changes for this PR: https://eui.elastic.co/pr_4046/ |
And update a lot of the Header examples.
This may look like a lot of changes, but it's because I fixed up most of the Header page examples to:
#
fixes.EuiHeaderLinks
Added
gutterSize
to adjust the spacing between direct children. And extended some props on the "mobile" version withpopoverBreakpoints
,popoverButtonProps
, andpopoverProps
. And then I used the EuiHideFor and EuiShowFor to render/not render the inline links versus the popover version depending on thepopoverBreakpoints
instead of using CSS media queries which are hard to adjust at the consumer level.
EuiHide/ShowFor adjustment
As an extra ease of use for the EuiHideFor and EuiShowFor components, I'm allowing the
sizes
prop also accept the stringsall
andnone
.Checklist
[ ] Checked for breaking changes and labeled appropriately