bigbuffet-rw/app/soapbox/components/icon.js

30 lines
645 B
JavaScript
Raw Normal View History

/**
* Icon: abstract icon class that can render icons from multiple sets.
* @module soapbox/components/icon
* @see soapbox/components/fork_awesome_icon
*/
2020-03-27 13:59:38 -07:00
import React from 'react';
import PropTypes from 'prop-types';
import ForkAwesomeIcon from './fork_awesome_icon';
2020-03-27 13:59:38 -07:00
export default class Icon extends React.PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
iconset: PropTypes.string,
2020-03-27 13:59:38 -07:00
className: PropTypes.string,
fixedWidth: PropTypes.bool,
};
render() {
const { iconset, ...rest } = this.props;
switch(iconset) {
default:
return <ForkAwesomeIcon {...rest} />;
}
2020-03-27 13:59:38 -07:00
}
}