diff --git a/docs/Theming.md b/docs/Theming.md index 0f80520b318..dad784c580a 100644 --- a/docs/Theming.md +++ b/docs/Theming.md @@ -386,9 +386,11 @@ const MyLayout = props => ` component. For instance, to add custom menu items, just decorate the default `` by adding children to it: -```js +```jsx import { AppBar, UserMenu, MenuItemLink } from 'react-admin'; import SettingsIcon from '@material-ui/icons/Settings'; @@ -407,6 +409,38 @@ const MyAppBar = props => } />; const MyLayout = props => ; ``` +You can also customize the default icon by setting the `icon` prop to the `` component. + +{% raw %} +``` jsx +import { AppBar, UserMenu } from 'react-admin'; +import { withStyles } from '@material-ui/core/styles'; +import Avatar from '@material-ui/core/Avatar'; + +const myCustomIconStyle = { + avatar: { + height: 30, + width: 30, + }, +}; + +const MyCustomIcon = withStyles(myCustomIconStyle)( + ({ classes }) => ( + + ) +); + +const MyUserMenu = props => (} />); + +const MyAppBar = props => } />; +``` +{% endraw %} + +### Sidebar Customization + You can specify the `Sidebar` size by setting the `size` property: ```jsx @@ -420,6 +454,8 @@ const MyLayout = props => , }; state = { @@ -36,7 +38,7 @@ class UserMenu extends React.Component { }; render() { - const { children, label, logout, translate } = this.props; + const { children, label, icon, logout, translate } = this.props; if (!logout && !children) return null; const { anchorEl } = this.state; const open = Boolean(anchorEl); @@ -47,11 +49,11 @@ class UserMenu extends React.Component { - + {icon}