From a06916f22840989190abfa70b036801a78a36a93 Mon Sep 17 00:00:00 2001 From: Nicholas Sandonato Date: Tue, 1 Nov 2016 16:39:03 -0400 Subject: [PATCH] Utilize viewBox property from bluemix-icons as the default viewBox dimensions. Fixes #199 (#200) --- components/OverflowMenu.js | 7 ------- elements/Icon.js | 10 ++++------ package.json | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/components/OverflowMenu.js b/components/OverflowMenu.js index 4a4711c90d43..0d2d5d8f1c33 100644 --- a/components/OverflowMenu.js +++ b/components/OverflowMenu.js @@ -78,10 +78,6 @@ class OverflowMenu extends Component { { 'bx--overflow-menu--open': this.state.open }, ); - const overriddenStyles = { - height: 40, - }; - return (
    diff --git a/elements/Icon.js b/elements/Icon.js index 2393b0479bc9..f8875084f3b6 100644 --- a/elements/Icon.js +++ b/elements/Icon.js @@ -9,7 +9,6 @@ const propTypes = { fillRule: PropTypes.string, width: PropTypes.string, height: PropTypes.string, - viewBox: PropTypes.string, style: PropTypes.object, }; @@ -17,7 +16,6 @@ const defaultProps = { fillRule: 'evenodd', height: '32px', width: '32px', - viewBox: '0 0 32 32', }; /** @@ -102,10 +100,10 @@ export function getSvgContent(svgData) { return svgElements; } -const Icon = ({ className, fill, fillRule, height, width, name, viewBox, style, description }) => { +const Icon = ({ className, fill, fillRule, height, width, name, style, description }) => { // SVG Content and Data for Render - const svgData = getSvgData(name); - const svgContent = getSvgContent(svgData); + const svg = findIcon(name); + const svgContent = svg ? getSvgContent(svg.svgData) : ''; // Props const props = { @@ -115,7 +113,7 @@ const Icon = ({ className, fill, fillRule, height, width, name, viewBox, style, height, width, name, - viewBox, + viewBox: svg ? svg.viewBox : undefined, style, }; diff --git a/package.json b/package.json index 91ae7a39b462..46ac643dc8cd 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ }, "dependencies": { "@console/bluemix-components": "6.8.3", - "@console/bluemix-icons": "3.0.0-beta2", + "@console/bluemix-icons": "3.0.1", "classnames": "2.2.5", "react": "^15.3.2", "react-dom": "^15.3.2"