Skip to content

Commit

Permalink
Allow <Link />'s icon to be targeted via a classname
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Palmer committed Mar 2, 2017
1 parent 264b2e5 commit 3d53839
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/Link/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import cx from 'classnames';
import css from './Link.css';
import Icon from '../Icon/Icon';

const Link = ({ href, className, children, ...rest }) => (
const Link = ({ href, className, iconClassName, children, ...rest }) => (
<a { ...rest } href={ href } className={ cx(css.root, className) }>
{ children } <Icon className={ css.icon } name="chevron" />
{ children } <Icon className={ cx(css.icon, iconClassName) } name="chevron" />
</a>
);

Link.propTypes = {
href: PropTypes.string,
className: PropTypes.string,
iconClassName: PropTypes.string,
children: PropTypes.node,
};

Expand Down

0 comments on commit 3d53839

Please sign in to comment.