Skip to content

Commit

Permalink
feat(Menu): add item disabled state
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Aug 14, 2019
1 parent f84ce26 commit dd8adfd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/Menu/Menu.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default (asStory) => {
<Menu>
<Menu.Item>Tramman</Menu.Item>
<Menu.Item>Gripman</Menu.Item>
<Menu.Item>Proalliance</Menu.Item>
<Menu.Item disabled>Proalliance</Menu.Item>
</Menu>
));
});
Expand Down
7 changes: 7 additions & 0 deletions src/components/Menu/Menu.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const [MenuItemTag, themeMenuItem] = createThemeTag(`${name}Item`, ({ COLORS, SI
color: COLORS.BLACK,
},
},
modifiers: {
disabled: {
pointerEvents: 'none',
cursor: 'default',
color: COLORS.DISABLED_COLOR,
},
},
}));


Expand Down
1 change: 1 addition & 0 deletions src/components/Menu/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { MenuItemTag } from './Menu.theme';

type MenuItemProps = {
children?: React$Node,
disabled?: boolean,
};


Expand Down

0 comments on commit dd8adfd

Please sign in to comment.