Closed apedroferreira closed 2 weeks ago
In a further PR, will add further refactoring to keep track of one only selected list item and share that logic between DashboardLayout
and PageContainer
components.
Also create a separate issue for these improvements.
Closes https://github.com/mui/mui-toolpad/issues/3974 (partially, must create new partial issue for
PageContainer
component and follow https://github.com/mui/mui-toolpad/pull/3991#issuecomment-2310618664 + https://github.com/mui/mui-toolpad/pull/3991#pullrequestreview-2262532367Adds an optional
pattern
property to navigation page items so that these can be marked as selected according to that pattern (using path-to-regexp), instead of the default behavior that uses theirsegment
property.https://deploy-preview-3991--mui-toolpad-docs.netlify.app/toolpad/core/react-dashboard-layout/#navigation-pattern-matching
Also simplifies the logic for the console warning in
DashboardLayout
for duplicate navigation items.No changes to
PageContainer
or any more complex behavior for now, those will be done separately, as well as refactored logic for the selected item.