diff --git a/src/Shared/Components/ActionMenu/ActionMenuItem.tsx b/src/Shared/Components/ActionMenu/ActionMenuItem.tsx index 636e3d464..96300da47 100644 --- a/src/Shared/Components/ActionMenu/ActionMenuItem.tsx +++ b/src/Shared/Components/ActionMenu/ActionMenuItem.tsx @@ -7,6 +7,8 @@ import { Icon } from '../Icon' import { getTooltipProps } from '../SelectPicker/common' import { ActionMenuItemProps } from './types' +const COMMON_ACTION_MENU_ITEM_CLASS = 'flex-grow-1 flex left top dc__gap-8 py-6 px-8' + export const ActionMenuItem = ({ item, itemRef, @@ -52,19 +54,25 @@ export const ActionMenuItem = ({ const renderContent = () => ( <> - - {label} - - {description && - (typeof description === 'string' ? ( - - {description} + {renderIcon(startIcon)} + + + + {label} - ) : ( - description - ))} + + {description && + (typeof description === 'string' ? ( + + {description} + + ) : ( + description + ))} + + {renderIcon(endIcon)} ) @@ -74,7 +82,7 @@ export const ActionMenuItem = ({ return ( } - className="flex-grow-1" + className={COMMON_ACTION_MENU_ITEM_CLASS} href={item.href} target="_blank" rel="noreferrer" @@ -84,7 +92,11 @@ export const ActionMenuItem = ({ ) case 'link': return ( - } className="flex-grow-1" to={item.to}> + } + className={COMMON_ACTION_MENU_ITEM_CLASS} + to={item.to} + > {renderContent()} ) @@ -94,7 +106,7 @@ export const ActionMenuItem = ({ @@ -111,13 +123,11 @@ export const ActionMenuItem = ({ onMouseEnter={onMouseEnter} tabIndex={-1} // Intentionally added margin to the left and right to have the gap on the edges of the options - className={`action-menu__option br-4 flex left top dc__gap-8 mr-4 ml-4 py-6 px-8 ${isDisabled ? 'dc__disabled' : 'cursor'} ${isNegativeType ? 'dc__hover-r50' : 'dc__hover-n50'} ${isFocused ? `action-menu__option--focused${isNegativeType ? '-negative' : ''}` : ''}`} + className={`action-menu__option br-4 mr-4 ml-4 ${isDisabled ? 'dc__disabled' : 'cursor'} ${isNegativeType ? 'dc__hover-r50' : 'dc__hover-n50'} ${isFocused ? `action-menu__option--focused${isNegativeType ? '-negative' : ''}` : ''}`} onClick={!isDisabled ? handleClick : undefined} aria-disabled={isDisabled} > - {renderIcon(startIcon)} {renderComponent()} - {renderIcon(endIcon)} )