-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Enterprise Search] Add nested sub navigation to SideNavLinks #77685
Conversation
- for nested navigation
- while attempting to expand the hitbox area of nested links as much as possible
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.
This LGTM! Thanks so much for doing this!
@scottybollinger Ah I forgot to mention how to implement this with conditional display (i.e. only show the subnav when you're on the groups page). App Search does this a bit differently so I'm currently spitballing... In some example new file (maybe import { useParams } from 'react-router-dom';
export const groupsSubNav = () => {
const { groupId } = useParams();
if (!groupId) return null; // Or some other way of checking the route matches your groups route
return (
// nested SideNavLinks
);
}; and then in import { groupsSubNav } from '../groups_view_folder/wherever';
// ...
<SideNavLink to="/groups" subNav={groupsSubNav}>
{i18n.translate('xpack.enterpriseSearch.workplaceSearch.nav.groups', {
defaultMessage: 'Groups',
})}
</SideNavLink> |
Not sure what's up with that failing test, it's not ours 🤷 @elasticmachine merge upstream |
@elasticmachine merge upstream |
Thanks! What I'm doing is checking the logic file for a |
💚 Build SucceededBuild metricsasync chunks size
History
To update your PR or re-run it, just comment with: |
#77694) * Add subNav prop to SideNavLinks - for nested navigation * [Probably extra] Tweak CSS to allow for recursive subnesting - while attempting to expand the hitbox area of nested links as much as possible Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This adds the
subNav
prop to theSideNavLink
component to support nested sub navigation. Example usage:Let me know if this works for you @scottybollinger!
Screencaps
Example from above:
Example App Search Engines subnav:
Checklist