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

Update topbar-menu.tsx #1153

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Update topbar-menu.tsx #1153

merged 1 commit into from
Nov 19, 2024

Conversation

alexanmtz
Copy link
Member

fixes #1042

This pull request includes a significant refactor of the TopbarMenu component in the frontend/src/components/topbar/topbar-menu.tsx file. The changes focus on simplifying the code by consolidating multiple handler functions into a single array of menu items.

Refactor of TopbarMenu component:

  • Removed individual handler functions for each menu item and replaced them with a menuItems array that contains the necessary information for each menu item, including the onClick handler, id, and defaultMessage.
  • Updated the JSX to map over the menuItems array and dynamically generate LinkButton components for each item, reducing redundancy and improving maintainability.

These changes streamline the code, making it easier to manage and extend in the future.

@alexanmtz alexanmtz merged commit ab36c89 into master Nov 19, 2024
1 check failed
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.

Convert hardcoded links into array
1 participant