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