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

Hamburger Icon in small screen is not working #5353

Closed
Aarav238 opened this issue Nov 1, 2023 · 18 comments · Fixed by #5550
Closed

Hamburger Icon in small screen is not working #5353

Aarav238 opened this issue Nov 1, 2023 · 18 comments · Fixed by #5550

Comments

@Aarav238
Copy link
Contributor

Aarav238 commented Nov 1, 2023

Describe the bug
Hamburger icon is not containing any data and it is useless to keep this in the navbar.

To Reproduce
we can remove this icon or make it disable, we can also give some list that will render when we click on icon.

  1. Go to 'Homeapage'
  2. Click on 'Inspect and make screen samll'
  3. Scroll down to 'then you will see the hamburger icon and click on it'
  4. See error

Expected behavior
It should not be there or should not show blank page on clicking on it.

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Software (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Volto VersionL: 17.1.1
  • Plone Version : 6.0.6
  • Plone REST API Version: 8.40.0
@Aarav238
Copy link
Contributor Author

Aarav238 commented Nov 1, 2023

@sneridagh Please assign this to me.

@davisagli
Copy link
Sponsor Member

@Aarav238 We do not assign issues in the plone organization. Please follow our contribution guidelines: https://6.docs.plone.org/contributing/first-time.html

@davisagli
Copy link
Sponsor Member

The hamburger menu is only empty if there are no items in the site's navigation. In that case it would make sense to hide the hamburger icon.

@Aarav238
Copy link
Contributor Author

Aarav238 commented Nov 1, 2023

Yeah @davisagli , that will be better than removing it, So I have signed the contributor agreement. How much will it take for confirmation?

@stevepiercy
Copy link
Collaborator

@Aarav238 if you read First-time contributors, then you would have read the linked section Contributing to Plone, which contains the answer you seek.

@Aarav238
Copy link
Contributor Author

Aarav238 commented Nov 2, 2023

Yeah thanks @stevepiercy , I have signed the agreement and am excited to contribute.

@ichim-david
Copy link
Sponsor Member

ichim-david commented Nov 3, 2023

The hamburger menu is only empty if there are no items in the site's navigation. In that case it would make sense to hide the hamburger icon.

@davisagli @Aarav238 Personally I think that we are trying to solve a non-existent issue as in real-world scenarios Volto is tied to a CMS which by definition has content that requires navigating the website.
When you create the Plone Site it comes with some content added by default.
If you really have this SPA one page only I'm sure you can add a CSS rule to hide the navigation button or you would use something that is a better fit for that kind of content.

@Aarav238
Copy link
Contributor Author

Aarav238 commented Nov 3, 2023

@ichim-david Thanks for this, So should I work on this @davisagli ?

@davisagli
Copy link
Sponsor Member

@Aarav238 You're welcome to work on it if you want to. I agree with @ichim-david that it's not a critical issue, but it also sounds pretty easy to fix.

@Aarav238
Copy link
Contributor Author

Aarav238 commented Nov 3, 2023

Okay @davisagli , I wil raise a PR as soon as possible. Thanks !!

@Aarav238
Copy link
Contributor Author

Aarav238 commented Nov 7, 2023

@davisagli I have read the contribution documentation , so can you please how to setup volto for development locally ?

@stevepiercy
Copy link
Collaborator

@Aarav238 now continue your education by reading more of the same documentation at https://6.docs.plone.org/install/install-from-packages.html. We do not provide support on GitHub. If you need support, use https://community.plone.org/.

@Ravi-kumar9347
Copy link
Contributor

Ravi-kumar9347 commented Dec 18, 2023

Hello there,

I hope this message finds you well. I'm relatively new to the Plone community. I've successfully set up the project on my local laptop, and I'm enthusiastic about contributing to Volto. We can solve the above issue by using these steps

  1. Introducing a state variable hideHamburger to manage the visibility of the Hamburger icon.
  2. Check if the navigation items are empty or undefined to determine whether to hide the Hamburger icon.
  3. Set the hideHamburger state based on the condition.
  4. Update the component's class dynamically using the hide-hamburger class when hideHamburger is true.
  5. Applie CSS to hide the Hamburger icon when the hide-hamburger class is present.
  6. Ensure the CSS rule targets the mobile Hamburger icon by selecting the .hamburger-wrapper.mobile element.

can you help me that these steps is suitable or not for above issue?
and can you you help to find out the path of related CSS files for above one?

Your assistance will be greatly appreciated. Thank you!

@Aarav238
Copy link
Contributor Author

@Ravi-kumar9347 I think now it is working properly , it rendering those items from props ig and we need to check when we are not getting any items in props for navigation.

@Aarav238
Copy link
Contributor Author

@Ravi-kumar9347 You setup this using containers or locally?

@Ravi-kumar9347
Copy link
Contributor

Ravi-kumar9347 commented Dec 19, 2023

I set up backend and frontend locally

@Ravi-kumar9347
Copy link
Contributor

@Aarav238 can you please help me to find out the css files?

@Aarav238
Copy link
Contributor Author

There is no need of finding css files , just check whether items are empty or not and conditionally render the icon.

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

Successfully merging a pull request may close this issue.

5 participants