Skip to content

Commit

Permalink
[dagit] Update MenuLink to support a disabled state (#8200)
Browse files Browse the repository at this point in the history
* [dagit] Update MenuLink to support a disabled state

* PR feedback!

Co-authored-by: bengotow <bgotow@elementl.com>
  • Loading branch information
bengotow and bengotow committed Jun 7, 2022
1 parent 076fb86 commit 73d459b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions js_modules/dagit/packages/core/src/ui/MenuLink.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// eslint-disable-next-line no-restricted-imports
import {MenuItem} from '@blueprintjs/core';
import {Box, Colors, CommonMenuItemProps, IconWrapper, iconWithColor} from '@dagster-io/ui';
import {
Box,
Colors,
CommonMenuItemProps,
IconWrapper,
iconWithColor,
MenuItem,
} from '@dagster-io/ui';
import * as React from 'react';
import {Link, LinkProps} from 'react-router-dom';
import styled from 'styled-components/macro';
Expand All @@ -14,8 +20,11 @@ interface MenuLinkProps
* If you want to use a menu item as a link, use `MenuLink` and provide a `to` prop.
*/
export const MenuLink: React.FC<MenuLinkProps> = (props) => {
const {icon, intent, text, ...rest} = props;
const {icon, intent, text, disabled, ...rest} = props;

if (disabled) {
return <MenuItem disabled icon={icon} intent={intent} text={text} />;
}
return (
<StyledMenuLink {...rest}>
<Box flex={{direction: 'row', gap: 8, alignItems: 'center'}}>
Expand Down

0 comments on commit 73d459b

Please sign in to comment.