ASU-CodeDevils / codedevils.org

The Official CodeDevils website frontend codebase written using Next.js, React, TypeScript, and Tailwind CSS
https://www.codedevils.org
10 stars 6 forks source link

Refactor Navbar.tsx #40

Closed jtmichelson closed 9 months ago

jtmichelson commented 1 year ago

There are 31 ternary conditions in this one file. This may be a record.

Navbar.tsx is over 400 LoC long. It includes a separate mobile and desktop navbar with custom impls for each of them all in the same file. This goes against all the design principles of React. These should be separate components if they are dissimilar enough to warrant so and you can build up HoC (higher order components) out of multiple sub-components. The current implementation is unreadable.

https://github.com/ASU-CodeDevils/codedevils/blob/main/src/components/page_layout/Navbar.tsx

reharri7 commented 1 year ago

🥇

fernandonevarez commented 1 year ago

Don't even get me started on how much I hate myself for this navbar component design. I promise ik what I am doing, but yeah I just need to set time to actually work on fixing my horrible code and that's just putting it lightly.

reharri7 commented 1 year ago

👀

fernandonevarez commented 1 year ago

okay I finished doing this, but I'll leave this issue open.

fernandonevarez commented 9 months ago

The issue was eliminated, and this is no longer a concern.