File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { forwardRef } from 'react' ;
22import styles from '@patternfly/react-styles/css/components/Menu/menu' ;
33import { css } from '@patternfly/react-styles' ;
4- import StarIcon from '@patternfly/react-icons/dist/esm/icons/star-icon' ;
54import { MenuContext , MenuItemContext } from './MenuContext' ;
65import { Button } from '../Button' ;
76export interface MenuItemActionProps extends React . HTMLProps < HTMLDivElement > {
@@ -45,24 +44,18 @@ const MenuItemActionBase: React.FunctionComponent<MenuItemActionProps> = ({
4544 onActionClick && onActionClick ( event , itemId , actionId ) ;
4645 } ;
4746 return (
48- < div
49- className = { css (
50- styles . menuItemAction ,
51- isFavorited !== null && 'pf-m-favorite' ,
52- isFavorited && styles . modifiers . favorited ,
53- className
54- ) }
55- { ...props }
56- >
47+ < div className = { css ( styles . menuItemAction , className ) } { ...props } >
5748 < Button
5849 aria-label = { ariaLabel }
5950 onClick = { onClickButton }
6051 ref = { innerRef }
6152 role = "menuitem"
6253 variant = "plain"
54+ isFavorite = { isFavorited !== null }
55+ isFavorited = { isFavorited ?? false }
6356 tabIndex = { - 1 }
6457 isDisabled = { isDisabled || isDisabledContext }
65- icon = { icon === 'favorites' || isFavorited !== null ? < StarIcon /> : icon }
58+ icon = { isFavorited === null ? icon : undefined }
6659 />
6760 </ div >
6861 ) ;
You can’t perform that action at this time.
0 commit comments