File tree 1 file changed +5
-3
lines changed
packages/ra-ui-materialui/src/layout
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
- import * as React from 'react' ;
1
+ import React , { ReactElement } from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
import DashboardIcon from '@mui/icons-material/Dashboard' ;
4
4
import { useTranslate , useBasename } from 'ra-core' ;
5
5
6
6
import { MenuItemLink } from './MenuItemLink' ;
7
7
8
8
export const DashboardMenuItem = ( props : DashboardMenuItemProps ) => {
9
- const { locale, ...rest } = props ;
9
+ const { locale, leftIcon = < DashboardIcon /> , ...rest } = props ;
10
10
const translate = useTranslate ( ) ;
11
11
const basename = useBasename ( ) ;
12
12
return (
13
13
< MenuItemLink
14
14
to = { `${ basename } /` }
15
15
primaryText = { translate ( 'ra.page.dashboard' ) }
16
- leftIcon = { < DashboardIcon /> }
16
+ leftIcon = { leftIcon }
17
17
{ ...rest }
18
18
/>
19
19
) ;
20
20
} ;
21
21
22
22
export interface DashboardMenuItemProps {
23
+ leftIcon ?: ReactElement ;
23
24
locale ?: string ;
24
25
onClick ?: ( ) => void ;
25
26
dense ?: boolean ;
@@ -30,6 +31,7 @@ export interface DashboardMenuItemProps {
30
31
}
31
32
32
33
DashboardMenuItem . propTypes = {
34
+ leftIcon : PropTypes . element ,
33
35
locale : PropTypes . string ,
34
36
onClick : PropTypes . func ,
35
37
dense : PropTypes . bool ,
You can’t perform that action at this time.
0 commit comments