react-toolbox/components/font_icon/FontIcon.js

29 lines
583 B
JavaScript
Raw Normal View History

import React from 'react';
2016-05-16 15:18:53 +03:00
import classnames from 'classnames';
2015-11-23 01:41:00 +03:00
2016-05-16 15:18:53 +03:00
const FontIcon = ({ children, className, value, ...other}) => (
<span
data-react-toolbox='font-icon'
className={classnames({'material-icons': typeof value === 'string'}, className)}
{...other}
>
{value}
{children}
</span>
);
2015-09-19 18:53:31 +03:00
FontIcon.propTypes = {
2015-11-24 02:29:02 +03:00
children: React.PropTypes.any,
className: React.PropTypes.string,
value: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.element
])
};
2015-09-19 18:53:31 +03:00
FontIcon.defaultProps = {
className: ''
};
2015-09-19 18:53:31 +03:00
export default FontIcon;