Skip to content
Snippets Groups Projects
Commit 604e7387 authored by Kyle Doherty's avatar Kyle Doherty Committed by Allen Gilliland
Browse files

add proptypes and default props to icon component

parent ecca4554
No related branches found
No related tags found
No related merge requests found
import React, { Component, PropTypes } from "react";
import RetinaImage from "react-retina-image";
import { loadIcon } from 'metabase/icon_paths';
export default class Icon extends Component {
static propTypes = {
name: PropTypes.string.isRequired,
width: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number,
]),
height: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number,
]),
}
static defaultProps = {
width: 16,
height: 16
}
render() {
var icon = loadIcon(this.props.name);
if (icon.img) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment