menuItemActionLink.tsx 808 B

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