-
-
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
[RFR] Custom User Menu icon #2391
Conversation
if (!logout && !children) return null; | ||
const { anchorEl } = this.state; | ||
const open = Boolean(anchorEl); | ||
|
||
const menuIconProps = { | ||
'arial-label': label && translate(label, { _: label }), |
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.
We should provide a default label too imo. Something like Profile
?
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.
Currently there is a default label used as default prop: ra.auth.user_menu
.
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.
Oh sorry missed it
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.
Having two props with similar names is confusing. IMO we should only allow a customìcon
. For other use cases, users can still create their own UserMenu
component.
By custom icon you mean remove the possibility to change the node and keep only the overriding of the icon prop by another icon from material-ui? |
if (!logout && !children) return null; | ||
const { anchorEl } = this.state; | ||
const open = Boolean(anchorEl); | ||
|
||
const menuIconProps = { |
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 don't need you need to extract the props now that only the icon
prop is accepted.
The idea is to let the user choosing the Icon but also the Component without rewriting the whole UserMenu.
Todo
Screenshots
Changing UserMenu icon
Changing UserMenu component