-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refactor Menu Links Using Constants and Map Function for Better Code Structure as per industry standards in src/components/Navbar.tsx #107
Comments
Hey @yashpandey06 👋 Great point out. Really a valid one. I agree! Do you have intentions with this? If not, surely we would look into this, definitely. |
Yeah , I would like to work on this |
Okay, would leave that to you. Sure you can! @yashpandey06 sure be mindful of the test cases in place for the active links in the tests folder. should incase there are any breaks in the test while at it to be modified. |
I'm not sure why, but when I try to start my Vite server, the screen is completely blank with no errors being thrown. Could you help me with this? |
Hey Yash, I guess you should check your console on the browser, you would probably see something relating to the I suggest you give it some more time, try clearing your cache or deleting and install your node modules again if possibe |
Title: Refactor Menu Links Using Constants and Map Function for Better Code Structure
Description:
In the current implementation of the
Menu.ItemGroup
, thehref
,target
,rel
, and other fields are hardcoded directly in the JSX. This approach can lead to redundancy and reduce maintainability, especially as the application scales.Current Scenerio :
Proposed Solution:
To improve the code quality and follow industry-level best practices, we can:
href
,target
,rel
, etc.) in a constant file to centralize these values and make them easier to manage.map()
function to dynamically renderMenu.ItemGroup
components. This will not only reduce code duplication but also make it more maintainable and scalable.Benefits:
Example:
The text was updated successfully, but these errors were encountered: