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

Close burger menu when clicking specific items #916

Merged

Conversation

owi92
Copy link
Member

@owi92 owi92 commented Aug 15, 2023

Closes #906

The items on which the menu closes are:

  • realm editing buttons
  • management nav buttons

The solution presented here is a little hacky since the burger menu as written currently gets passed the navigation lists as nested JSX elements, which makes passing the close handler directly to the specific items quite complicated (if possible at all).

This should be taken into consideration when/if the sidebox/burger navigation get refactored or rewritten eventually.

@owi92 owi92 added the changelog:user User facing changes label Aug 15, 2023
@github-actions github-actions bot temporarily deployed to test-deployment-pr916 August 15, 2023 11:42 Destroyed
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's indeed borderline hacky :/
I know that we plan on refactoring all of this anyway (#840), but could you check whether you can instead use useMenu().close() in the code where the respective nav items are defined? That might be better?

@LukasKalbertodt
Copy link
Member

Oh also: The issue also mentions closing this when a realm without children is reached. What are your thoughts on that?

These links neither have children nor a parent realm to
link back to, so closing them on click should be intuitive.
@owi92 owi92 force-pushed the close-burger-menu-in-specific-cases branch from a5aa75f to 0f978f6 Compare August 24, 2023 14:31
@owi92
Copy link
Member Author

owi92 commented Aug 24, 2023

Oh yes thanks for pointing that out, I didn't have the useMenu hook on my radar. Should have remembered that before claiming that this is super complicated/not possible...

Regarding realms without children, I think you made some valid points in #906 (back button, consistency with other realms) that convinced me to keep the burger menu open for these.

@github-actions github-actions bot temporarily deployed to test-deployment-pr916 August 24, 2023 14:41 Destroyed
@LukasKalbertodt
Copy link
Member

Fair!

@LukasKalbertodt LukasKalbertodt merged commit 3758419 into elan-ev:master Aug 24, 2023
2 checks passed
@owi92 owi92 deleted the close-burger-menu-in-specific-cases branch March 4, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:user User facing changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Close burger menu when clicking on any link that has no "children"
2 participants