Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
feat: update SideNav and Menu (#2294)
Browse files Browse the repository at this point in the history
- Use new PropTypes.elementType to allow for `Link`
- Make menu icons optional
  • Loading branch information
vpicone authored Apr 30, 2019
1 parent b910758 commit 1dda7ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/components/UIShell/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ const LinkPropTypes = {
* The base element to use to build the link. Defaults to `a`, can also accept
* alternative tag names or custom components like `Link` from `react-router`.
*/
element: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node,
PropTypes.func,
]),
element: PropTypes.elementType,
};

Link.displayName = 'Link';
Expand Down
4 changes: 2 additions & 2 deletions src/components/UIShell/SideNavMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class SideNavMenu extends React.Component {
/**
* Pass in a custom icon to render next to the `SideNavMenu` title
*/
icon: PropTypes.node.isRequired,
icon: PropTypes.node,

/**
* Specify whether the `SideNavMenu` is "active". `SideNavMenu` should be
Expand Down Expand Up @@ -90,7 +90,7 @@ export class SideNavMenu extends React.Component {
onClick={this.handleToggleExpand}
ref={buttonRef}
type="button">
<SideNavIcon>{icon}</SideNavIcon>
{icon && <SideNavIcon>{icon}</SideNavIcon>}
<span className={`${prefix}--side-nav__submenu-title`}>{title}</span>
<SideNavIcon className={`${prefix}--side-nav__submenu-chevron`} small>
<ChevronDown20 />
Expand Down

0 comments on commit 1dda7ed

Please sign in to comment.