-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix logout button appears in two different menus #6230
Conversation
@@ -89,12 +80,9 @@ const Menu: FC<MenuProps> = props => { | |||
leftIcon={ | |||
resource.icon ? <resource.icon /> : <DefaultIcon /> | |||
} | |||
onClick={onMenuClick} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored the <MenuItemLink>
to let it pull the props it needs (rather than expecting them to be pushed by the <Sidebar>
).
This greatly simplifies the creation of custom menus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed 👍
Wait, since #5575 it's the menu's responsibility to reduce width when the sidebar is closed. I'm not sure why, but if it's the case this should be documented. |
OK, it's both the Sidebar AND the Menu's responsibility to reduce width, in order to support one use case: using a react-admin oss So this PR is ready. |
086b23f
to
baa545a
Compare
baa545a
to
d4256a5
Compare
@@ -89,12 +80,9 @@ const Menu: FC<MenuProps> = props => { | |||
leftIcon={ | |||
resource.icon ? <resource.icon /> : <DefaultIcon /> | |||
} | |||
onClick={onMenuClick} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed 👍
`sidebarIsOpen` in _MenuItemLink_ component and `onMenuClick` in _Menu_ component has been deprecated in marmelab#6230 and their no longer needed to create custom menu components. Also there were some unused import statements, so I've clean them all.
Closes #6228