menuItemActionLink.tsx 758 B

12345678910111213141516171819202122232425262728293031
  1. import styled from '@emotion/styled';
  2. import ActionLink from 'sentry/components/actions/actionLink';
  3. import MenuItem from 'sentry/components/menuItem';
  4. function MenuItemActionLink({
  5. className,
  6. ...props
  7. }: React.ComponentProps<typeof ActionLink>) {
  8. return (
  9. <MenuItem noAnchor withBorder disabled={props.disabled} className={className}>
  10. <InnerActionLink {...props} />
  11. </MenuItem>
  12. );
  13. }
  14. const InnerActionLink = styled(ActionLink)`
  15. color: ${p => p.theme.textColor};
  16. ${p => p.theme.overflowEllipsis}
  17. &:hover {
  18. color: ${p => p.theme.textColor};
  19. }
  20. .dropdown-menu > li > &,
  21. .dropdown-menu > span > li > & {
  22. &.disabled:hover {
  23. background: ${p => p.theme.background};
  24. }
  25. }
  26. `;
  27. export default MenuItemActionLink;