UNPKG

2.06 kBJavaScriptView Raw
1var _class, _temp;
2
3function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
5function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
7function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
9import React, { PropTypes } from 'react';
10
11var MalibuIcon = (_temp = _class = function (_React$Component) {
12 _inherits(MalibuIcon, _React$Component);
13
14 function MalibuIcon() {
15 _classCallCheck(this, MalibuIcon);
16
17 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
18 }
19
20 MalibuIcon.prototype.render = function render() {
21 var _props = this.props,
22 fillClass = _props.fillClass,
23 name = _props.name,
24 size = _props.size;
25
26 var style = {};
27 if (size) {
28 style.width = size + 'px';
29 style.height = size + 'px';
30 }
31 return React.createElement(
32 'svg',
33 { style: style, className: 'malibu-fill-gradient-' + fillClass },
34 React.createElement('use', { xlinkHref: '#' + name })
35 );
36 };
37
38 return MalibuIcon;
39}(React.Component), _class.defaultProps = {
40 fillClass: 'purple'
41}, _temp);
42export { MalibuIcon as default };
43process.env.NODE_ENV !== "production" ? MalibuIcon.propTypes = {
44 fillClass: PropTypes.oneOf(['purple', 'dark-gray', 'red', 'orange', 'green', 'blue']),
45 name: PropTypes.string.isRequired,
46 size: PropTypes.number
47} : void 0;
\No newline at end of file