Skip to content

Commit

Permalink
fix(components): pass href to NavItem link (#492)
Browse files Browse the repository at this point in the history
* fix(components): pass href to nav link

* fix(components): exclude inactive ButtonGroup styles
  • Loading branch information
connor-baer authored Oct 15, 2019
1 parent f3d0688 commit d0bad70
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/ButtonGroup/ButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ const alignmentMap = {
};

const alignmentStyles = ({ align }) => {
if (!align) {
return null;
}

const label = `button-group--${align}`;

return css`
Expand Down
5 changes: 4 additions & 1 deletion src/components/Sidebar/components/NavItem/NavItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const baseStyles = ({ theme }) => css`
padding: ${theme.spacings.bit};
cursor: pointer;
color: ${theme.colors.n500};
text-decoration: none;
* {
fill: ${theme.colors.n500};
}
Expand Down Expand Up @@ -98,7 +99,8 @@ const NavItem = ({
selected,
disabled,
onClick,
components
components,
...rest
}) => {
const icon = getIcon({ defaultIcon, selected, selectedIcon, disabled });
const Link = StyledLink.withComponent(components.Link);
Expand All @@ -111,6 +113,7 @@ const NavItem = ({
secondary={secondary}
visible={visible}
disabled={disabled}
{...rest}
>
{icon}
<NavLabel secondary={secondary} visible={visible}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ exports[`NavItem styles should render with default styles and match the snapshot
padding: 4px;
cursor: pointer;
color: #9DA7B1;
-webkit-text-decoration: none;
text-decoration: none;
}
.circuit-2 * {
Expand Down Expand Up @@ -67,6 +69,8 @@ exports[`NavItem styles should render with default styles and match the snapshot
padding: 4px;
cursor: pointer;
color: #9DA7B1;
-webkit-text-decoration: none;
text-decoration: none;
margin: 0px 24px;
padding: 4px 0px;
-webkit-transition: top 200ms ease-in-out;
Expand Down Expand Up @@ -128,6 +132,8 @@ exports[`NavItem styles should render with disabled state styles and match the s
padding: 4px;
cursor: pointer;
color: #9DA7B1;
-webkit-text-decoration: none;
text-decoration: none;
cursor: not-allowed;
color: #5C656F;
}
Expand Down Expand Up @@ -175,6 +181,8 @@ exports[`NavItem styles should render with selected state styles and match the s
padding: 4px;
cursor: pointer;
color: #9DA7B1;
-webkit-text-decoration: none;
text-decoration: none;
font-weight: 700;
color: #FAFBFC;
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/shared-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const themePropType = PropTypes.shape({
});

export const componentsPropType = PropTypes.shape({
Link: PropTypes.element
Link: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
});

export const localePropType = isRequired => (
Expand Down

0 comments on commit d0bad70

Please sign in to comment.