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

Converting Nav and HamburgerMenu into functional components #5456

Conversation

Aminehassou
Copy link
Contributor

With reference to #5393

What this PR does

Converts nav.jsx and hamburger_menu.jsx into functional components
Affected Pages:

  • Every page that has the main navbar in it

Videos

Before intro.jsx and hamburger_menu.jsx

before.refactor.Nav.and.HamburgerMenu.mp4

After intro.jsx and hamburger_menu.jsx

after.refactor.Nav.and.HamburgerMenu.mp4

Clarifications

I made some changes to the code structure for both files, initially, we had a large amount of conditionals that would assign jsx elements into a variable, then that variable would be placed later on in the render method. This caused a lot of 'one-time use' variables. I decided to put all the conditionals inside the renders directly without the use of variables. This makes the code a lot easier to read.

@ragesoss ragesoss merged commit 1f5e478 into WikiEducationFoundation:master Jul 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants