Skip to content
Snippets Groups Projects
Commit e969053f authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #2418 from metabase/icon-default-size

restore proper icon defaults
parents 6618f191 3bdb753d
Branches
Tags
No related merge requests found
......@@ -21,19 +21,14 @@ export default class Icon extends Component {
render() {
const icon = loadIcon(this.props.name);
const defaultProps = {
width: 16,
height: 16
};
if (!icon) {
return <span className="hide" />;
} else if (icon.img) {
return (<RetinaImage forceOriginalDimensions={false} {...defaultProps} {...icon.attrs} {...this.props} src={icon.img} />);
return (<RetinaImage forceOriginalDimensions={false} {...icon.attrs} {...this.props} src={icon.img} />);
} else if (icon.svg) {
return (<svg {...defaultProps} {...icon.attrs} {...this.props} dangerouslySetInnerHTML={{__html: icon.svg}}></svg>);
return (<svg {...icon.attrs} {...this.props} dangerouslySetInnerHTML={{__html: icon.svg}}></svg>);
} else {
return (<svg {...defaultProps} {...icon.attrs} {...this.props}><path d={icon.path} /></svg>);
return (<svg {...icon.attrs} {...this.props}><path d={icon.path} /></svg>);
}
}
}
......@@ -195,8 +195,8 @@ export function loadIcon(name) {
var icon = {
attrs: {
className: 'Icon Icon-' + name,
width: '32px',
height: '32px',
width: '16px',
height: '16px',
viewBox: '0 0 32 32',
fill: 'currentcolor'
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment