-
-
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
Allow to disable the UserMenu without rewriting the AppBar #5421
Conversation
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.
Using false without a true option may be confusing. So I use null instead.
We currently use false
for things like this everywhere in react-admin. I think we should keep it consistant
And if we put |
It should not accept a boolean but either |
See https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/list/ListView.tsx#L72 (bulkActionsButtons) for example. Not saying I love the pattern btw 😛 |
The default value is |
@@ -179,7 +192,7 @@ export interface AppBarProps extends Omit<MuiAppBarProps, 'title' | 'classes'> { | |||
logout?: JSX.Element; | |||
open?: boolean; | |||
title?: string | JSX.Element; | |||
userMenu?: JSX.Element; | |||
userMenu?: JSX.Element | boolean; |
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.
userMenu?: JSX.Element | boolean; | |
userMenu?: JSX.Element | false; |
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 think this should work
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.
True is allowed because it will display the default user menu.
Fixes #5419
Using
false
without atrue
option may be confusing. So I usenull
instead.Todo
null
to theuserMenu
prop of the<AppBar>
<AppBar>
Screenshot