Skip to content

Commit

Permalink
Utilize viewBox property from bluemix-icons as the default viewBox di…
Browse files Browse the repository at this point in the history
  • Loading branch information
nsand authored and Christopher A. Dhanaraj committed Nov 1, 2016
1 parent cdff66f commit a06916f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
7 changes: 0 additions & 7 deletions components/OverflowMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ class OverflowMenu extends Component {
{ 'bx--overflow-menu--open': this.state.open },
);

const overriddenStyles = {
height: 40,
};

return (
<ClickListener onClickOutside={this.handleClickOutside}>
<div
Expand All @@ -98,9 +94,6 @@ class OverflowMenu extends Component {
name="overflow_menu_icon"
description={iconDescription}
fill="#dfe6eb"
height="40px"
viewBox="0 0 14 60"
style={overriddenStyles}
description="open and close the menu"
/>
<ul className="bx--overflow-menu__options">
Expand Down
10 changes: 4 additions & 6 deletions elements/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ const propTypes = {
fillRule: PropTypes.string,
width: PropTypes.string,
height: PropTypes.string,
viewBox: PropTypes.string,
style: PropTypes.object,
};

const defaultProps = {
fillRule: 'evenodd',
height: '32px',
width: '32px',
viewBox: '0 0 32 32',
};

/**
Expand Down Expand Up @@ -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 = {
Expand All @@ -115,7 +113,7 @@ const Icon = ({ className, fill, fillRule, height, width, name, viewBox, style,
height,
width,
name,
viewBox,
viewBox: svg ? svg.viewBox : undefined,
style,
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a06916f

Please sign in to comment.