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

[RFR] Custom User Menu icon #2391

Merged
merged 6 commits into from
Oct 11, 2018
Merged

[RFR] Custom User Menu icon #2391

merged 6 commits into from
Oct 11, 2018

Conversation

Luwangel
Copy link
Contributor

@Luwangel Luwangel commented Oct 4, 2018

The idea is to let the user choosing the Icon but also the Component without rewriting the whole UserMenu.

Todo

  • Make possible the change of the UserMenu icon
  • Make possible the change of the UserMenu icon component
  • Take Screenshots
  • Write docs

Screenshots

Changing UserMenu icon

selection_107

Changing UserMenu component

selection_113

@Luwangel Luwangel changed the title [WIP] Custom User Menu icon [RFR] Custom User Menu icon Oct 5, 2018
if (!logout && !children) return null;
const { anchorEl } = this.state;
const open = Boolean(anchorEl);

const menuIconProps = {
'arial-label': label && translate(label, { _: label }),
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry missed it

Copy link
Member

@fzaninotto fzaninotto left a 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.

@Luwangel
Copy link
Contributor Author

Luwangel commented Oct 9, 2018

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 = {
Copy link
Member

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.

@fzaninotto fzaninotto added this to the 2.4.0 milestone Oct 11, 2018
@fzaninotto fzaninotto merged commit 8a74215 into next Oct 11, 2018
@fzaninotto fzaninotto deleted the custom-user-menu-icon branch October 11, 2018 13:37
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.

None yet

3 participants