AutoPacker-OSS / autopacker

MIT License
6 stars 1 forks source link

Use react-router NavLink component instead of insane logic for handling selected menu options #133

Closed ANicholasson closed 3 years ago

ANicholasson commented 3 years ago

https://reactrouter.com/web/api/NavLink

ANicholasson commented 3 years ago

See docs for example https://reactrouter.com/web/api/NavLink

This will greatly improve the readability of the current code by removing the ugly management of selected menu item in: https://github.com/AutoPacker-OSS/autopacker/blob/bb207c29c0da19e836ff3f24a461f4020287427c/web-application/src/store/reducers/generalReducer.js#L43 (function selectMenuOption & toggleSubMenu).

These and there corresponding actions can be deleted, and we can use the component inside react-router-dom instead

ANicholasson commented 3 years ago

This has been done for profileDashboard routes