UNPKG

feeles-ide

Version:

The hackable and serializable IDE to make learning material

58 lines (50 loc) 1.74 kB
import _extends from 'babel-runtime/helpers/extends'; import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _createClass from 'babel-runtime/helpers/createClass'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { fullWhite, transparent } from 'material-ui/styles/colors'; var SvgButton = function (_PureComponent) { _inherits(SvgButton, _PureComponent); function SvgButton() { _classCallCheck(this, SvgButton); return _possibleConstructorReturn(this, (SvgButton.__proto__ || _Object$getPrototypeOf(SvgButton)).apply(this, arguments)); } _createClass(SvgButton, [{ key: 'render', value: function render() { var svgStyle = { width: 24, height: 24 }; var style = _extends({ backgroundColor: transparent, border: 'none', outline: 'none', cursor: 'pointer' }, this.props.style); return React.createElement( 'button', { style: style, onClick: this.props.onClick }, React.createElement( 'svg', { fill: fullWhite, style: svgStyle, viewBox: '0 0 24 24' }, React.createElement('path', { d: this.props.children }) ) ); } }]); return SvgButton; }(PureComponent); SvgButton.propTypes = { onClick: PropTypes.func.isRequired, style: PropTypes.object.isRequired, children: PropTypes.object.isRequired }; SvgButton.defaultProps = { style: {} }; export default SvgButton;