icon.jsx 353 B

123456789101112131415161718
  1. import React, {PureComponent} from 'react';
  2. export default class Icon extends PureComponent {
  3. render() {
  4. const {className, glyph, ...restProps} = this.props;
  5. return (
  6. <svg className={className} {...restProps}>
  7. <use xlinkHref={`#${glyph}`} />
  8. </svg>
  9. );
  10. }
  11. }
  12. Icon.defaultProps = {
  13. glyph: '',
  14. className: 'icon'
  15. };