Skip to content

Commit

Permalink
Update suomifi-icons to 0.0.10 and add support for more Icon props in…
Browse files Browse the repository at this point in the history
…cluding fill.
  • Loading branch information
aappoalander committed Nov 13, 2019
1 parent 0ea4bd0 commit 7976e0a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"react-svg": "7.2.2",
"styled-components": "4.3.2",
"suomifi-design-tokens": "0.2.1",
"suomifi-icons": "0.0.8",
"suomifi-icons": "0.0.10",
"uuid": "3.3.2"
},
"peerDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Svg/Svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface SvgProps {
/** Show mouse cursor as hand-pointer */
mousePointer?: boolean;
testId?: string;
/** Allow passing custom attributes */
[key: string]: any;
}

export const Svg = styled(
Expand Down
19 changes: 5 additions & 14 deletions src/core/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,15 @@ export class Icon extends Component<IconProps> {
} = withSuomifiDefaultProps(this.props);
const { className, ariaLabel } = this.props;

const iconColor =
color !== undefined ? color : colorValue({ tokens })('depthDark27');

if (!!src) {
return (
<StyledIcon
src={src}
{...passProps}
color={colorValue({ tokens })('depthDark27')}
/>
);
return <StyledIcon src={src} {...passProps} color={iconColor} />;
}

if (icon !== undefined) {
return (
<StyledSuomifiIcon
{...passProps}
icon={icon}
color={colorValue({ tokens })('depthDark27')}
/>
);
return <StyledSuomifiIcon {...passProps} icon={icon} color={iconColor} />;
}

logger.warn(
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10546,10 +10546,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/suomifi-design-tokens/-/suomifi-design-tokens-0.2.1.tgz#adfa14df6617ab26b96884b7071789a398bcf1e7"
integrity sha512-C8pkDmi9A8hradqiVfKxtfqfNIGl9ky8T5RoCa7oQRORTzxFu1RudJ83SDkm4/iLR64mCLByeMtwZFvKCveCDw==

[email protected].8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/suomifi-icons/-/suomifi-icons-0.0.8.tgz#2a25de59b9e945321d504c0c393f8371d8213bbb"
integrity sha512-C/qsOpERN73eyAMjpOMtGPw2NkS1R57VVk/cjsxM7mmlDMiBYjCdXM8XYa3HPsGxlznEHxNmCxWqMf4z/QF1WA==
[email protected].10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/suomifi-icons/-/suomifi-icons-0.0.10.tgz#d2e32f7e03c53b86d1efeeada037a0f420a01804"
integrity sha512-tPh7CFBOGyyK0qaBU7dlOsHn9c8hLi0qpNHXz2xhHbVOkPD6bGLDlrtkQVdvni5nRi9zYJ2xeiaSZ7azADTeLQ==

supports-color@^2.0.0:
version "2.0.0"
Expand Down

0 comments on commit 7976e0a

Please sign in to comment.