Skip to content
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

Nested route links are not seen in "toggleable-mini" mode #1082

Open
RatikantHM opened this issue Mar 3, 2021 · 4 comments
Open

Nested route links are not seen in "toggleable-mini" mode #1082

RatikantHM opened this issue Mar 3, 2021 · 4 comments

Comments

@RatikantHM
Copy link

The nested route link is not shown in "toggleable-mini" mode. Please refer the demo:
https://react-md.dev/packages/layout/demos
"Route 2" icon is not shown, so we cannot go to this route in "toggleable-mini" mode; how the route 2 sub-links should be shown in "toggleable-mini" mode?

image
image

Thanks!

@RatikantHM RatikantHM added the bug label Mar 3, 2021
@mlaursen
Copy link
Owner

mlaursen commented Mar 4, 2021

This is actually intentional -- check out the defaultMiniItemRenderer for what is rendered. I'm not really sure the best way to handle nested routes in the mini form so I implemented it in a way where you can always provide a miniNavItems tree for other routes or provide your own mini item renderer.

However, I'd be happy for suggestions about the best way to handle the mini navigation. Maybe a better default would be to just grab all routes that have a leftIcon and flatten them to to the root in order?

So for the documentation site example, we'd have:

  • Home
  • Route 1
  • Route 2
  • Route 2-1
  • Route 2-2
  • Route 2-3
  • Route 3

@mlaursen mlaursen added the layout label Mar 4, 2021
@RatikantHM
Copy link
Author

Suggestion 1:

  1. show parent route icon (in this case route 2 icon) - do not show sub-routes
  2. add a configurable flag expandOnHover; set default to true if the nav tree is having nested routes or else can be set to false - if it is set to true; on hovering the nav, it should toggle from toggleable-mini to toggleable mode; same for temporary mode
  3. also can add expandOnClick flag to have same behavior?

Suggestion 2:

  1. show parent route icon (in this case route 2 icon) - do not show sub-routes
  2. add a small icon (>) after the route icon to indicate there are sub-routes for this route and on hover / click show the sub-routes in a dropdown menu

@RatikantHM
Copy link
Author

Hi, any plan for this?

@mlaursen
Copy link
Owner

Hey, sorry for the late response - I've been working on something interesting at work so haven't really checked in much to github.

I'll implement something close to these suggestions since I like it better than my implementation. I mostly thought of the mini navigation as "quick access links" instead of a mini tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants